From 9edac80544364e5b1a2c5bc90f9d88990e32fdff Mon Sep 17 00:00:00 2001 From: Jikoo Date: Sun, 12 Jun 2016 10:48:03 -0400 Subject: [PATCH] Properly set item arrays for subcontainer Closes #8 --- .../lishid/openinv/internal/v1_10_R1/SpecialEnderChest.java | 5 ++--- src/main/resources/plugin.yml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/lishid/openinv/internal/v1_10_R1/SpecialEnderChest.java b/src/main/java/com/lishid/openinv/internal/v1_10_R1/SpecialEnderChest.java index 62ceee70..eca499b8 100644 --- a/src/main/java/com/lishid/openinv/internal/v1_10_R1/SpecialEnderChest.java +++ b/src/main/java/com/lishid/openinv/internal/v1_10_R1/SpecialEnderChest.java @@ -62,13 +62,12 @@ public SpecialEnderChest(OpenInv plugin, Player p, Boolean online) { 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) { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 1a3581be..ae0b2f76 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: OpenInv main: com.lishid.openinv.OpenInv -version: 2.4.7 +version: 2.4.8 author: lishid authors: [Jikoo] description: >