Skip to content

Commit

Permalink
fix(spigot): container carried item not being translated
Browse files Browse the repository at this point in the history
Fixes #387
  • Loading branch information
diogotcorreia committed Jun 10, 2024
1 parent ad100e0 commit 44d49b8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,12 @@ private void handleWindowItems(PacketEvent packet, SpigotLanguagePlayer language
ItemStackTranslationUtils.translateItemStack(item, languagePlayer, true);
}
packet.getPacket().getItemListModifier().writeSafely(0, items);

if (MinecraftVersion.CAVES_CLIFFS_1.atOrAbove()) { // 1.17+
ItemStack carriedItem = packet.getPacket().getItemModifier().readSafely(0);
carriedItem = ItemStackTranslationUtils.translateItemStack(carriedItem, languagePlayer, false);
packet.getPacket().getItemModifier().writeSafely(0, carriedItem);
}
} else {
ItemStack[] items = packet.getPacket().getItemArrayModifier().readSafely(0);
for (ItemStack item : items) {
Expand Down

0 comments on commit 44d49b8

Please sign in to comment.