mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 11:24:11 +01:00
SPIGOT-323: Allow force creating enchant table containers. Usefullness is not guaranteed.
This commit is contained in:
parent
c99cdafd3f
commit
dde25d45ef
1 changed files with 8 additions and 1 deletions
|
@ -294,7 +294,14 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||||
if (location == null) {
|
if (location == null) {
|
||||||
location = getLocation();
|
location = getLocation();
|
||||||
}
|
}
|
||||||
getHandle().openTileEntity((ITileEntityContainer) getHandle().world.getTileEntity(new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ())));
|
|
||||||
|
// 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()));
|
||||||
|
if (container == null && force) {
|
||||||
|
container = new TileEntityEnchantTable();
|
||||||
|
}
|
||||||
|
getHandle().openTileEntity((ITileEntityContainer) container);
|
||||||
|
|
||||||
if (force) {
|
if (force) {
|
||||||
getHandle().activeContainer.checkReachable = false;
|
getHandle().activeContainer.checkReachable = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue