diff --git a/build.gradle b/build.gradle index e7eed662..231effa6 100644 --- a/build.gradle +++ b/build.gradle @@ -17,12 +17,12 @@ buildscript { } apply plugin: 'forge' -version = "1.5.7" +version = "1.5.8" // http://docs.codehaus.org/display/MAVEN/Versioning group = "info.jbcs.minecraft.chisel" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Chisel" minecraft { - version = "1.7.10-10.13.0.1180" + version = "1.7.10-10.13.0.1207" runDir = "run" replaceIn "Chisel.java" @@ -93,4 +93,4 @@ task sourcesJar(type: Jar) { artifacts { archives deobfJar archives sourcesJar -} \ No newline at end of file +} diff --git a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java index 35817ed4..c6255b95 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/Chisel.java +++ b/src/main/java/info/jbcs/minecraft/chisel/Chisel.java @@ -15,6 +15,7 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry.Type; +import info.jbcs.minecraft.chisel.block.BlockCarvable; import info.jbcs.minecraft.chisel.carving.Carving; import info.jbcs.minecraft.chisel.client.gui.GuiChisel; import info.jbcs.minecraft.chisel.entity.EntityBallOMoss; @@ -56,9 +57,9 @@ public class Chisel public static boolean multipartLoaded = false; - public static final StepSoundEx soundHolystoneFootstep = new StepSoundEx("chisel:holystone", "chisel:holystone", "chisel:holystone", 1.0f); - public static final StepSoundEx soundTempleFootstep = new StepSoundEx("dig.stone", "chisel:temple-footstep", "dig.stone", 1.0f); - public static final StepSoundEx soundMetalFootstep = new StepSoundEx("chisel:metal", "chisel:metal", "chisel:metal", 1.0f); + public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType("holystone", 1.0f, 1.0f); + public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType("dig.stone", MOD_ID+":step.templeblock", 1.0f, 1.0f); + public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f); public static int RenderEldritchId; public static int RenderCTMId; diff --git a/src/main/java/info/jbcs/minecraft/chisel/ChiselBlocks.java b/src/main/java/info/jbcs/minecraft/chisel/ChiselBlocks.java index ff622be8..bef9f3c3 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/ChiselBlocks.java +++ b/src/main/java/info/jbcs/minecraft/chisel/ChiselBlocks.java @@ -796,7 +796,7 @@ public class ChiselBlocks Blocks.planks.setHarvestLevel("chisel", 0, i); blockPlanks[i].setHarvestLevel("axe", 0); - Carving.chisel.setVariationSound("wood-" + n, "chisel:chisel-wood"); + Carving.chisel.setVariationSound("wood-" + n, Chisel.MOD_ID+":chisel.wood"); } } diff --git a/src/main/java/info/jbcs/minecraft/chisel/StepSoundEx.java b/src/main/java/info/jbcs/minecraft/chisel/StepSoundEx.java deleted file mode 100644 index cf9340b5..00000000 --- a/src/main/java/info/jbcs/minecraft/chisel/StepSoundEx.java +++ /dev/null @@ -1,29 +0,0 @@ -package info.jbcs.minecraft.chisel; - -import net.minecraft.block.Block.SoundType; - -public class StepSoundEx extends SoundType -{ - String stepName; - String placeName; - - public StepSoundEx(String name, String stepName, String placeName, float volume) - { - super(name, volume, 1.0f); - - this.stepName = stepName; - this.placeName = placeName; - } - - @Override - public String getBreakSound() - { - return this.soundName; - } - - @Override - public String getStepResourcePath() - { - return this.stepName; - } -} diff --git a/src/main/java/info/jbcs/minecraft/chisel/block/BlockCarvable.java b/src/main/java/info/jbcs/minecraft/chisel/block/BlockCarvable.java index f90f02e6..5f456caf 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/block/BlockCarvable.java +++ b/src/main/java/info/jbcs/minecraft/chisel/block/BlockCarvable.java @@ -88,4 +88,104 @@ public class BlockCarvable extends Block implements ICarvable return carverHelper.getVariation(metadata); } + + public static class SoundType extends Block.SoundType + { + public final String soundNameStep; + public final String soundNameBreak; + public final String soundNamePlace; + + /** + * Creates a SoundType with automatic names for step and break sounds. + * Sound names dig.soundName and step.soundName must be specified in the + * sounds.json + * + * @param soundName + * block of the sound. Will automatically be expanded to + * "mod:dig.soundName" and "mod:step.soundName" respectively) + * @param volume + * default 1.0f + * @param frequency + * default 1.0f + */ + public SoundType(String soundName, float volume, float frequency) + { + super(soundName, volume, frequency); + this.soundNameStep = null; + this.soundNameBreak = null; + this.soundNamePlace = null; + } + + /** + * Creates a SoundType with manual names for step and break sounds. + * Sound names must be specified in the sounds.json + * + * @param soundNameBreak + * block break sound + * @param soundNameStep + * block step sound + * @param volume + * default 1.0f + * @param frequency + * default 1.0f + */ + public SoundType(String soundNameBreak, String soundNameStep, float volume, float frequency) + { + super(soundNameStep, volume, frequency); + this.soundNameStep = soundNameStep; + this.soundNameBreak = soundNameBreak; + this.soundNamePlace = null; + } + + /** + * Creates a SoundType with manual names for step, break and place + * sounds. Sound names must be specified in the sounds.json + * + * @param soundNameBreak + * block break sound + * @param soundNameStep + * block step sound + * @param soundNamePlace + * block place sound + * @param volume + * default 1.0f + * @param frequency + * default 1.0f + */ + public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume, float frequency) + { + super(soundNameStep, volume, frequency); + this.soundNameStep = soundNameStep; + this.soundNameBreak = soundNameBreak; + this.soundNamePlace = soundNamePlace; + } + + @Override + public String getBreakSound() + { + if(soundNameBreak == null) + return Chisel.MOD_ID + ":dig." + this.soundName; + else + return this.soundNameBreak; + } + + @Override + public String getStepResourcePath() + { + if(soundNameStep == null) + return Chisel.MOD_ID + ":step." + this.soundName; + else + return this.soundNameStep; + } + + @Override + public String func_150496_b() + { + if(soundNamePlace == null) + return getBreakSound(); + else + return this.soundNamePlace; + } + } + } diff --git a/src/main/java/info/jbcs/minecraft/chisel/carving/Carving.java b/src/main/java/info/jbcs/minecraft/chisel/carving/Carving.java index 4c4d0303..b9319147 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/carving/Carving.java +++ b/src/main/java/info/jbcs/minecraft/chisel/carving/Carving.java @@ -5,6 +5,7 @@ import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; +import info.jbcs.minecraft.chisel.Chisel; import java.util.ArrayList; import java.util.Collections; @@ -182,7 +183,7 @@ public class Carving { CarvingGroup blockGroup = carvingGroupsByVariation.get(key(item, metadata)); if(blockGroup == null || blockGroup.sound == null) - return "chisel:chisel"; + return Chisel.MOD_ID+":chisel.fallback"; return blockGroup.sound; } diff --git a/src/main/java/info/jbcs/minecraft/chisel/entity/EntityBallOMoss.java b/src/main/java/info/jbcs/minecraft/chisel/entity/EntityBallOMoss.java index a1c03eae..0cee1f9a 100644 --- a/src/main/java/info/jbcs/minecraft/chisel/entity/EntityBallOMoss.java +++ b/src/main/java/info/jbcs/minecraft/chisel/entity/EntityBallOMoss.java @@ -1,5 +1,6 @@ package info.jbcs.minecraft.chisel.entity; +import info.jbcs.minecraft.chisel.Chisel; import info.jbcs.minecraft.chisel.ChiselBlocks; import info.jbcs.minecraft.chisel.client.GeneralChiselClient; import info.jbcs.minecraft.utilities.General; @@ -61,7 +62,7 @@ public class EntityBallOMoss extends EntityThrowable if(worldObj.isRemote) { - worldObj.playSound(x, y, z, "chisel:squash", 1.0f, 1.0f, false); + worldObj.playSound(x, y, z, Chisel.MOD_ID+":random.squash", 1.0f, 1.0f, false); for(int i = 0; i < 32; i++) GeneralChiselClient.spawnBallOMossFX(worldObj, posX, posY, posZ); diff --git a/src/main/resources/assets/chisel/sounds.json b/src/main/resources/assets/chisel/sounds.json index 12f0c24e..4ed4358a 100644 --- a/src/main/resources/assets/chisel/sounds.json +++ b/src/main/resources/assets/chisel/sounds.json @@ -1,8 +1,72 @@ { - "chisel": {"category": "block", "sounds": ["chisel"]}, - "chisel-wood": {"category": "block", "sounds": ["chisel-wood2", "chisel-wood3", "chisel-wood4", "chisel-wood5", "chisel-wood8", "chisel-wood9", "chisel-wood11"]}, - "holystone": {"category": "block", "sounds": ["holystone1", "holystone2", "holystone3", "holystone5", "holystone7"]}, - "squash": {"category": "block", "sounds": ["squash", "squash2"]}, - "temple-footstep": {"category": "block", "sounds": ["temple-footstep1", "temple-footstep2", "temple-footstep3", "temple-footstep4", "temple-footstep5"]}, - "metal": {"category": "block", "sounds": ["metal1", "metal2", "metal3", "metal4", "metal5", "metal6", "metal7", "metal8", "metal9"]} + "chisel.fallback":{ + "category":"player", + "sounds":[ + "chisel/fallback" + ] + }, + "chisel.wood":{ + "category":"player", + "sounds":[ + "chisel/wood2", + "chisel/wood3", + "chisel/wood4", + "chisel/wood5", + "chisel/wood8", + "chisel/wood9", + "chisel/wood11" + ] + }, + "random.squash":{ + "category":"neutral", + "sounds":[ + "random/squash", + "random/squash2" + ] + }, + "dig.holystone":{ + "category":"block", + "sounds":[ + "dig/holystone1", + "dig/holystone2", + "dig/holystone5" + ] + }, + "dig.metal":{ + "category":"block", + "sounds":[ + "dig/metal", + "dig/metal1", + "dig/metal2", + "dig/metal3", + "dig/metal7", + "dig/metal8" + ] + }, + "step.templeblock":{ + "category":"neutral", + "sounds":[ + "step/templeblock1", + "step/templeblock2", + "step/templeblock3", + "step/templeblock4", + "step/templeblock5" + ] + }, + "step.holystone":{ + "category":"neutral", + "sounds":[ + "step/holystone3", + "step/holystone7" + ] + }, + "step.metal":{ + "category":"neutral", + "sounds":[ + "step/metal4", + "step/metal5", + "step/metal6", + "step/metal9" + ] + } } diff --git a/src/main/resources/assets/chisel/sounds/0/temple-footstep1.ogg b/src/main/resources/assets/chisel/sounds/0/temple-footstep1.ogg deleted file mode 100644 index ba09560e..00000000 Binary files a/src/main/resources/assets/chisel/sounds/0/temple-footstep1.ogg and /dev/null differ diff --git a/src/main/resources/assets/chisel/sounds/0/temple-footstep2.ogg b/src/main/resources/assets/chisel/sounds/0/temple-footstep2.ogg deleted file mode 100644 index 7706b8ed..00000000 Binary files a/src/main/resources/assets/chisel/sounds/0/temple-footstep2.ogg and /dev/null differ diff --git a/src/main/resources/assets/chisel/sounds/0/temple-footstep3.ogg b/src/main/resources/assets/chisel/sounds/0/temple-footstep3.ogg deleted file mode 100644 index fda7ebe0..00000000 Binary files a/src/main/resources/assets/chisel/sounds/0/temple-footstep3.ogg and /dev/null differ diff --git a/src/main/resources/assets/chisel/sounds/0/temple-footstep4.ogg b/src/main/resources/assets/chisel/sounds/0/temple-footstep4.ogg deleted file mode 100644 index 5beaf2c0..00000000 Binary files a/src/main/resources/assets/chisel/sounds/0/temple-footstep4.ogg and /dev/null differ diff --git a/src/main/resources/assets/chisel/sounds/0/temple-footstep5.ogg b/src/main/resources/assets/chisel/sounds/0/temple-footstep5.ogg deleted file mode 100644 index 27d8d57c..00000000 Binary files a/src/main/resources/assets/chisel/sounds/0/temple-footstep5.ogg and /dev/null differ diff --git a/src/main/resources/assets/chisel/sounds/chisel.ogg b/src/main/resources/assets/chisel/sounds/chisel/fallback.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/chisel.ogg rename to src/main/resources/assets/chisel/sounds/chisel/fallback.ogg diff --git a/src/main/resources/assets/chisel/sounds/chisel-wood11.ogg b/src/main/resources/assets/chisel/sounds/chisel/wood11.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/chisel-wood11.ogg rename to src/main/resources/assets/chisel/sounds/chisel/wood11.ogg diff --git a/src/main/resources/assets/chisel/sounds/chisel-wood2.ogg b/src/main/resources/assets/chisel/sounds/chisel/wood2.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/chisel-wood2.ogg rename to src/main/resources/assets/chisel/sounds/chisel/wood2.ogg diff --git a/src/main/resources/assets/chisel/sounds/chisel-wood3.ogg b/src/main/resources/assets/chisel/sounds/chisel/wood3.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/chisel-wood3.ogg rename to src/main/resources/assets/chisel/sounds/chisel/wood3.ogg diff --git a/src/main/resources/assets/chisel/sounds/chisel-wood4.ogg b/src/main/resources/assets/chisel/sounds/chisel/wood4.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/chisel-wood4.ogg rename to src/main/resources/assets/chisel/sounds/chisel/wood4.ogg diff --git a/src/main/resources/assets/chisel/sounds/chisel-wood5.ogg b/src/main/resources/assets/chisel/sounds/chisel/wood5.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/chisel-wood5.ogg rename to src/main/resources/assets/chisel/sounds/chisel/wood5.ogg diff --git a/src/main/resources/assets/chisel/sounds/chisel-wood8.ogg b/src/main/resources/assets/chisel/sounds/chisel/wood8.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/chisel-wood8.ogg rename to src/main/resources/assets/chisel/sounds/chisel/wood8.ogg diff --git a/src/main/resources/assets/chisel/sounds/chisel-wood9.ogg b/src/main/resources/assets/chisel/sounds/chisel/wood9.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/chisel-wood9.ogg rename to src/main/resources/assets/chisel/sounds/chisel/wood9.ogg diff --git a/src/main/resources/assets/chisel/sounds/holystone1.ogg b/src/main/resources/assets/chisel/sounds/dig/holystone1.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/holystone1.ogg rename to src/main/resources/assets/chisel/sounds/dig/holystone1.ogg diff --git a/src/main/resources/assets/chisel/sounds/holystone2.ogg b/src/main/resources/assets/chisel/sounds/dig/holystone2.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/holystone2.ogg rename to src/main/resources/assets/chisel/sounds/dig/holystone2.ogg diff --git a/src/main/resources/assets/chisel/sounds/holystone5.ogg b/src/main/resources/assets/chisel/sounds/dig/holystone5.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/holystone5.ogg rename to src/main/resources/assets/chisel/sounds/dig/holystone5.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal.ogg b/src/main/resources/assets/chisel/sounds/dig/metal.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal.ogg rename to src/main/resources/assets/chisel/sounds/dig/metal.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal1.ogg b/src/main/resources/assets/chisel/sounds/dig/metal1.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal1.ogg rename to src/main/resources/assets/chisel/sounds/dig/metal1.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal2.ogg b/src/main/resources/assets/chisel/sounds/dig/metal2.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal2.ogg rename to src/main/resources/assets/chisel/sounds/dig/metal2.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal3.ogg b/src/main/resources/assets/chisel/sounds/dig/metal3.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal3.ogg rename to src/main/resources/assets/chisel/sounds/dig/metal3.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal7.ogg b/src/main/resources/assets/chisel/sounds/dig/metal7.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal7.ogg rename to src/main/resources/assets/chisel/sounds/dig/metal7.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal8.ogg b/src/main/resources/assets/chisel/sounds/dig/metal8.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal8.ogg rename to src/main/resources/assets/chisel/sounds/dig/metal8.ogg diff --git a/src/main/resources/assets/chisel/sounds/squash.ogg b/src/main/resources/assets/chisel/sounds/random/squash.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/squash.ogg rename to src/main/resources/assets/chisel/sounds/random/squash.ogg diff --git a/src/main/resources/assets/chisel/sounds/squash2.ogg b/src/main/resources/assets/chisel/sounds/random/squash2.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/squash2.ogg rename to src/main/resources/assets/chisel/sounds/random/squash2.ogg diff --git a/src/main/resources/assets/chisel/sounds/holystone3.ogg b/src/main/resources/assets/chisel/sounds/step/holystone3.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/holystone3.ogg rename to src/main/resources/assets/chisel/sounds/step/holystone3.ogg diff --git a/src/main/resources/assets/chisel/sounds/holystone7.ogg b/src/main/resources/assets/chisel/sounds/step/holystone7.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/holystone7.ogg rename to src/main/resources/assets/chisel/sounds/step/holystone7.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal4.ogg b/src/main/resources/assets/chisel/sounds/step/metal4.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal4.ogg rename to src/main/resources/assets/chisel/sounds/step/metal4.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal5.ogg b/src/main/resources/assets/chisel/sounds/step/metal5.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal5.ogg rename to src/main/resources/assets/chisel/sounds/step/metal5.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal6.ogg b/src/main/resources/assets/chisel/sounds/step/metal6.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal6.ogg rename to src/main/resources/assets/chisel/sounds/step/metal6.ogg diff --git a/src/main/resources/assets/chisel/sounds/metal9.ogg b/src/main/resources/assets/chisel/sounds/step/metal9.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/metal9.ogg rename to src/main/resources/assets/chisel/sounds/step/metal9.ogg diff --git a/src/main/resources/assets/chisel/sounds/temple-footstep1.ogg b/src/main/resources/assets/chisel/sounds/step/templeblock1.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/temple-footstep1.ogg rename to src/main/resources/assets/chisel/sounds/step/templeblock1.ogg diff --git a/src/main/resources/assets/chisel/sounds/temple-footstep2.ogg b/src/main/resources/assets/chisel/sounds/step/templeblock2.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/temple-footstep2.ogg rename to src/main/resources/assets/chisel/sounds/step/templeblock2.ogg diff --git a/src/main/resources/assets/chisel/sounds/temple-footstep3.ogg b/src/main/resources/assets/chisel/sounds/step/templeblock3.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/temple-footstep3.ogg rename to src/main/resources/assets/chisel/sounds/step/templeblock3.ogg diff --git a/src/main/resources/assets/chisel/sounds/temple-footstep4.ogg b/src/main/resources/assets/chisel/sounds/step/templeblock4.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/temple-footstep4.ogg rename to src/main/resources/assets/chisel/sounds/step/templeblock4.ogg diff --git a/src/main/resources/assets/chisel/sounds/temple-footstep5.ogg b/src/main/resources/assets/chisel/sounds/step/templeblock5.ogg similarity index 100% rename from src/main/resources/assets/chisel/sounds/temple-footstep5.ogg rename to src/main/resources/assets/chisel/sounds/step/templeblock5.ogg