From 4cf37970586b9ff7a908d391be41816c217fa6e9 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 7 Jul 2015 11:56:38 +0200 Subject: [PATCH] Fixed a Derpup. --- .../java/ellpeck/actuallyadditions/items/ItemLeafBlower.java | 2 +- .../ellpeck/actuallyadditions/items/ItemPhantomConnector.java | 2 +- .../actuallyadditions/tile/TileEntityGreenhouseGlass.java | 2 +- src/main/java/ellpeck/actuallyadditions/util/WorldPos.java | 4 ---- src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java | 2 +- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java index ed26e96e1..3a2260991 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java @@ -53,7 +53,7 @@ public class ItemLeafBlower extends Item implements INameableItem{ for(int reachY = (this.isAdvanced ? -range : -rangeUp); reachY < (this.isAdvanced ? range+1 : rangeUp+1); reachY++){ Block block = world.getBlock(x+reachX, y+reachY, z+reachZ); if(block != null && (block instanceof BlockBush || (this.isAdvanced && block instanceof BlockLeavesBase))){ - WorldPos theCoord = new WorldPos(x+reachX, y+reachY, z+reachZ); + WorldPos theCoord = new WorldPos(world, x+reachX, y+reachY, z+reachZ); Block theBlock = world.getBlock(theCoord.getX(), theCoord.getY(), theCoord.getZ()); ArrayList drops = new ArrayList(); int meta = world.getBlockMetadata(theCoord.getX(), theCoord.getY(), theCoord.getZ()); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java index 1ba90b790..23c5943f2 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPhantomConnector.java @@ -98,7 +98,7 @@ public class ItemPhantomConnector extends Item implements INameableItem{ int z = tag.getInteger("ZCoordOfTileStored"); World world = DimensionManager.getWorld(tag.getInteger("WorldOfTileStored")); if(x != 0 && y != 0 && z != 0 && world != null){ - return new WorldPos(x, y, z); + return new WorldPos(world, x, y, z); } } return null; diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java index 981440abb..6e7edc3a3 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityGreenhouseGlass.java @@ -38,7 +38,7 @@ public class TileEntityGreenhouseGlass extends TileEntityBase{ Block block = worldObj.getBlock(xCoord, i, zCoord); if(block != null && !(worldObj.isAirBlock(xCoord, i, zCoord))){ if(block instanceof IGrowable && !(block instanceof BlockGrass)){ - return new WorldPos(xCoord, i, zCoord); + return new WorldPos(worldObj, xCoord, i, zCoord); } else return null; } diff --git a/src/main/java/ellpeck/actuallyadditions/util/WorldPos.java b/src/main/java/ellpeck/actuallyadditions/util/WorldPos.java index 07e2eaf6e..2c008f140 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/WorldPos.java +++ b/src/main/java/ellpeck/actuallyadditions/util/WorldPos.java @@ -16,10 +16,6 @@ public class WorldPos{ this.z = z; } - public WorldPos(int x, int y, int z){ - this(null, x, y, z); - } - public int getX(){ return this.x; } diff --git a/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java b/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java index b9e6840ba..2eef39653 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/WorldUtil.java @@ -21,7 +21,7 @@ public class WorldUtil{ public static WorldPos getCoordsFromSide(ForgeDirection side, int x, int y, int z){ if(side == ForgeDirection.UNKNOWN) return null; - return new WorldPos(x+side.offsetX, y+side.offsetY, z+side.offsetZ); + return new WorldPos(null, x+side.offsetX, y+side.offsetY, z+side.offsetZ); } public static void breakBlockAtSide(ForgeDirection side, World world, int x, int y, int z){