From 11f15badff90107ca25b7024c6c78b69e14f1d6d Mon Sep 17 00:00:00 2001 From: Chicken-Bones Date: Wed, 3 Dec 2014 13:18:44 +1000 Subject: [PATCH] Fix NPE during some early world load sequences --- src/codechicken/nei/NEIServerConfig.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/codechicken/nei/NEIServerConfig.java b/src/codechicken/nei/NEIServerConfig.java index 0d61bf9e..9e5376e1 100644 --- a/src/codechicken/nei/NEIServerConfig.java +++ b/src/codechicken/nei/NEIServerConfig.java @@ -9,7 +9,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.JsonToNBT; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; @@ -48,13 +47,13 @@ public class NEIServerConfig loadWorld(world); } - public static File getSaveDir(int dim) { - return new File(CommonUtils.getSaveLocation(dim), "NEI"); + public static File getSaveDir(World world) { + return new File(CommonUtils.getSaveLocation(world), "NEI"); } private static void loadWorld(World world) { try { - File file = new File(getSaveDir(CommonUtils.getDimension(world)), "world.dat"); + File file = new File(getSaveDir(world), "world.dat"); NBTTagCompound tag = NEIServerUtils.readNBT(file); if(tag == null) tag = new NBTTagCompound(); dimTags.put(CommonUtils.getDimension(world), tag); @@ -101,7 +100,7 @@ public class NEIServerConfig private static void saveWorld(int dim) { try { - File file = new File(getSaveDir(dim), "world.dat"); + File file = new File(getSaveDir(DimensionManager.getWorld(dim)), "world.dat"); NEIServerUtils.writeNBT(dimTags.get(dim), file); } catch (Exception e) { throw new RuntimeException(e);