Don't hardcode inv length

This commit is contained in:
vemacs 2016-03-01 10:21:04 -07:00
parent f6cbda0e04
commit cf1f2f8f03

View file

@ -39,7 +39,7 @@ public final class InventoryWorkaround {
try {
fakeInventory.setContents(contents);
} catch (IllegalArgumentException e) {
ItemStack[] truncatedContents = new ItemStack[36];
ItemStack[] truncatedContents = new ItemStack[fakeInventory.getSize()];
System.arraycopy(contents, 0, truncatedContents, 0, truncatedContents.length);
fakeInventory.setContents(truncatedContents);
}