Fix NPE when loading up the world

This commit is contained in:
Ran
2021-11-28 00:21:01 +06:00
parent b63f24c92e
commit aaedc8e384
2 changed files with 8 additions and 2 deletions
@@ -60,6 +60,8 @@ import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.DimensionType;
import net.minecraft.world.server.ServerWorld;
import javax.annotation.Nullable;
/**
* A singleton that wraps the Minecraft class
* to allow for easier movement between Minecraft versions.
@@ -275,7 +277,8 @@ public class MinecraftWrapper implements IMinecraftWrapper
}
return WorldWrapper.getWorldWrapper(serverWorld);
}
@Nullable
@Override
public IWorldWrapper getWrappedClientWorld()
{
@@ -14,6 +14,8 @@ import net.minecraft.world.IWorld;
import net.minecraft.world.server.ServerChunkProvider;
import net.minecraft.world.server.ServerWorld;
import javax.annotation.Nullable;
/**
* @author James Seibel
* @author ??
@@ -39,9 +41,10 @@ public class WorldWrapper implements IWorldWrapper
}
@Nullable
public static WorldWrapper getWorldWrapper(IWorld world)
{
if (world == null) return null;
//first we check if the biome has already been wrapped
if(worldWrapperMap.containsKey(world) && worldWrapperMap.get(world) != null)
return worldWrapperMap.get(world);