MachineMuse / MachineMusePowersuits

Minecraft mod, take 2
236 stars 105 forks source link

[1.12.2] Crash with Lux capacitor #893

Open hanakocz opened 5 years ago

hanakocz commented 5 years ago

Hi there,

I got hands on repeatedly crashing server due to this mod's entity. https://gist.github.com/hanakocz/3dc5c7c943e54a3973e61baf763af6d3

I edited the entity out of the save so the server is saved, however you might be interested in fixing it so there is no crash in the first place.

What apparently happened: Player apparently fired the light on some blocks, and server disconnected him/crashed. Once the player reconnected, the light/block was not there, so they replaced it, and then it crashed for good and was crashing with every chunkload of the area. The blocks the light was fired on were presumabely "seared stone, polished andezit, and diorit", don't know if relevant or not.

Possible fixes: allow null on mentioned unlisted property, or handle the situation that null cannot happen :)

lehjr commented 5 years ago

I'll admit, I'm intrigued by the error, more so because if you follow the code hierarchy, there shouldn't be any case where the color property should be null. For instance, for manual placement, the property uses the default value. When being fired from the power fist module, it creates the entity showing in the error, but that property is read from the module and populated in the constructor on creation, and synced with the built in packet read/write spawn data methods.

Anyway, I've added some handling to avoid a null value, but it will need some testing.