Jump to content

[1.7.10] Container inventorySlot array length not going above 45


joem29

Recommended Posts

When clicking on any Slot in the GUI with index above 45 I get a index out of bounds error report from java array checker, I understand the error but not how to fix it, any ideas?

 

Main Mod File                  http://tny.cz/8d48209c

Weapons Forge Block File  http://tny.cz/bd64a0f1

Weapons Forge GUI File    http://tny.cz/caa87993

Weapons Forge Tile Entity http://tny.cz/862a7839

Weapons Forge Container  http://tny.cz/95426f9a

Weapons Forge Slot          http://tny.cz/9e071901

Error Report                    http://tny.cz/4c117e8e

 

Thanks!

Joe,

Link to comment
Share on other sites

The order in which you Container#addSlotToContainer is really important.

You need to keep it in mind when writing #transferStackInSlot.

In your current state, you are adding 36 slots from player inventory, then 1 "output slot", then 9 "input slots". But your tile entity has 17 item slots.

Link to comment
Share on other sites

The order in which you Container#addSlotToContainer is really important.

You need to keep it in mind when writing #transferStackInSlot.

In your current state, you are adding 36 slots from player inventory, then 1 "output slot", then 9 "input slots". But your tile entity has 17 item slots.

 

I have tried adding the player slots after the rest and as you can see in the code the other way round with no luck.

Correct me if my maths is wrong but the input slots loops should add 16 slots not 9, which with the output slot is 17 in the tile entity and the 36 from the player?

Link to comment
Share on other sites

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.

Announcements



×
×
  • Create New...

Important Information

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