Skip to content

Commit

Permalink
Prevent ForgeCaps from being set with zero size (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
droidicus authored and mezz committed Sep 8, 2016
1 parent ecba234 commit 9bd0ee5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/mezz/jei/util/StackHelper.java
Expand Up @@ -389,7 +389,10 @@ public String getUniqueIdentifierForStack(@Nonnull ItemStack stack, @Nonnull Uid
if (nbtTagCompound == null) {
nbtTagCompound = new NBTTagCompound();
}
nbtTagCompound.setTag("ForgeCaps", serializedNbt.getCompoundTag("ForgeCaps"));
NBTTagCompound forgeCaps = serializedNbt.getCompoundTag("ForgeCaps");
if (!forgeCaps.hasNoTags()) { // ForgeCaps should never be empty
nbtTagCompound.setTag("ForgeCaps", forgeCaps);
}
}
if (nbtTagCompound != null && !nbtTagCompound.hasNoTags()) {
itemKey.append(':').append(nbtTagCompound);
Expand Down

0 comments on commit 9bd0ee5

Please sign in to comment.