From 3be8aef5245acb9c7ab6bac950166a98aaedb5af Mon Sep 17 00:00:00 2001 From: Technus Date: Thu, 15 Dec 2016 19:08:18 +0100 Subject: [PATCH] Fix on first tick just in case someone wasnt to tp to 0 0 0 0. --- .../basic/GT_MetaTileEntity_Teleporter.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java index 040b8480..84043151 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Teleporter.java @@ -46,7 +46,7 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { public int mTargetX = 0; public int mTargetY = 0; public int mTargetZ = 0; - public int mTargetD = 0; + public int mTargetD = Integer.MIN_VALUE; public boolean mDebug = false; public GT_MetaTileEntity_Teleporter(int aID, String aName, String aNameRegional, int aTier) { @@ -204,13 +204,11 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { @Override public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - if (aBaseMetaTileEntity.isServerSide()) { - if ((this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == 0)) { - this.mTargetX = aBaseMetaTileEntity.getXCoord(); - this.mTargetY = aBaseMetaTileEntity.getYCoord(); - this.mTargetZ = aBaseMetaTileEntity.getZCoord(); - this.mTargetD = aBaseMetaTileEntity.getWorld().provider.dimensionId; - } + if (aBaseMetaTileEntity.isServerSide() && (this.mTargetX == 0) && (this.mTargetY == 0) && (this.mTargetZ == 0) && (this.mTargetD == Integer.MIN_VALUE)) { + this.mTargetX = aBaseMetaTileEntity.getXCoord(); + this.mTargetY = aBaseMetaTileEntity.getYCoord(); + this.mTargetZ = aBaseMetaTileEntity.getZCoord(); + this.mTargetD = aBaseMetaTileEntity.getWorld().provider.dimensionId; } }