From 83e3575f93c0a669654f11b5d65e8635151595ca Mon Sep 17 00:00:00 2001 From: RockinChaos Date: Sat, 16 Nov 2024 22:09:30 -0800 Subject: [PATCH] fix: anvil paper packet --- .../me/RockinChaos/core/utils/protocol/ProtocolManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/RockinChaos/core/utils/protocol/ProtocolManager.java b/src/main/java/me/RockinChaos/core/utils/protocol/ProtocolManager.java index 85c3b2d..171ed72 100644 --- a/src/main/java/me/RockinChaos/core/utils/protocol/ProtocolManager.java +++ b/src/main/java/me/RockinChaos/core/utils/protocol/ProtocolManager.java @@ -129,7 +129,7 @@ public static boolean manageEvents(final @Nonnull Player player, final @Nonnull final InventoryCloseEvent CloseInventory = new InventoryCloseEvent(CompatUtils.getOpenInventory(player)); callEvent(CloseInventory); return CloseInventory.isCancelled(); - } else if (packetName.equalsIgnoreCase("PacketPlayInCustomPayload")) { + } else if (packetName.equalsIgnoreCase("PacketPlayInCustomPayload") || packetName.contains("RenameItemPacket")) { if (packetContainer.read(0).getData().toString().equalsIgnoreCase("MC|ItemName") && CompatUtils.getInventoryType(player).name().equalsIgnoreCase("ANVIL")) { final Object UnbufferedPayload = packetContainer.read(1).getData(); final String renameText = (String) UnbufferedPayload.getClass().getMethod(ServerUtils.hasSpecificUpdate("1_9") ? "e" : "c", int.class).invoke(UnbufferedPayload, 31);