13
0
geforkt von Mirrors/Paper

SPIGOT-690: Try to make force opened enchant tables work a bit better

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2017-11-18 10:48:16 +11:00
Ursprung a8a168aba4
Commit cd791fe451

Datei anzeigen

@ -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);