Immersive Technology

Immersive Technology

4M Downloads

Crashes when loading

JackHarper23 opened this issue ยท 8 comments

commented

Good day. The mod began to crash when loading when the "High-Pressure Turbine" was turned on in the config. Previously, there was no such problem, now there is. Log:
crash-2023-07-18_13.33.55-client.txt

commented

add an item to the oredict blockTungsten via CraftTweaker

Tested, not working. Probably since CraftTweaker apply changes after ImmersiveTechnology init.

Add a mod that adds Tungsten blocks

Not working too, since Jaopca add such block jaopca:block_blocktungsten, and its still crashing.

CraftTweaker can remove it

No, CraftTweaker cant remove OreDicts since its assumed that they always exist, even without items in them.

The possible solution would be patch IT and instead of using OreDictionary.doesOreNameExist("blockTungsten"), check amount of blocks in this oredict entry. Or probably even better - move static initialization of structure to later state of the game, when all oredicts already defined.

commented

Feel free to submit a PR with a fix.

commented

It would also to be worthy to note that a workaround would not be necessary if the mod that is registering tungsten actually used it.

commented

Unless someone wants to fix this, it's not going to get fixed.

commented

Cant Reproduce with just IE and IT must be a mod compatibility issue

commented

Have the same issue. Randomly unable to load the pack. Played several years with IT without problems ๐Ÿ˜…

Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    at java.util.ArrayList.rangeCheck(ArrayList.java:659)
    at java.util.ArrayList.get(ArrayList.java:435)
    at net.minecraft.util.NonNullList.get(SourceFile:44)
    at mctmods.immersivetechnology.common.blocks.metal.multiblocks.MultiblockHighPressureSteamTurbine.<clinit>(MultiblockHighPressureSteamTurbine.java:52)
    ... 45 more
commented

I found the reason. Its happens when oreDict blockTungsten exist but have no items in it.

  1. Mod checking OreDictionary.doesOreNameExist("blockTungsten") returning true that means that OreDict exist.

https://github.com/tgstyle/MCT-Immersive-Technology/blob/Latest/src/main/java/mctmods/immersivetechnology/common/blocks/metal/multiblocks/MultiblockHighPressureSteamTurbine.java#L33

  1. But when it call OreDictionary.getOres(blockOreName, false).get(0) it crashes

https://github.com/tgstyle/MCT-Immersive-Technology/blob/Latest/src/main/java/mctmods/immersivetechnology/common/blocks/metal/multiblocks/MultiblockHighPressureSteamTurbine.java#L52C29-L52C78

commented

Workarounds that I can think of, add an item to the oredict blockTungsten via CraftTweaker. Add a mod that adds Tungsten blocks. If the blockTungsten is empty, see if CraftTweaker can remove it. Have the mod author that is putting in a blank oreDict remove it.