Fix a null pointer where the player could be null

This commit is contained in:
James Seibel
2021-01-30 16:12:49 -06:00
parent e05ffb47e9
commit bc0d9f0a67
@@ -142,7 +142,7 @@ public class ClientProxy extends CommonProxy
// or null chunks in this method)
if (mc != null && mc.world != null && chunk != null && isValidChunk(chunk))
{
int dimId = mc.player.dimension;
int dimId = chunk.getWorld().provider.getDimension();
Thread thread = new Thread(() ->
{
@@ -154,7 +154,7 @@ public class ClientProxy extends CommonProxy
if (lodWorld.getLodDimension(dimId) == null)
{
DimensionType dim = DimensionType.getById(chunk.getWorld().provider.getDimension());
DimensionType dim = DimensionType.getById(dimId);
lodDim = new LodDimension(dim, regionWidth);
lodWorld.addLodDimension(lodDim);
}