Jump to content

Recommended Posts

Posted
Quote

java.lang.ArrayIndexOutOfBoundsException: 20

You're trying to get a slot index that is bigger than the size of the array. It's most likely a mistake with the slot indexing in your container, it can be tricky to get right. I'd recommend stepping through the construction of your container slots in the debugger to find out which indexes they are being associated with and where it goes wrong. If you want more help please post your ContainerBase and ContainerConstructor classes.

Posted
36 minutes ago, Jay Avery said:

You're trying to get a slot index that is bigger than the size of the array. It's most likely a mistake with the slot indexing in your container, it can be tricky to get right. I'd recommend stepping through the construction of your container slots in the debugger to find out which indexes they are being associated with and where it goes wrong. If you want more help please post your ContainerBase and ContainerConstructor classes.

 

Now it doesn't open the gui. Here is my ContainerBase code: https://gist.github.com/letruongthinh/21f58eb3c04fac917d72ed35190397d0

My ContainerConstructor code: https://gist.github.com/letruongthinh/649c2ace3a7dd7fed501b421df50478e

Posted
Just now, Jay Avery said:

What have you changed?

Well, I changed the SLOT_PLAN to 0, SLOLT_CRAFT_RESULT to 1, and SLOT_CRAFT_MATRIX to 2 in the InventoryConstructor.

Posted
Just now, lethinh said:

Well, I changed the SLOT_PLAN to 0, SLOLT_CRAFT_RESULT to 1, and SLOT_CRAFT_MATRIX to 2 in the InventoryConstructor.

And that change alone has resulted in your GUI not opening?

Posted

It shows these error lines:

 

[21:04:27] [File IO Thread/ERROR]: Failed to save chunk
java.lang.NullPointerException
    at java.io.DataOutputStream.writeUTF(DataOutputStream.java:347) ~[?:1.8.0_51]
    at java.io.DataOutputStream.writeUTF(DataOutputStream.java:323) ~[?:1.8.0_51]
    at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:555) ~[NBTTagCompound.class:?]
    at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:29) ~[NBTTagCompound.class:?]
    at net.minecraft.nbt.NBTTagList.write(NBTTagList.java:37) ~[NBTTagList.class:?]
    at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:556) ~[NBTTagCompound.class:?]
    at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:29) ~[NBTTagCompound.class:?]
    at net.minecraft.nbt.NBTTagCompound.writeEntry(NBTTagCompound.java:556) ~[NBTTagCompound.class:?]
    at net.minecraft.nbt.NBTTagCompound.write(NBTTagCompound.java:29) ~[NBTTagCompound.class:?]
    at net.minecraft.nbt.CompressedStreamTools.writeTag(CompressedStreamTools.java:126) ~[CompressedStreamTools.class:?]
    at net.minecraft.nbt.CompressedStreamTools.write(CompressedStreamTools.java:116) ~[CompressedStreamTools.class:?]
    at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkData(AnvilChunkLoader.java:252) ~[AnvilChunkLoader.class:?]
    at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeNextIO(AnvilChunkLoader.java:230) [AnvilChunkLoader.class:?]
    at net.minecraft.world.storage.ThreadedFileIOBase.processQueue(ThreadedFileIOBase.java:48) [ThreadedFileIOBase.class:?]
    at net.minecraft.world.storage.ThreadedFileIOBase.run(ThreadedFileIOBase.java:36) [ThreadedFileIOBase.class:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]

Posted

I can't tell exactly what that crash means, but it's most likely another form of the same problem - something to do with bad slot indexes getting noticed when being written to NBT. Why did you change those slot indexes? I'd still recommend stepping through the container construction with the debugger and carefully watch the slots being added to see if they are indexed as you expect.

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.