mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-02-22 23:31:34 +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 {
|
try {
|
||||||
fakeInventory.setContents(contents);
|
fakeInventory.setContents(contents);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
ItemStack[] truncatedContents = new ItemStack[36];
|
ItemStack[] truncatedContents = new ItemStack[fakeInventory.getSize()];
|
||||||
System.arraycopy(contents, 0, truncatedContents, 0, truncatedContents.length);
|
System.arraycopy(contents, 0, truncatedContents, 0, truncatedContents.length);
|
||||||
fakeInventory.setContents(truncatedContents);
|
fakeInventory.setContents(truncatedContents);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user