From ab75f15654bdf40a72439c8037000890a4491858 Mon Sep 17 00:00:00 2001 From: LemADEC Date: Thu, 26 Nov 2015 02:40:32 +0100 Subject: [PATCH] Fixed space dynamic loading --- .../cr0s/warpdrive/block/movement/TileEntityShipCore.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java index 31fc0b83..c63fb70d 100644 --- a/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java +++ b/src/main/java/cr0s/warpdrive/block/movement/TileEntityShipCore.java @@ -23,6 +23,7 @@ import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.common.FMLCommonHandler; import cr0s.warpdrive.EntityJump; +import cr0s.warpdrive.LocalProfiler; import cr0s.warpdrive.WarpDrive; import cr0s.warpdrive.block.TileEntityAbstractEnergy; import cr0s.warpdrive.config.WarpDriveConfig; @@ -868,7 +869,12 @@ public class TileEntityShipCore extends TileEntityAbstractEnergy { AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(xCoord - 2, yCoord - 1, zCoord - 2, xCoord + 2, yCoord + 4, zCoord + 2); List list = worldObj.getEntitiesWithinAABBExcludingEntity(null, axisalignedbb); - WorldServer spaceWorld = DimensionManager.getWorld(WarpDriveConfig.G_SPACE_DIMENSION_ID); + WorldServer spaceWorld = MinecraftServer.getServer().worldServerForDimension(WarpDriveConfig.G_SPACE_DIMENSION_ID); + if (spaceWorld == null) { + String msg = "Unable to load Space dimension " + WarpDriveConfig.G_SPACE_DIMENSION_ID + ", aborting teleportation."; + messageToAllPlayersOnShip(msg); + return; + } for (Object o : list) { if (!consumeEnergy(WarpDriveConfig.SHIP_TELEPORT_ENERGY_PER_ENTITY, false)) { return;