From fa1ae5b9c9196796fb8a67e263dd36bdb8dd0c52 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 18 Jan 2024 12:00:19 +0100 Subject: [PATCH] Entity sound did not change --- .../protocol1_19_4to1_19_3/Protocol1_19_4To1_19_3.java | 2 +- .../protocol1_20_2to1_20/Protocol1_20_2To1_20.java | 2 +- .../protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java | 6 +----- .../com/viaversion/viaversion/rewriter/SoundRewriter.java | 5 ----- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_4to1_19_3/Protocol1_19_4To1_19_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_4to1_19_3/Protocol1_19_4To1_19_3.java index d616b829d..dd79cc6cd 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_4to1_19_3/Protocol1_19_4To1_19_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_4to1_19_3/Protocol1_19_4To1_19_3.java @@ -58,7 +58,7 @@ public final class Protocol1_19_4To1_19_3 extends AbstractProtocol(this).register(ClientboundPackets1_19_3.STATISTICS); final SoundRewriter soundRewriter = new SoundRewriter<>(this); - soundRewriter.registerSound(ClientboundPackets1_19_3.ENTITY_SOUND); + soundRewriter.register1_19_3Sound(ClientboundPackets1_19_3.ENTITY_SOUND); soundRewriter.register1_19_3Sound(ClientboundPackets1_19_3.SOUND); new CommandRewriter(this) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java index 9b58976ef..59d12a552 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_2to1_20/Protocol1_20_2To1_20.java @@ -73,7 +73,7 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.SOUND); - soundRewriter.registerEntitySound(ClientboundPackets1_19_4.ENTITY_SOUND); + soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.ENTITY_SOUND); registerClientbound(ClientboundPackets1_19_4.PLUGIN_MESSAGE, this::sanitizeCustomPayload); registerServerbound(ServerboundPackets1_20_2.PLUGIN_MESSAGE, this::sanitizeCustomPayload); diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java index df2890488..28b868497 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/Protocol1_20_5To1_20_3.java @@ -63,11 +63,7 @@ public final class Protocol1_20_5To1_20_3 extends AbstractProtocol soundRewriter = new SoundRewriter<>(this); soundRewriter.register1_19_3Sound(ClientboundPackets1_20_3.SOUND); - registerClientbound(ClientboundPackets1_20_3.ENTITY_SOUND, wrapper -> { - // Now also written as a sound event with 0 marking a following resource location string - final int soundId = wrapper.read(Type.VAR_INT); - wrapper.write(Type.VAR_INT, MAPPINGS.getSoundMappings().getNewId(soundId) + 1); - }); + soundRewriter.register1_19_3Sound(ClientboundPackets1_20_3.ENTITY_SOUND); new StatisticsRewriter<>(this).register(ClientboundPackets1_20_3.STATISTICS); diff --git a/common/src/main/java/com/viaversion/viaversion/rewriter/SoundRewriter.java b/common/src/main/java/com/viaversion/viaversion/rewriter/SoundRewriter.java index 17efdbcc3..987fb762f 100644 --- a/common/src/main/java/com/viaversion/viaversion/rewriter/SoundRewriter.java +++ b/common/src/main/java/com/viaversion/viaversion/rewriter/SoundRewriter.java @@ -47,11 +47,6 @@ public class SoundRewriter { }); } - public void registerEntitySound(C packetType) { - this.registerSound(packetType); - } - - // Also for entity sounds starting with 1.20.5 public void register1_19_3Sound(C packetType) { protocol.registerClientbound(packetType, soundHolderHandler()); }