From 82f905f3c7d3a478b824e621f6df835856f7c1e2 Mon Sep 17 00:00:00 2001 From: Roadhog360 Date: Mon, 25 Sep 2023 23:14:04 -0500 Subject: [PATCH] Add sponge sounds, update reference to 1.20.2 Also remove dig.stone being used as the sponge absorb sound because it's no longer vanilla, and it just made no sense. If new block sounds are off sponge absorbing will not have a sound. --- src/main/java/ganymedes01/etfuturum/EtFuturum.java | 9 ++++++++- .../java/ganymedes01/etfuturum/blocks/BlockSponge.java | 9 +++++++-- .../ganymedes01/etfuturum/client/sound/ModSounds.java | 2 ++ src/main/java/ganymedes01/etfuturum/lib/Reference.java | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/java/ganymedes01/etfuturum/EtFuturum.java b/src/main/java/ganymedes01/etfuturum/EtFuturum.java index b1b4c9753..aaa24bcd9 100644 --- a/src/main/java/ganymedes01/etfuturum/EtFuturum.java +++ b/src/main/java/ganymedes01/etfuturum/EtFuturum.java @@ -418,6 +418,7 @@ public void onLoadComplete(FMLLoadCompleteEvent e) { Blocks.unpowered_repeater.setStepSound(Block.soundTypeStone); Blocks.powered_comparator.setStepSound(Block.soundTypeStone); Blocks.unpowered_comparator.setStepSound(Block.soundTypeStone); + Blocks.sponge.setStepSound(ModSounds.soundSponge); } if (ConfigBlocksItems.enableDyedBeds) { Blocks.bed.blockMaterial = Material.wood; @@ -527,6 +528,12 @@ public float getPitch(World world, int x, int y, int z, float pitch, MultiBlockS } MultiBlockSoundRegistry.multiBlockSounds.put(ModBlocks.AMETHYST_CLUSTER_2.get(), mbs); } + + if (ModBlocks.SPONGE.isEnabled()) { + BasicMultiBlockSound mbs = new BasicMultiBlockSound(); + mbs.setTypes(1, ModSounds.soundWetSponge); + MultiBlockSoundRegistry.multiBlockSounds.put(ModBlocks.SPONGE.get(), mbs); + } } /** @@ -923,6 +930,7 @@ private static void getSounds(ADConfig config) { config.addSoundEvent(ver, "block.beehive.exit", "neutral"); config.addSoundEvent(ver, "block.beehive.work", "neutral"); config.addSoundEvent(ver, "block.beehive.shear", "player"); + config.addSoundEvent(ver, "block.sponge.absorb", "block"); //Automatically register block sounds for AssetDirector, but only if they contain the MC version (which means it needs to be registered here) //Then we remove the mc version prefix and register that sound. @@ -939,5 +947,4 @@ private static void getSounds(ADConfig config) { } } } - } diff --git a/src/main/java/ganymedes01/etfuturum/blocks/BlockSponge.java b/src/main/java/ganymedes01/etfuturum/blocks/BlockSponge.java index 5df7a6fd4..580c9ca6f 100644 --- a/src/main/java/ganymedes01/etfuturum/blocks/BlockSponge.java +++ b/src/main/java/ganymedes01/etfuturum/blocks/BlockSponge.java @@ -5,8 +5,11 @@ import cpw.mods.fml.relauncher.SideOnly; import ganymedes01.etfuturum.EtFuturum; import ganymedes01.etfuturum.ModBlocks; +import ganymedes01.etfuturum.client.sound.ModSounds; +import ganymedes01.etfuturum.configuration.configs.ConfigSounds; import ganymedes01.etfuturum.configuration.configs.ConfigWorld; import ganymedes01.etfuturum.core.utils.Utils; +import ganymedes01.etfuturum.lib.Reference; import ganymedes01.etfuturum.world.WorldCoord; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -27,7 +30,7 @@ public class BlockSponge extends BaseSubtypesBlock { public BlockSponge() { super(Material.sponge, "sponge", "wet_sponge"); setHardness(0.6F); - setStepSound(soundTypeGrass); + setBlockSound(ModSounds.soundSponge); setBlockTextureName("sponge"); setBlockName(Utils.getUnlocalisedName("sponge")); setCreativeTab(EtFuturum.creativeTabBlocks); @@ -53,7 +56,9 @@ protected void tryAbsorb(World worldIn, int x, int y, int z, boolean wet) { if (!ArrayUtils.contains(BiomeDictionary.getTypesForBiome(worldIn.getBiomeGenForCoords(x, z)), BiomeDictionary.Type.NETHER)) { if (!wet && absorb(worldIn, x, y, z)) { worldIn.setBlockMetadataWithNotify(x, y, z, 1, 2); - worldIn.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(Blocks.water)); + if (ConfigSounds.newBlockSounds) { + worldIn.playSoundEffect(x + .5D, y + .5D, z + .5D, Reference.MCAssetVer + ":block.sponge.absorb", 1, 1); + } } } else if (wet) { worldIn.playSoundEffect(x + .5D, y + .5D, z + .5D, "random.fizz", 1, 1); diff --git a/src/main/java/ganymedes01/etfuturum/client/sound/ModSounds.java b/src/main/java/ganymedes01/etfuturum/client/sound/ModSounds.java index 2a50ac6f4..fcef29377 100644 --- a/src/main/java/ganymedes01/etfuturum/client/sound/ModSounds.java +++ b/src/main/java/ganymedes01/etfuturum/client/sound/ModSounds.java @@ -95,6 +95,8 @@ public String getStepResourcePath() { public static final SoundType soundHoneyBlock = new CustomSound("honey_block").setDisabledSound(soundSlime); public static final SoundType soundCoralBlock = new CustomSound("coral_block").setDisabledSound(soundSlime); public static final SoundType soundChain = new CustomSound("chain").setDisabledSound(Block.soundTypeMetal); + public static final SoundType soundSponge = new CustomSound("sponge").setDisabledSound(Block.soundTypeGrass); + public static final SoundType soundWetSponge = new CustomSound("wet_sponge").setDisabledSound(Block.soundTypeGrass); // public static final SoundType soundNylium = new CustomSound("nylium"); // public static final SoundType soundHoneyBlock = new CustomSound("honey_block"); //public static final SoundType soundShroomlight = new CustomSound("shroomlight"); diff --git a/src/main/java/ganymedes01/etfuturum/lib/Reference.java b/src/main/java/ganymedes01/etfuturum/lib/Reference.java index 4fb1a55c7..82ba3be0a 100644 --- a/src/main/java/ganymedes01/etfuturum/lib/Reference.java +++ b/src/main/java/ganymedes01/etfuturum/lib/Reference.java @@ -17,7 +17,7 @@ public class Reference { public static final String CURSEFORGE_URL = "https://www.curseforge.com/minecraft/mc-mods/et-futurum-requiem"; public static final String GITHUB_URL = "https://github.com/Roadhog360/Et-Futurum-Requiem"; - public static final String MCAssetVer = "minecraft_1.20"; + public static final String MCAssetVer = "minecraft_1.20.2"; public static final String ITEM_BLOCK_TEXTURE_PATH = MOD_ID + ":"; public static final String ARMOUR_TEXTURE_PATH = ITEM_BLOCK_TEXTURE_PATH + "textures/models/armor/";