aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorquerns <33518699+querns@users.noreply.github.com>2024-09-28 12:41:26 -0500
committerGitHub <noreply@github.com>2024-09-28 19:41:26 +0200
commit496881a113a32c2078ce75fee378a39bfdbae962 (patch)
treecf2d6845552aa03e877b049f44268685f7b447c9 /src
parent1f98fb330e57358f5197bcd433e89eb61f3cbf3c (diff)
downloadGT5-Unofficial-496881a113a32c2078ce75fee378a39bfdbae962.tar.gz
GT5-Unofficial-496881a113a32c2078ce75fee378a39bfdbae962.tar.bz2
GT5-Unofficial-496881a113a32c2078ce75fee378a39bfdbae962.zip
Fix Infinite Spraycan client desync issue (#3298)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/api/net/GTPacketInfiniteSpraycan.java13
1 files 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 c12dc7d02a..b0127ba81f 100644
--- a/src/main/java/gregtech/api/net/GTPacketInfiniteSpraycan.java
+++ b/src/main/java/gregtech/api/net/GTPacketInfiniteSpraycan.java
@@ -71,15 +71,10 @@ public class GTPacketInfiniteSpraycan extends GTPacket {
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));
}
}