summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2012-03-02 20:02:45 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2012-03-02 20:03:21 +0000
commit88149dc439f21e7c10b10f0b8f9a2033a384081d (patch)
tree4e4f5c173e4a46177cb61fc989ee3588b6d9afc7 /src/main
parent8016bf2dd02d960cc831a05bfb9112f91948fa57 (diff)
downloadcraftbukkit-88149dc439f21e7c10b10f0b8f9a2033a384081d.tar
craftbukkit-88149dc439f21e7c10b10f0b8f9a2033a384081d.tar.gz
craftbukkit-88149dc439f21e7c10b10f0b8f9a2033a384081d.tar.lz
craftbukkit-88149dc439f21e7c10b10f0b8f9a2033a384081d.tar.xz
craftbukkit-88149dc439f21e7c10b10f0b8f9a2033a384081d.zip
Fixed chest.getInventory for double chests, thanks to Acrobot. This fixes BUKKIT-901
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftChest.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
index 7ccfa80e..0c07bd2c 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
@@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityChest;
+import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@@ -23,7 +24,10 @@ public class CraftChest extends CraftBlockState implements Chest {
public Inventory getInventory() {
// The logic here is basically identical to the logic in BlockChest.interact
- int x = getLocation().getBlockX(), y = getLocation().getBlockY(), z = getLocation().hashCode();
+ Location loc = getLocation();
+ int x = loc.getBlockX();
+ int y = loc.getBlockY();
+ int z = loc.getBlockZ();
CraftInventory inventory = new CraftInventory(chest);
if (world.getBlockTypeIdAt(x - 1, y, z) == Material.CHEST.getId()) {
CraftInventory left = new CraftInventory((TileEntityChest)world.getHandle().getTileEntity(x - 1, y, z));