public static void check(TileEntity te) { for (SegmentTileEntity segment : segmentsTile.get(te.getClass())) { if (!segment.shouldExist(te)) { ItemStack itemStack = new ItemStack(te.getBlockType(), 1, te.getBlockMetadata()); NBTTagCompound nbt = new NBTTagCompound(); te.writeToNBT(nbt); itemStack.setTagCompound(nbt); WorldUtils.dropAsEntity(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, itemStack); te.getWorldObj().setBlock(te.xCoord, te.yCoord, te.zCoord, Blocks.air); te.invalidate(); MyTown.instance.LOG.info("TileEntity {} was ATOMICALLY DISINTEGRATED!", te.toString()); return; } } }