diff --git a/src/main/java/xyz/pixelatedw/finalbeta/mixin/LivingEntityMixin.java b/src/main/java/xyz/pixelatedw/finalbeta/mixin/LivingEntityMixin.java index 1568b24..7aed012 100644 --- a/src/main/java/xyz/pixelatedw/finalbeta/mixin/LivingEntityMixin.java +++ b/src/main/java/xyz/pixelatedw/finalbeta/mixin/LivingEntityMixin.java @@ -57,7 +57,7 @@ public class LivingEntityMixin { LivingEntity entity = (LivingEntity) (Object) this; if (ModConfig.ADD_MORE_SOUNDS.get() && entity.isOnLadder() && entity.velocityY != 0 && entity.field_1645 % 20 == 0 && !entity.onGround) { float pitch = WyHelper.clamp(0.85f + entity.level.rand.nextFloat() / 2, 0.0f, 1.0f); - entity.level.playSound(entity.x, entity.y, entity.z, "step.ladder", 0.3f, pitch); + entity.level.playSound(entity.x, entity.y, entity.z, "sound3.step.ladder", 0.3f, pitch); } } } diff --git a/src/main/java/xyz/pixelatedw/finalbeta/mixin/MinecartMixin.java b/src/main/java/xyz/pixelatedw/finalbeta/mixin/MinecartMixin.java index 62cad9a..59dac37 100644 --- a/src/main/java/xyz/pixelatedw/finalbeta/mixin/MinecartMixin.java +++ b/src/main/java/xyz/pixelatedw/finalbeta/mixin/MinecartMixin.java @@ -58,7 +58,7 @@ public class MinecartMixin { if (speed >= 0.01D && ModConfig.ADD_MORE_SOUNDS.get()) { if (minecart.field_1645 % 39 == 1) { - minecart.level.playSound(x, y, z, "minecart.base", volume, pitch); + minecart.level.playSound(x, y, z, "sound3.minecart.base", volume, pitch); } } } diff --git a/src/main/java/xyz/pixelatedw/finalbeta/mixin/MinecraftMixin.java b/src/main/java/xyz/pixelatedw/finalbeta/mixin/MinecraftMixin.java index 89031f1..eed17c9 100644 --- a/src/main/java/xyz/pixelatedw/finalbeta/mixin/MinecraftMixin.java +++ b/src/main/java/xyz/pixelatedw/finalbeta/mixin/MinecraftMixin.java @@ -17,9 +17,6 @@ import xyz.pixelatedw.finalbeta.ModConfig; @Mixin(Minecraft.class) public class MinecraftMixin { - - private static final String[] ALLOWED_NEW_SOUNDS = {"minecart/", "step/ladder"}; - @Redirect(method = "init()V", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;create()V"), remap = false) public void createDisplay() throws LWJGLException { // Why the fuck is this even a thing ? What was its intended purpose ? I NEED TO KNOW @@ -29,26 +26,15 @@ public class MinecraftMixin { @Inject(method = "loadSoundFromDir", at = @At("HEAD")) public void loadSoundFromDir(String string, File file, CallbackInfo ci) { - if(!ModConfig.ADD_MORE_SOUNDS.get()) { + if(ModConfig.ADD_MORE_SOUNDS.get()) { Minecraft mc = (Minecraft) (Object) this; int split = string.indexOf("/"); String type = string.substring(0, split); String newSound = string.substring(split + 1); // For now only allow the minecart sounds, allowing all of them causes weird effects with same name sounds when the game decides which one to use - // XXX Could always incorporate the sound3 part into the sound's name and have it accessible as sound3.random.bow for example, which would avoid the overlap with current sounds if (type.equalsIgnoreCase("sound3")) { - boolean registerSound = false; - for (String test : ALLOWED_NEW_SOUNDS) { - if (newSound.startsWith(test)) { - registerSound = true; - break; - } - } - - if (registerSound) { - MainMod.LOGGER.info("Registered a new sound " + newSound + " from " + file); - mc.soundHelper.method_2011(newSound, file); - } + MainMod.LOGGER.info("Registered a new sound sound3/" + newSound + " from " + file); + mc.soundHelper.method_2011("sound3/" + newSound, file); } } }