diff --git a/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketNamedSoundEffect.java b/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketNamedSoundEffect.java index 9ed5c7d92..3081f5458 100644 --- a/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketNamedSoundEffect.java +++ b/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketNamedSoundEffect.java @@ -43,10 +43,8 @@ public class PacketNamedSoundEffect implements ClientboundPacket { location = new Location(buffer.readInt() * 8, buffer.readInt() * 8, buffer.readInt() * 8); // ToDo: check if it is not * 4 } - if (buffer.getProtocolId() < 321 && buffer.getProtocolId() >= 326) { - if (buffer.getProtocolId() >= 95) { - category = SoundCategories.byId(buffer.readVarInt()); - } + if (buffer.getProtocolId() >= 95 && (buffer.getProtocolId() < 321 || buffer.getProtocolId() >= 326)) { + category = SoundCategories.byId(buffer.readVarInt()); } if (buffer.getProtocolId() >= 95) { location = new Location(buffer.readFixedPointNumberInteger() * 4, buffer.readFixedPointNumberInteger() * 4, buffer.readFixedPointNumberInteger() * 4); diff --git a/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketSoundEffect.java b/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketSoundEffect.java index 9b7ac72bf..6de6c3cff 100644 --- a/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketSoundEffect.java +++ b/src/main/java/de/bixilon/minosoft/protocol/packets/clientbound/play/PacketSoundEffect.java @@ -39,10 +39,8 @@ public class PacketSoundEffect implements ClientboundPacket { if (buffer.getProtocolId() >= 321 && buffer.getProtocolId() < 326) { buffer.readString(); // parrot entity type } - if (buffer.getProtocolId() < 321 && buffer.getProtocolId() >= 326) { - if (buffer.getProtocolId() >= 95) { - category = SoundCategories.byId(buffer.readVarInt()); - } + if (buffer.getProtocolId() >= 95 && (buffer.getProtocolId() < 321 || buffer.getProtocolId() >= 326)) { + category = SoundCategories.byId(buffer.readVarInt()); } location = new Location(buffer.readFixedPointNumberInteger() * 4, buffer.readFixedPointNumberInteger() * 4, buffer.readFixedPointNumberInteger() * 4); volume = buffer.readFloat();