BuildingGadgets: Crash with Building Gadget

Forge 2815, Gadgets 2.6.8.

I was about to start using the gadget in water when scrolling over to the item threw this crash.

---- Minecraft Crash Report ----
// My bad.

Time: 2019-03-31 20:03:23 EDT
Description: Unexpected error

java.lang.ArrayIndexOutOfBoundsException: 45
    at cofh.core.gui.container.InventoryContainerItemWrapper.getStackInSlot(InventoryContainerItemWrapper.java:142)
    at net.minecraftforge.items.wrapper.InvWrapper.getStackInSlot(InvWrapper.java:68)
    at com.direwolf20.buildinggadgets.common.tools.InventoryManipulation.countInContainer(InventoryManipulation.java:304)
    at com.direwolf20.buildinggadgets.common.tools.InventoryManipulation.countItem(InventoryManipulation.java:174)
    at com.direwolf20.buildinggadgets.common.tools.ToolRenders.renderBuilderOverlay(ToolRenders.java:132)
    at com.direwolf20.buildinggadgets.client.proxy.ClientProxy.renderWorldLastEvent(ClientProxy.java:92)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_269_ClientProxy_renderWorldLastEvent_RenderWorldLastEvent.invoke(.dynamic)
    at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
    at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
    at net.minecraftforge.client.ForgeHooksClient.dispatchRenderLast(ForgeHooksClient.java:196)
    at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1432)
    at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1259)
    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1062)
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1119)
    at net.minecraft.client.Minecraft.run(Minecraft.java:3942)
    at net.minecraft.client.main.Main.main(SourceFile:123)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
    at org.multimc.EntryPoint.listen(EntryPoint.java:143)
    at org.multimc.EntryPoint.main(EntryPoint.java:34)

I had a Tech Reborn block as the build block at the time, but I was able to reload in and delete the gadget and get a new one, where I then copied a Flat Colored Block and got the same exact crash. I have no idea whats wrong when parsing over this crash report.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Additionally it seems to be fixed in the latest release:

Fixes:

  • Fix invalid item capabilities on (upgraded) TE Satchels, Closes #20

https://minecraft.curseforge.com/projects/common-capabilities/files/2705122

Yup, it’s something telling something that the item is an IItemHandler when it’s not

You’re a mad man and a saint! that’s got to be the cause. ❤️

I feel like there may be another mod involved here then. Part of the issue with capabilities is that you can force them unwillingly on other people’s items at runtime.

That may be happening here.

There is a specific reason - Satchels can be made private and the “accessible” capability would change. And while some mods will get that right, the vast majority of them will not. It’s a defensive measure.

The way that the IItemHandler cap works is slow and not ideal for items. I wrote up a skeleton for it in 1.7.10 essentially as an interface, and RWTema took it and put it in Forge. Believe me, I wish it had been done differently.

Having a quick look at the code, it’s likely an issue with CoFH as we rely on their IInventory handing us back the correct slot count (seen here https://github.com/Direwolf20-MC/BuildingGadgets/blob/master/src/main/java/com/direwolf20/buildinggadgets/common/tools/InventoryManipulation.java#L303 ) thus, I’m not sure we can fix this without adding a special case for CoFH. Like I said, just a quick observation.