From da3a1a351f14bc0ea89ae5be39fc8202934272cb Mon Sep 17 00:00:00 2001 From: Disasm Date: Fri, 12 Jul 2013 12:54:11 +0400 Subject: [PATCH] Some refactoring --- src/cr0s/WarpDrive/EntityJump.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cr0s/WarpDrive/EntityJump.java b/src/cr0s/WarpDrive/EntityJump.java index b6390179..7e9dba9e 100644 --- a/src/cr0s/WarpDrive/EntityJump.java +++ b/src/cr0s/WarpDrive/EntityJump.java @@ -147,11 +147,7 @@ public class EntityJump extends Entity { } if (!isJumping) { - this.toSpace = (dir == -1 && (maxY + distance > 255) && worldObj.provider.dimensionId != WarpDrive.instance.spaceDimID); - this.fromSpace = (dir == -2 && (minY - distance < 0) && worldObj.provider.dimensionId == WarpDrive.instance.spaceDimID); - System.out.println("[JE] Preparing to jump..."); - axisalignedbb = AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); prepareToJump(); @@ -265,9 +261,11 @@ public class EntityJump extends Entity { public void prepareToJump() { LocalProfiler.start("EntityJump.prepareToJump"); - boolean betweenWorlds; - betweenWorlds = fromSpace || toSpace; + toSpace = (dir == -1 && (maxY + distance > 255) && worldObj.provider.dimensionId != WarpDrive.instance.spaceDimID); + fromSpace = (dir == -2 && (minY - distance < 0) && worldObj.provider.dimensionId == WarpDrive.instance.spaceDimID); + + boolean betweenWorlds = fromSpace || toSpace; if (toSpace) { targetWorld = DimensionManager.getWorld(WarpDrive.instance.spaceDimID); @@ -277,6 +275,8 @@ public class EntityJump extends Entity { targetWorld = this.worldObj; } + axisalignedbb = AxisAlignedBB.getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); + lockWorlds(); saveEntities(axisalignedbb);