makamys / MAtmos

Minecraft Atmospheric sounds simulator (1.7.10, 1.12.2)
Other
27 stars 5 forks source link

ArrayIndexOutOfBoundsExceptions when max block ID is increased above 4096 #2

Closed Blatts12 closed 4 years ago

Blatts12 commented 4 years ago

error: https://gist.github.com/Blatts12/840380c3869a0479415b75307e7348e2 latest.log: https://gist.github.com/Blatts12/65012374a04c195c0492a6064a7d49cc

makamys commented 4 years ago

Hm, that's weird. It tries to count a block with the ID of 5747, but block IDs are only supposed to go up to 4095, and IDs above that are reserved for items, so this causes an error. Does it happen on a freshly created world?

Also, can you install the TellMe mod and

Blatts12 commented 4 years ago

I deleted the mod for now. But I use this mod JustEnoughIDs. Can this mod be a culprit?

makamys commented 4 years ago

Oh, that certainly looks like it. I'll make the id limit configurable to solve problems like this.

makamys commented 4 years ago

Closing this as it's fixed in MAtmos 35.


Explanation and workaround

The error is caused because JustEnoughIDs raises the max block ID, whereas MAtmos assumes by default that the max ID is 4096. However, this can be changed in the config file (.minecraft/config/matmos/userconfig.cfg), with this option

# The max block ID. This is 4096 normally, but there are mods that raise it. Getting an ArrayIndexOutOfBoundsException is indication that it needs to be raised.
world.maxblockid=4096

In your case blocks with an ID of 5366 are being accessed, so I'd suggest setting it to something like 8000 (or 8192 for extra nerd cred) to be on the safe side.

I should probably change the max block ID to grow dynamically to avoid this problem, but for the time being this is the workaround.