Skip to content

Commit

Permalink
Remove unneeded inventory sync call
Browse files Browse the repository at this point in the history
  • Loading branch information
querns committed Sep 28, 2024
1 parent 1f98fb3 commit 49fce9d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/main/java/gregtech/api/net/GTPacketInfiniteSpraycan.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down

0 comments on commit 49fce9d

Please sign in to comment.