From ee5ffeef052667ce63800a8f0a6e3e480b22fb62 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 25 Jun 2016 21:21:36 +1000 Subject: SPIGOT-1039: Improve DoubleChest semantics --- src/main/java/org/bukkit/block/DoubleChest.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/bukkit/block/DoubleChest.java b/src/main/java/org/bukkit/block/DoubleChest.java index 148099c5..663fcbbd 100644 --- a/src/main/java/org/bukkit/block/DoubleChest.java +++ b/src/main/java/org/bukkit/block/DoubleChest.java @@ -29,22 +29,22 @@ public class DoubleChest implements InventoryHolder { } public Location getLocation() { - return new Location(getWorld(), getX(), getY(), getZ()); + return getInventory().getLocation(); } public World getWorld() { - return ((Chest)getLeftSide()).getWorld(); + return getLocation().getWorld(); } public double getX() { - return 0.5 * (((Chest)getLeftSide()).getX() + ((Chest)getRightSide()).getX()); + return getLocation().getX(); } public double getY() { - return 0.5 * (((Chest)getLeftSide()).getY() + ((Chest)getRightSide()).getY()); + return getLocation().getY(); } public double getZ() { - return 0.5 * (((Chest)getLeftSide()).getZ() + ((Chest)getRightSide()).getZ()); + return getLocation().getZ(); } } -- cgit v1.2.3