mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 03:32:46 +01:00
SPIGOT-690: Try to make force opened enchant tables work a bit better
This commit is contained in:
parent
74cd5fdfc4
commit
dccd2763bd
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue