Compare commits

...
1 Commits
Author SHA1 Message Date
Jikoo 9edac80544 Properly set item arrays for subcontainer
Closes #8
2016-06-12 10:48:03 -04:00
2 changed files with 3 additions and 4 deletions

No files matched your search

@@ -62,13 +62,12 @@ public class SpecialEnderChest extends InventorySubcontainer implements IInvento
private void setItemArrays(InventorySubcontainer subcontainer, ItemStack[] items) {
try {
// Prepare to remove final modifier
Field modifiers;
modifiers = Field.class.getDeclaredField("modifiers");
Field modifiers = Field.class.getDeclaredField("modifiers");
modifiers.setAccessible(true);
// Access and replace main inventory array
Field field = InventorySubcontainer.class.getField("items");
modifiers.setInt(field, field.getModifiers() & ~Modifier.FINAL);
field.set(inventory, items);
field.set(subcontainer, items);
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (SecurityException e) {
+1 -1
View File
@@ -1,6 +1,6 @@
name: OpenInv
main: com.lishid.openinv.OpenInv
version: 2.4.7
version: 2.4.8
author: lishid
authors: [Jikoo]
description: >