Whenever I try to place a block in the world, it will get placed, but once I hit "save and quit" and reload the game, the block returns to how it was.
[spoiler=Simplified Code]
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
par1World.setBlock(par2, par3, par4, Core.Stick.blockID);
[color=red]par1World.markBlockForUpdate(par2, par3, par4);[/color]
}
This code that I think should force the block to be saved, but is not working
[spoiler=Full code]
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
{
int l = par1World.getBlockMetadata(par2, par3, par4);
double d0 = (double)((float)par2 + 0.5F);
double d1 = (double)((float)par3 + 0.7F);
double d2 = (double)((float)par4 + 0.5F);
double d3 = 0.2199999988079071D;
double d4 = 0.27000001072883606D;
TileEntityTorch tileentitytorch = (TileEntityTorch)par1World.getBlockTileEntity(par2, par3, par4);
System.out.println(tileentitytorch);
if(tileentitytorch.getBurnout() == -10)
{
tileentitytorch.setBurnout(100);
}
if(tileentitytorch.getBurnout() >= 0)
tileentitytorch.setBurnout(tileentitytorch.getBurnout() - 1);
System.out.println(tileentitytorch.getBurnout());
if(tileentitytorch.getBurnout() <= 0)
{
par1World.setBlock(par2, par3, par4, Core.Stick.blockID);
if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true))
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);
}
else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true))
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2);
}
else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true))
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
}
else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true))
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2);
}
else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))
{
par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2);
}
par1World.markBlockForUpdate(par2, par3, par4);
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
par1World.setblock
}
if (l == 1 && tileentitytorch.getBurnout() >= 0)
{
par1World.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
}
else if (l == 2 && tileentitytorch.getBurnout() >= 0)
{
par1World.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
}
else if (l == 3&& tileentitytorch.getBurnout() >= 0)
{
par1World.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
}
else if (l == 4&& tileentitytorch.getBurnout() >= 0)
{
par1World.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
}
else if(tileentitytorch.getBurnout() >= 0)
{
par1World.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D);
par1World.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D);
}
}
thanks in advance, I will be unable to respond for a few hours as I will be going to sleep.