public void PlaceTile(int x, int y, Layer layer, BlockType block, bool sendMessage)
{
int z = layer == Layer.Foreground ? 1 : 0;
if (CanPlaceBlock(x, y, z, block))
{
//If the block has changed, and we should send a message, send one
if (sendMessage && Tiles[x, y, z].Block.ID != block.ID)
{
Game.NetManager.Send(new BlockMessage(block, x, y, z));
}
//Set the block
switch (block.Type)
{
case TileType.Default:
Tiles[x, y, z] = new Tile(block);
break;
case TileType.Animated:
Tiles[x, y, z] = new AnimatedTile(block);
break;
}
}
}