[1.10.x] Fix ItemHandlerHelper canStack methods not checking capabilities (#3105)

This commit is contained in:
Justin authored and LexManos committed 2017-01-11 16:26:37 -08:00
1 parent b109baf7d6
commit b0ae0be80e
3 files changed
+89 -40

No files matched your search

@@ -126,8 +126,8 @@ public class AttachCapabilitiesEvent<T> extends GenericEvent<T>
*/
public static class Item extends AttachCapabilitiesEvent<net.minecraft.item.Item>
{
@Deprecated
private final net.minecraft.item.ItemStack stack;
@Deprecated
private final net.minecraft.item.Item item;
public Item(net.minecraft.item.Item item, net.minecraft.item.ItemStack stack)
{
@@ -52,9 +52,7 @@ public class ItemHandlerHelper
if (a == null || !a.isItemEqual(b))
return false;
final NBTTagCompound aTag = a.getTagCompound();
final NBTTagCompound bTag = b.getTagCompound();
return (aTag != null || bTag == null) && (aTag == null || aTag.equals(bTag));
return ItemStack.areItemStackTagsEqual(a, b);
}
/**
@@ -75,9 +73,7 @@ public class ItemHandlerHelper
if (a.getHasSubtypes() && a.getMetadata() != b.getMetadata())
return false;
final NBTTagCompound aTag = a.getTagCompound();
final NBTTagCompound bTag = b.getTagCompound();
return (aTag != null || bTag == null) && (aTag == null || aTag.equals(bTag));
return ItemStack.areItemStackTagsEqual(a, b);
}
public static ItemStack copyStackWithSize(ItemStack itemStack, int size)