Skip to content

Commit

Permalink
fix: anvil paper packet
Browse files Browse the repository at this point in the history
  • Loading branch information
RockinChaos committed Nov 17, 2024
1 parent d82775f commit 83e3575
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 83e3575

Please sign in to comment.