diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/WorldPackets.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/WorldPackets.java index 39ac43821..1b517f8ee 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/WorldPackets.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/packets/WorldPackets.java @@ -46,6 +46,7 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.sounds.SoundEffect; import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.ClientChunks; import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.EntityTracker1_9; import com.viaversion.viaversion.util.ComponentUtil; +import com.viaversion.viaversion.util.Key; import java.util.ArrayList; import java.util.Optional; @@ -98,7 +99,7 @@ public class WorldPackets { // Everything else gets written through handler(wrapper -> { - String name = wrapper.get(Type.STRING, 0); + String name = Key.stripMinecraftNamespace(wrapper.get(Type.STRING, 0)); SoundEffect effect = SoundEffect.getByName(name); int catid = 0; @@ -109,7 +110,7 @@ public class WorldPackets { } wrapper.set(Type.STRING, 0, newname); wrapper.write(Type.VAR_INT, catid); // Write Category ID - if (effect != null && effect.isBreaksound()) { + if (effect != null && effect.isBreakSound()) { EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class); int x = wrapper.passthrough(Type.INT); //Position X int y = wrapper.passthrough(Type.INT); //Position Y diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/sounds/SoundEffect.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/sounds/SoundEffect.java index b7d4dcc58..4dae1a18a 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/sounds/SoundEffect.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_9to1_8/sounds/SoundEffect.java @@ -273,7 +273,7 @@ public enum SoundEffect { private final String name; private final String newName; private final SoundCategory category; - private final boolean breaksound; + private final boolean breakSound; private static final Map effects; @@ -284,22 +284,21 @@ public enum SoundEffect { } } - SoundEffect(String name, String newname, SoundCategory cat) { - this.category = cat; - this.newName = newname; + SoundEffect(String name, String newName, SoundCategory category) { + this.category = category; + this.newName = newName; this.name = name; - this.breaksound = name.startsWith("dig."); + this.breakSound = name.startsWith("dig."); } - SoundEffect(String name, String newname, SoundCategory cat, boolean shouldIgnore) { - this.category = cat; - this.newName = newname; + SoundEffect(String name, String newName, SoundCategory category, boolean shouldIgnore) { + this.category = category; + this.newName = newName; this.name = name; - this.breaksound = name.startsWith("dig.") || shouldIgnore; + this.breakSound = name.startsWith("dig.") || shouldIgnore; } public static SoundEffect getByName(String name) { - name = name.toLowerCase(Locale.ROOT); return effects.get(name); } @@ -315,7 +314,7 @@ public enum SoundEffect { return category; } - public boolean isBreaksound() { - return breaksound; + public boolean isBreakSound() { + return breakSound; } }