diff options
author | md_5 <git@md-5.net> | 2017-11-18 10:48:16 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-11-18 10:48:16 +1100 |
commit | dccd2763bdc357d2b5f6e9d59729e6ac7e99135f (patch) | |
tree | 36ea5bfbd81e4385f0bc283c4e02c69d7d2e813f | |
parent | 74cd5fdfc43cadbfd6b55de344fa67675e2437b1 (diff) | |
download | craftbukkit-dccd2763bdc357d2b5f6e9d59729e6ac7e99135f.tar craftbukkit-dccd2763bdc357d2b5f6e9d59729e6ac7e99135f.tar.gz craftbukkit-dccd2763bdc357d2b5f6e9d59729e6ac7e99135f.tar.lz craftbukkit-dccd2763bdc357d2b5f6e9d59729e6ac7e99135f.tar.xz craftbukkit-dccd2763bdc357d2b5f6e9d59729e6ac7e99135f.zip |
SPIGOT-690: Try to make force opened enchant tables work a bit better
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 90df0ae1..c6f219a4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -321,9 +321,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } // If there isn't an enchant table we can force create one, won't be very useful though. - TileEntity container = getHandle().world.getTileEntity(new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ())); + BlockPosition pos = new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()); + TileEntity container = getHandle().world.getTileEntity(pos); if (container == null && force) { container = new TileEntityEnchantTable(); + container.a(getHandle().world); + container.setPosition(pos); } getHandle().openTileEntity((ITileEntityContainer) container); |