From c09ebb9e9b20755fcdef5782146fbde1cb4fc4ff Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 28 Sep 2016 14:05:10 +0200 Subject: [PATCH] Teleport2 and readd null checks on tools --- .../basic/GT_MetaTileEntity_Teleporter.java | 15 +++++---------- .../java/gregtech/common/tools/GT_Tool_File.java | 2 +- .../gregtech/common/tools/GT_Tool_Plunger.java | 2 +- .../gregtech/common/tools/GT_Tool_SoftHammer.java | 2 +- 4 files changed, 8 insertions(+), 13 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 e9233026..fe9d6d78 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 @@ -293,16 +293,11 @@ public class GT_MetaTileEntity_Teleporter extends GT_MetaTileEntity_BasicTank { tEntity.riddenByEntity.mountEntity(null); } if ((this.mTargetD == getBaseMetaTileEntity().getWorld().provider.dimensionId) || (!isDimensionalTeleportAvailable()) || (!GT_Utility.moveEntityToDimensionAtCoords(tEntity, this.mTargetD, this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D))) { -// System.out.println("tele"); -//// System.out.println("tdim: "+mTargetD+" proDim: "+getBaseMetaTileEntity().getWorld().provider.dimensionId); -// if ((tEntity instanceof EntityLivingBase)) { -// if(this.mTargetD != getBaseMetaTileEntity().getWorld().provider.dimensionId){ -// System.out.println("move dim"); -// GT_Utility.moveEntityToDimensionAtCoords(tEntity, mTargetD, mTargetX, mTargetY, mTargetZ); -// }else{((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D);} -// } else { -// tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); -// } + if ((tEntity instanceof EntityLivingBase)) { + ((EntityLivingBase) tEntity).setPositionAndUpdate(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + } else { + tEntity.setPosition(this.mTargetX + 0.5D, this.mTargetY + 0.5D, this.mTargetZ + 0.5D); + } } } } diff --git a/src/main/java/gregtech/common/tools/GT_Tool_File.java b/src/main/java/gregtech/common/tools/GT_Tool_File.java index 250edbe5..19975f12 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_File.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_File.java @@ -75,7 +75,7 @@ public class GT_Tool_File public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("file")); + return ((tTool != null) && tTool.equals("file")); } public ItemStack getBrokenItem(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java index fc4e6090..3fef69d7 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plunger.java @@ -43,7 +43,7 @@ public class GT_Tool_Plunger public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("plunger")); + return ((tTool != null) && tTool.equals("plunger")); } public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java index 0b77a45e..ecbb4381 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_SoftHammer.java @@ -84,7 +84,7 @@ public class GT_Tool_SoftHammer public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (tTool != null) && (tTool.equals("softhammer")); + return ((tTool != null) && tTool.equals("softhammer")); } public ItemStack getBrokenItem(ItemStack aStack) {