mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-17 19:15:13 +00:00
Don't copy stack unless it changed (#1116)
Co-authored-by: slprime <[email protected]>
This commit is contained in:
1 parent
0185cd64b1
commit
1a27b02412
2 files changed
+32
-2
No files matched your search
@@ -127,7 +127,12 @@ public class ItemZoom extends Widget implements IContainerInputHandler {
|
||||
this.displayName = "Unnamed";
|
||||
}
|
||||
|
||||
this.stack = StackInfo.loadFromNBT(StackInfo.itemStackToNBT(stack), 0);
|
||||
// Copying the stack copies its whole NBT, so it is only done when the hovered stack changes
|
||||
final boolean sameStack = this.stack != null && this.stack.isItemEqual(stack)
|
||||
&& ItemStack.areItemStackTagsEqual(this.stack, stack);
|
||||
if (!sameStack) {
|
||||
this.stack = StackInfo.loadFromNBT(StackInfo.itemStackToNBT(stack), 0);
|
||||
}
|
||||
} else {
|
||||
this.stack = null;
|
||||
this.displayName = "";
|
||||
|
||||
Reference in new issue
Block a user