diff --git a/src/com/lishid/openinv/internal/v1_9_R1/SpecialPlayerInventory.java b/src/com/lishid/openinv/internal/v1_9_R1/SpecialPlayerInventory.java index 276b080..3316c58 100644 --- a/src/com/lishid/openinv/internal/v1_9_R1/SpecialPlayerInventory.java +++ b/src/com/lishid/openinv/internal/v1_9_R1/SpecialPlayerInventory.java @@ -130,12 +130,19 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP if (i >= is.length) { i -= is.length; - is = this.extra; + is = this.extraSlots; } else if (is == this.armor) { i = getReversedArmorSlotNum(i); } + if (i >= is.length) { + i -= is.length; + is = this.extra; + } + + // extraSlots is, for now, just an array with length 1. No need for special handling. + return is[i]; } @@ -153,12 +160,17 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP if (i >= is.length) { i -= is.length; - is = this.extra; + is = this.extraSlots; } else if (is == this.armor) { i = getReversedArmorSlotNum(i); } + if (i >= is.length) { + i -= is.length; + is = this.extra; + } + if (is[i] != null) { ItemStack itemstack; @@ -195,12 +207,17 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP if (i >= is.length) { i -= is.length; - is = this.extra; + is = this.extraSlots; } else if (is == this.armor) { i = getReversedArmorSlotNum(i); } + if (i >= is.length) { + i -= is.length; + is = this.extra; + } + if (is[i] != null) { ItemStack itemstack = is[i]; @@ -226,12 +243,17 @@ public class SpecialPlayerInventory extends PlayerInventory implements ISpecialP if (i >= is.length) { i -= is.length; - is = this.extra; + is = this.extraSlots; } else if (is == this.armor) { i = getReversedArmorSlotNum(i); } + if (i >= is.length) { + i -= is.length; + is = this.extra; + } + // Effects if (is == this.extra) { owner.getHandle().drop(itemstack, true);