Fixed space dynamic loading

This commit is contained in:
LemADEC 2015-11-26 02:40:32 +01:00
parent 4f4b2dccb0
commit ab75f15654

View file

@ -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;