WhoCraft / TardisRefined

A Minecraft mod for Forge and Fabric which brings the TARDIS from Doctor Who to Minecraft.
Other
58 stars 23 forks source link

Suppress shell base errors with null "TARDIS_ID" #158

Closed webcrawls closed 1 year ago

webcrawls commented 1 year ago

When ShellBaseBlockEntity#saveAdditional is called during a player's login, and an NPE is thrown due to a null this.TARDIS_ID, the player will be prevented from logging in. This PR silences these NPEs in ShellBaseBlockEntity, instead opting to log errors in the console.

This mostly acts as a stop-gap when a Tardis' block state is corrupted in some way. In my case, I've been running TardisRefined on an ATM8 server, and I've ran into a few scenarios where shell's block state gets corrupted

A further step may be to identify these broken Tardis shells and remove them automatically, but that may be better for server admins to deal with manually.

(I've block state corruptions happen twice when running TardisRefined on an ATM8 server, so I figure this may be a useful change to include in the mod, in case others run into this issue as well. I understand if the authors reject it, fixes quite a niche issue ^^)