Enigmatica 2: Expert - Extended

Enigmatica 2: Expert - Extended

194k Downloads

Server/client crash - BitHop `KotlinNullPointerException`

Krutoy242 opened this issue ยท 1 comments

commented

Placing BitHop hoppers attached to some tile entities causing game to crash.

For example, this could happed with Mekanism Cube or Light Well

This issue already reported to BitHot tracker elytra/BitHop#12

Temporary solution

Set this two options to true
File config/forge.cfg

B:removeErroringEntities=false
B:removeErroringTileEntities=false
commented

Once you do this, the world is corrupted. To fix this, you need to remove the bithop from the world. First solution if to set "remove erroring entities" in forge configs (I did not test it, and my understanding is this can be toubling, but should work), then load the world, break the bithop in game, and then you can set the config back to the way it was.

The second solution, which I used and it worked for me, takes a bit more time. First, make a backup of your world, as you're gonna edit the world files. I don't take any responsibility if you corrupt your save, so please make sure to make backup. Open the save with NBT Explorer. I used that tool, but I can't say whether it's safe. Locate the tile entity responsible for the bithop (in the appropriate region file, in the correct chunk). Tip: most likely this is close to where you stood when you placed the hopper and the world crashed. Player position is in level.dat/Data/Player/Pos.
You can read more info about the file format here: https://minecraft.fandom.com/wiki/Anvil_file_format#Further_information
Once you find it and are sure that this is the one, write down the coordinates (x,y,z) and remember them. Remove the tile entity.
In that chunk tag, open Level/Sections list, and choose the appropriate level. Each level has a y coordinate, you're interested in the one which is y/16, rounded down. You need to modify Data and Blocks tags. To understand this, read the guide on minecraft wiki linked above in the answer. If I understood this correctly, you need to calculate w = 16*(16*Y+Z) + X, where X,Y,Z are the coordinates in the chunk. Mathematically they are X = x mod 16 etc, for example if (x,y,z) = (-13,86,2), you have (X,Y,Z) = (3,6,2). In this example you have w = 1571. Open Blocks tag. If I did the maths correctly, in the hex form of the array, locate byte number w (in my example 1571). A byte is two characters. NBT explorer will display this in lower left corner and call it "element". Change both characters to 0 (likely they will already be 0, or 01 or something small). Then in the Data tag, locate hexadecimal character number w. NBT explorer should display this as element w/2 (note the Data tag is two times smaller than Blocks. As I understand it the information about the block is located across these two tags, and the digits you're changing to 0 encode info about this block). Change exactly this one sign (hexadecimal digit) to 0.