SPIGOT-6754: We ignore any still present TileEntity now when we create a BlockState for a block of type AIR.
During block destruction, the type of the block may already have been set to AIR while the TileEntity has not yet been removed. Also, TileEntity#getOwner() skips the whole BlockState construction now if the block is of type AIR. This removes the previous workaround again of returning a dummy CraftBlockEntityState in this case. By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
return nbttagcompound;
|
||||
}
|
||||
}
|
||||
@@ -164,4 +188,13 @@
|
||||
@@ -164,4 +188,15 @@
|
||||
public void b(IBlockData iblockdata) {
|
||||
this.blockState = iblockdata;
|
||||
}
|
||||
@@ -57,7 +57,9 @@
|
||||
+ // CraftBukkit start - add method
|
||||
+ public InventoryHolder getOwner() {
|
||||
+ if (level == null) return null;
|
||||
+ org.bukkit.block.BlockState state = level.getWorld().getBlockAt(worldPosition.getX(), worldPosition.getY(), worldPosition.getZ()).getState();
|
||||
+ org.bukkit.block.Block block = level.getWorld().getBlockAt(worldPosition.getX(), worldPosition.getY(), worldPosition.getZ());
|
||||
+ if (block.getType() == org.bukkit.Material.AIR) return null;
|
||||
+ org.bukkit.block.BlockState state = block.getState();
|
||||
+ if (state instanceof InventoryHolder) return (InventoryHolder) state;
|
||||
+ return null;
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user