custom serialization of oversized itemstacks.
simple limiting by checking overflow
This commit is contained in:
@@ -93,6 +93,10 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
NBTTagCompound ingredient = inTag.getCompoundTagAt(x);
|
||||
final ItemStack gs = new ItemStack(ingredient);
|
||||
|
||||
if (ingredient.hasKey("stackSize")) {
|
||||
gs.setCount(ingredient.getInteger("stackSize"));
|
||||
}
|
||||
|
||||
if (!ingredient.hasNoTags() && gs.isEmpty()) {
|
||||
throw new IllegalArgumentException("No pattern here!");
|
||||
}
|
||||
@@ -124,6 +128,10 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
|
||||
NBTTagCompound resultItemTag = outTag.getCompoundTagAt(x);
|
||||
final ItemStack gs = new ItemStack(resultItemTag);
|
||||
|
||||
if (resultItemTag.hasKey("stackSize")) {
|
||||
gs.setCount(resultItemTag.getInteger("stackSize"));
|
||||
}
|
||||
|
||||
if (!resultItemTag.hasNoTags() && gs.isEmpty()) {
|
||||
throw new IllegalArgumentException("No pattern here!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user