mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-21 23:01:28 +01:00
Don't hardcode inv length
This commit is contained in:
parent
f6cbda0e04
commit
cf1f2f8f03
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user