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 13543b9d..f6b4d6c9 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 @@ -284,16 +284,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_BranchCutter.java b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java index 7aa5d4dc..7cefcdfd 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_BranchCutter.java @@ -60,7 +60,7 @@ public class GT_Tool_BranchCutter public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool.equals("grafter"))) || (aBlock.getMaterial() == Material.leaves); + return ((tTool != null) && (tTool.equals("grafter"))) || (aBlock.getMaterial() == Material.leaves); } public IIconContainer getIcon(boolean aIsToolHead, ItemStack aStack) { 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 8c2b8dee..d5a94e1e 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.equals("file")); + return ((tTool != null) && tTool.equals("file")); } public ItemStack getBrokenItem(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java index cb470e5a..a7666d34 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Plow.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Plow.java @@ -31,7 +31,7 @@ public class GT_Tool_Plow public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return ((tTool.equals("plow"))) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.craftedSnow); + return ((tTool != null) && (tTool.equals("plow"))) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.craftedSnow); } public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { 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 678e694f..4b13d158 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.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_Sense.java b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java index 948c1526..55fb257c 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_Sense.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_Sense.java @@ -31,7 +31,7 @@ public class GT_Tool_Sense public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (((tTool.equals("sense")) || (tTool.equals("scythe")))) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.leaves); + return ((tTool != null) && ((tTool.equals("sense")) || (tTool.equals("scythe")))) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.leaves); } public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { 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 fc95306a..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.equals("softhammer")); + return ((tTool != null) && tTool.equals("softhammer")); } public ItemStack getBrokenItem(ItemStack aStack) { diff --git a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java index df12b92c..03fd6a97 100644 --- a/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java +++ b/src/main/java/gregtech/common/tools/GT_Tool_UniversalSpade.java @@ -79,7 +79,7 @@ public class GT_Tool_UniversalSpade public boolean isMinableBlock(Block aBlock, byte aMetaData) { String tTool = aBlock.getHarvestTool(aMetaData); - return (((tTool.equals("shovel")) || (tTool.equals("axe")) || (tTool.equals("saw")) || (tTool.equals("sword")) || (tTool.equals("crowbar")))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.circuits) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge); + return ((tTool != null) && ((tTool.equals("shovel")) || (tTool.equals("axe")) || (tTool.equals("saw")) || (tTool.equals("sword")) || (tTool.equals("crowbar")))) || (aBlock.getMaterial() == Material.sand) || (aBlock.getMaterial() == Material.grass) || (aBlock.getMaterial() == Material.ground) || (aBlock.getMaterial() == Material.snow) || (aBlock.getMaterial() == Material.clay) || (aBlock.getMaterial() == Material.leaves) || (aBlock.getMaterial() == Material.vine) || (aBlock.getMaterial() == Material.wood) || (aBlock.getMaterial() == Material.cactus) || (aBlock.getMaterial() == Material.circuits) || (aBlock.getMaterial() == Material.gourd) || (aBlock.getMaterial() == Material.web) || (aBlock.getMaterial() == Material.cloth) || (aBlock.getMaterial() == Material.carpet) || (aBlock.getMaterial() == Material.plants) || (aBlock.getMaterial() == Material.cake) || (aBlock.getMaterial() == Material.tnt) || (aBlock.getMaterial() == Material.sponge); } public ItemStack getBrokenItem(ItemStack aStack) {