It is pretty much exactly the same as what I currently have.
This is the code that I have in the PotentialBlock class in the breakBlock() method.
@Override
public void breakBlock(World world, int x, int y, int z, Block block, int p_149749_6_)
{
TilePotBlock t = (TilePotBlock)world.getTileEntity(x, y, z);
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
if (t instanceof TilePotBlock) {
TilePotBlock tile = (TilePotBlock)t;
ItemStack stack = new ItemStack(world.getBlock(x, y, z), 1);
if (!stack.hasTagCompound()) {
stack.setTagCompound(new NBTTagCompound());
}
stack.getTagCompound().setBoolean("potBlockR", tile.red);
stack.getTagCompound().setBoolean("potBlockG", tile.green);
stack.getTagCompound().setBoolean("potBlockB", tile.blue);
stack.getTagCompound().setBoolean("potBlockIR", tile.ir);
items.add(stack);
world.spawnEntityInWorld(new EntityItem(world, x, y, z, items.get(0)));
world.setBlock(x, y, z, Blocks.air);
}
}
It is deleting the information when I'm placing it back down.