From 496881a113a32c2078ce75fee378a39bfdbae962 Mon Sep 17 00:00:00 2001 From: querns <33518699+querns@users.noreply.github.com> Date: Sat, 28 Sep 2024 12:41:26 -0500 Subject: [PATCH] Fix Infinite Spraycan client desync issue (#3298) --- .../gregtech/api/net/GTPacketInfiniteSpraycan.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/java/gregtech/api/net/GTPacketInfiniteSpraycan.java b/src/main/java/gregtech/api/net/GTPacketInfiniteSpraycan.java index c12dc7d02a1..b0127ba81f9 100644 --- a/src/main/java/gregtech/api/net/GTPacketInfiniteSpraycan.java +++ b/src/main/java/gregtech/api/net/GTPacketInfiniteSpraycan.java @@ -71,15 +71,10 @@ public void setINetHandler(final INetHandler aHandler) { public void process(final IBlockAccess aWorld) { ItemStack currentItemStack = player.inventory.getCurrentItem(); if (currentItemStack != null && currentItemStack.getItem() instanceof MetaBaseItem item) { - item.forEachBehavior(currentItemStack, behavior -> { - if (behavior instanceof BehaviourSprayColorInfinite spraycanBehavior - && action.execute(spraycanBehavior, currentItemStack, player, newColor)) { - player.sendSlotContents(player.inventoryContainer, player.inventory.currentItem, currentItemStack); - return true; - } - - return false; - }); + item.forEachBehavior( + currentItemStack, + behavior -> behavior instanceof BehaviourSprayColorInfinite spraycanBehavior + && action.execute(spraycanBehavior, currentItemStack, player, newColor)); } }