File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
src/main/java/gregtech/common/metatileentities/multi/multiblockpart/appeng/stack Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,19 @@ public boolean equals(ItemStack itemStack) {
261261 @ Override
262262 public boolean equals (Object other ) {
263263 if (other instanceof IAEItemStack stack ) {
264- return this .delegate .isItemEqual (stack .createItemStack ());
264+ ItemStack otherStack = stack .getCachedItemStack (stack .getStackSize ());
265+ NBTTagCompound thisTag = delegate .getTagCompound ();
266+ NBTTagCompound otherTag = otherStack .getTagCompound ();
267+
268+ boolean nbtMatch ;
269+ if (thisTag == null ) {
270+ nbtMatch = otherTag == null ;
271+ } else {
272+ // noinspection PointlessNullCheck
273+ nbtMatch = otherTag != null && thisTag .equals (otherTag );
274+ }
275+
276+ return this .delegate .isItemEqual (otherStack ) && nbtMatch ;
265277 } else if (other instanceof ItemStack itemStack ) {
266278 return this .equals (itemStack );
267279 }
You can’t perform that action at this time.
0 commit comments