Jump to content

Recommended Posts

Posted

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.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.