Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

  • Author
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

  • Author
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.

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?

  • Author
Just now, Jay Avery said:

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

Yes!

  • Author

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]

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.