Fix a potential null pointer exception when leaving the world

The thread dealing with these should probably be killed and recreated when leaving the world instead of just catching the problem here.
This commit is contained in:
James Seibel
2021-10-22 20:46:26 -05:00
parent 7a0b95a105
commit d5466e0fda
@@ -155,6 +155,11 @@ public class LodBuilder
if (mc.getClientWorld() == null)
return;
// don't try to generate LODs if the user isn't in the world anymore
// (this happens a lot when the user leaves a world/server)
if (mc.getSinglePlayerServer() == null && mc.getCurrentServer() == null)
return;
DimensionType dim = world.dimensionType();
// make sure the dimension exists