Close GUI when the block is destroyed (#40)

This commit is contained in:
Kogepan229 authored and GitHub committed 2026-06-15 09:24:46 +02:00
1 parent 4a24bb478d
commit a2e5b40bc9
1 file changed
+3 -1
@@ -105,7 +105,9 @@ public abstract class TileEntityAbstractInventory extends TileEntity implements
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 64D;
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this && player
.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D)
<= 64.0D;
}
@Override