diff --git a/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java b/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java index a2797e6dd..256de7799 100644 --- a/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java +++ b/core/src/main/java/org/geysermc/geyser/inventory/GeyserItemStack.java @@ -184,7 +184,7 @@ public class GeyserItemStack { public SlotDisplay asSlotDisplay() { if (isEmpty()) { - return new EmptySlotDisplay(); + return EmptySlotDisplay.INSTANCE; } return new ItemStackSlotDisplay(this.getItemStack()); } diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/TagRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/TagRegistryPopulator.java index 455145217..4e249d483 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/TagRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/TagRegistryPopulator.java @@ -56,6 +56,19 @@ public final class TagRegistryPopulator { private static final Gson GSON = new GsonBuilder().create(); // temporary public static void populate() { + Hash.Strategy hashStrategy = new Hash.Strategy<>() { + // Necessary so arrays can actually be compared + @Override + public int hashCode(int[] o) { + return Arrays.hashCode(o); + } + + @Override + public boolean equals(int[] a, int[] b) { + return Arrays.equals(a, b); + } + }; + List> paletteVersions = List.of( ObjectIntPair.of("1_20_80", Bedrock_v671.CODEC.getProtocolVersion()), ObjectIntPair.of("1_21_0", Bedrock_v685.CODEC.getProtocolVersion()), @@ -77,18 +90,7 @@ public final class TagRegistryPopulator { throw new AssertionError("Unable to load Bedrock runtime item IDs", e); } - Object2ObjectMap javaItemsToBedrockTag = new Object2ObjectOpenCustomHashMap<>(new Hash.Strategy<>() { - // Necessary so arrays can actually be compared - @Override - public int hashCode(int[] o) { - return Arrays.hashCode(o); - } - - @Override - public boolean equals(int[] a, int[] b) { - return Arrays.equals(a, b); - } - }); + Object2ObjectMap javaItemsToBedrockTag = new Object2ObjectOpenCustomHashMap<>(hashStrategy); for (var entry : bedrockTags.entrySet()) { List value = entry.getValue(); diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 36ed3f02e..2036f2941 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -214,6 +214,7 @@ import org.geysermc.mcprotocollib.protocol.packet.common.serverbound.Serverbound import org.geysermc.mcprotocollib.protocol.packet.handshake.serverbound.ClientIntentionPacket; import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundChatCommandSignedPacket; import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundChatPacket; +import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.ServerboundClientTickEndPacket; import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.player.ServerboundPlayerAbilitiesPacket; import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.player.ServerboundPlayerActionPacket; import org.geysermc.mcprotocollib.protocol.packet.ingame.serverbound.player.ServerboundUseItemPacket; diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 60fe78448..b8908f518 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,7 @@ protocol-common = "3.0.0.Beta5-20241022.154658-14" protocol-codec = "3.0.0.Beta5-20241022.154658-14" raknet = "1.0.0.CR3-20240416.144209-1" minecraftauth = "4.1.1" -mcprotocollib = "1.21.2-SNAPSHOT" +mcprotocollib = "1.21.2-20241103.011758-1" adventure = "4.14.0" adventure-platform = "4.3.0" junit = "5.9.2" @@ -121,8 +121,7 @@ guava = { group = "com.google.guava", name = "guava", version.ref = "guava" } gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" } junit = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" } minecraftauth = { group = "net.raphimc", name = "MinecraftAuth", version.ref = "minecraftauth" } -#mcprotocollib = { group = "org.geysermc.mcprotocollib", name = "protocol", version.ref = "mcprotocollib" } -mcprotocollib = { group = "com.github.geysermc", name = "mcprotocollib", version = "feature~1.21.2-SNAPSHOT"} +mcprotocollib = { group = "org.geysermc.mcprotocollib", name = "protocol", version.ref = "mcprotocollib" } raknet = { group = "org.cloudburstmc.netty", name = "netty-transport-raknet", version.ref = "raknet" } terminalconsoleappender = { group = "net.minecrell", name = "terminalconsoleappender", version.ref = "terminalconsoleappender" } velocity-api = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }