Some refactoring

This commit is contained in:
Disasm 2013-07-12 12:54:11 +04:00
parent 640c4e532a
commit da3a1a351f

View file

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