From 6a6be44ab293d74fbc97f69a7a6649d9488f10fd Mon Sep 17 00:00:00 2001 From: AoElite <20812471+AoElite@users.noreply.github.com> Date: Sun, 11 Aug 2024 15:57:12 -0400 Subject: [PATCH 1/2] fix sound exception on 1.21 --- .../packetevents/protocol/item/jukebox/IJukeboxSong.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/src/main/java/com/github/retrooper/packetevents/protocol/item/jukebox/IJukeboxSong.java b/api/src/main/java/com/github/retrooper/packetevents/protocol/item/jukebox/IJukeboxSong.java index 2f8e4c7d1..eaa72e231 100644 --- a/api/src/main/java/com/github/retrooper/packetevents/protocol/item/jukebox/IJukeboxSong.java +++ b/api/src/main/java/com/github/retrooper/packetevents/protocol/item/jukebox/IJukeboxSong.java @@ -43,12 +43,10 @@ public interface IJukeboxSong extends MappedEntity, CopyableEntity static IJukeboxSong decode(NBT nbt, ClientVersion version, @Nullable TypesBuilderData data) { NBTCompound compound = (NBTCompound) nbt; - - Sound sound = Sound.decode(compound.getCompoundTagOrThrow("sound_event"), version); + Sound sound = Sound.decode(compound.getStringTagOrThrow("sound_event"), version); Component description = AdventureSerializer.fromNbt(compound.getTagOrThrow("description")); float length = compound.getNumberTagOrThrow("length_in_seconds").getAsFloat(); int comparator_output = compound.getNumberTagOrThrow("comparator_output").getAsInt(); - return new JukeboxSong(data, sound, description, length, comparator_output); } From 7778768c3011a0b714c3caf1de4bf394a4365504 Mon Sep 17 00:00:00 2001 From: AoElite <20812471+AoElite@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:55:09 -0400 Subject: [PATCH 2/2] tweak --- .../packetevents/protocol/item/jukebox/IJukeboxSong.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/github/retrooper/packetevents/protocol/item/jukebox/IJukeboxSong.java b/api/src/main/java/com/github/retrooper/packetevents/protocol/item/jukebox/IJukeboxSong.java index eaa72e231..da6b0cb06 100644 --- a/api/src/main/java/com/github/retrooper/packetevents/protocol/item/jukebox/IJukeboxSong.java +++ b/api/src/main/java/com/github/retrooper/packetevents/protocol/item/jukebox/IJukeboxSong.java @@ -43,7 +43,7 @@ public interface IJukeboxSong extends MappedEntity, CopyableEntity static IJukeboxSong decode(NBT nbt, ClientVersion version, @Nullable TypesBuilderData data) { NBTCompound compound = (NBTCompound) nbt; - Sound sound = Sound.decode(compound.getStringTagOrThrow("sound_event"), version); + Sound sound = Sound.decode(compound.getTagOrThrow("sound_event"), version); Component description = AdventureSerializer.fromNbt(compound.getTagOrThrow("description")); float length = compound.getNumberTagOrThrow("length_in_seconds").getAsFloat(); int comparator_output = compound.getNumberTagOrThrow("comparator_output").getAsInt();