Skip to content

Commit

Permalink
Add sponge sounds, update reference to 1.20.2
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Roadhog360 committed Sep 26, 2023
1 parent bc0de2c commit 82f905f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/main/java/ganymedes01/etfuturum/EtFuturum.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}

/**
Expand Down Expand Up @@ -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.
Expand All @@ -939,5 +947,4 @@ private static void getSounds(ADConfig config) {
}
}
}

}
9 changes: 7 additions & 2 deletions src/main/java/ganymedes01/etfuturum/blocks/BlockSponge.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ganymedes01/etfuturum/lib/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -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/";
Expand Down

0 comments on commit 82f905f

Please sign in to comment.