Posted December 30, 20159 yr So, I went to go and shift-click my custom item into my custom slot, and I get this error: Caused by: java.lang.IndexOutOfBoundsException: Index: 40, Size: 37 at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_65] at java.util.ArrayList.get(Unknown Source) ~[?:1.8.0_65] at net.minecraft.inventory.Container.mergeItemStack(Container.java:638) ~[Container.class:?] at com.happykiller.weightlimit.player.inventory.container.ContainerWeightedPlayer.transferStackInSlot(ContainerWeightedPlayer.java:81) ~[ContainerWeightedPlayer.class:?] at net.minecraft.inventory.Container.slotClick(Container.java:291) ~[Container.class:?] at net.minecraft.client.multiplayer.PlayerControllerMP.windowClick(PlayerControllerMP.java:540) ~[PlayerControllerMP.class:?] at net.minecraft.client.gui.inventory.GuiContainer.handleMouseClick(GuiContainer.java:690) ~[GuiContainer.class:?] at net.minecraft.client.gui.inventory.GuiContainer.mouseClicked(GuiContainer.java:422) ~[GuiContainer.class:?] at net.minecraft.client.gui.GuiScreen.handleMouseInput(GuiScreen.java:606) ~[GuiScreen.class:?] at net.minecraft.client.gui.GuiScreen.handleInput(GuiScreen.java:572) ~[GuiScreen.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1760) ~[Minecraft.class:?] ... 15 more Here is the line that gives the error: if(!this.mergeItemStack(stack1, INV_START, HOTBAR_END + 1, true)) { return null; } Here are those variables (NOTE: I do not have armor slots in my Inventory. This might be causing the problem, but I am not sure): private static final int ARMOR_START = InventoryWeightLimit.INV_SIZE, ARMOR_END = ARMOR_START + 3, INV_START = ARMOR_END + 1, INV_END = INV_START + 26, HOTBAR_START = INV_END + 1, HOTBAR_END = HOTBAR_START + 8; Any ideas? I am not a cat. I know my profile picture is sexy and amazing beyond anything you could imagine but my cat like features only persist in my fierce eyes. I might be a cat.
December 30, 20159 yr Pretty sure that the 4 armor slots do not have inventory slot numbers. Or at least, in this context they don't appear to. I see 37: 1-9 (hotbar), 10-36 (inventory), 37 (your backpack). Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
December 30, 20159 yr Draco is probably right - did you add the armor slots to your container? If so, your inventory size should be 40 and you can merge those slots; if not, you need to remove the ARMOR_START and ARMOR_END indexes and set INV_START to the inventory size. http://i.imgur.com/NdrFdld.png[/img]
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.