diff --git a/common/src/main/java/com/leobeliik/extremesoundmuffler/mixins/SoundMixin.java b/common/src/main/java/com/leobeliik/extremesoundmuffler/mixins/SoundMixin.java index 024c824..55cbd22 100644 --- a/common/src/main/java/com/leobeliik/extremesoundmuffler/mixins/SoundMixin.java +++ b/common/src/main/java/com/leobeliik/extremesoundmuffler/mixins/SoundMixin.java @@ -46,7 +46,7 @@ private float esm_setVolume(float volume) { //don't care about forbidden sounds or from the psb if (tempSound != null && !esm_isForbidden(tempSound) && !PlaySoundButton.isFromPSB()) { ResourceLocation soundLocation = tempSound.getLocation(); - float tempVolume = soundLocation.toString().contains("entity.lightning_bolt.thunder") ? 1F : tempSound.getVolume(); + float tempVolume = soundLocation.getPath().contains("entity.lightning_bolt.thunder") ? 1F : tempSound.getVolume(); //remove sound to prevent repeated sounds and maintains the desired order recentSoundsList.remove(soundLocation); diff --git a/common/src/main/java/com/leobeliik/extremesoundmuffler/utils/Anchor.java b/common/src/main/java/com/leobeliik/extremesoundmuffler/utils/Anchor.java index 6581894..56cf61a 100644 --- a/common/src/main/java/com/leobeliik/extremesoundmuffler/utils/Anchor.java +++ b/common/src/main/java/com/leobeliik/extremesoundmuffler/utils/Anchor.java @@ -127,8 +127,15 @@ public void editAnchor(String title, int Radius) { public static Anchor getAnchor(SoundInstance sound) { BlockPos soundPos = new BlockPos((int) sound.getX(), (int) sound.getY(), (int) sound.getZ()); + Minecraft minecraft = Minecraft.getInstance(); + LocalPlayer player = minecraft.player; + ClientLevel world = minecraft.level; + + if (player != null && sound.getLocation().getPath().contains("entity.minecart.inside")) { + //give player coordinates if it's in the minecart, minecart.inside sound pos is always at 0 + soundPos = player.getOnPos(); + } for (Anchor anchor : ISoundLists.anchorList) { - ClientLevel world = Minecraft.getInstance().level; if (anchor.getAnchorPos() != null && world != null && world.dimension().location().equals(anchor.getDimension())