{
case THAW:
if (blockID == Block.ice.blockID)
{
// Replace ice with water.
backup.before.add(new BlockSaveable(world, x, y, z));
world.setBlock(x, y, z, Block.waterMoving.blockID);
backup.after.add(new BlockSaveable(world, x, y, z));
currentBlocksChanged++;
}
else if (blockID == Block.snow.blockID)
{
// Remove snow.
backup.before.add(new BlockSaveable(world, x, y, z));
world.setBlock(x, y, z, 0);
backup.after.add(new BlockSaveable(world, x, y, z));
currentBlocksChanged++;
}
break;
case FREEZE:
if (blockID == Block.waterMoving.blockID || blockID == Block.waterStill.blockID)
{
// Both water types become ice.
backup.before.add(new BlockSaveable(world, x, y, z));
world.setBlock(x, y, z, Block.ice.blockID);
backup.after.add(new BlockSaveable(world, x, y, z));
currentBlocksChanged++;
}
break;
case SNOW:
if (Block.isNormalCube(world.getBlockId(x, y, z)) || Block.blocksList[blockID].isLeaves(world, x, y, z))
{
// Add snow covering to the block above.
backup.before.add(new BlockSaveable(world, x, y + 1, z));
world.setBlock(x, y + 1, z, Block.snow.blockID);
backup.after.add(new BlockSaveable(world, x, y + 1, z));
currentBlocksChanged++;
}
break;
case TILL:
if (blockID == Block.dirt.blockID || blockID == Block.grass.blockID)
{
backup.before.add(new BlockSaveable(world, x, y, z));
world.setBlock(x, y, z, Block.tilledField.blockID);
backup.after.add(new BlockSaveable(world, x, y, z));
currentBlocksChanged++;
}
break;
case UNTILL:
if (blockID == Block.tilledField.blockID)
{
backup.before.add(new BlockSaveable(world, x, y, z));
world.setBlock(x, y, z, Block.dirt.blockID);
backup.after.add(new BlockSaveable(world, x, y, z));
currentBlocksChanged++;
}
break;
}
}