Skip to content

Commit

Permalink
Fix client desync with item in hand (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
Caedis authored Feb 24, 2025
1 parent 7ca02ea commit f413e28
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public void onItemToss(ItemTossEvent event) {
if (TweaksConfig.avoidDroppingItemsWhenClosing && event.player instanceof EntityPlayerMP
&& playersClosedContainers.contains(event.player)) {
if (event.player.inventory.addItemStackToInventory(event.entityItem.getEntityItem())) {
event.player.inventory.setItemStack(null); // empty the item in hand
((EntityPlayerMP) event.player).sendContainerToPlayer(event.player.inventoryContainer);
event.setCanceled(true);
}
Expand Down

0 comments on commit f413e28

Please sign in to comment.