public override void SetHeightAt(int x, int z, int h, byte mat)
{
int oh=GetHeightAt(x,z);
// Ignore air/water/lava
List<byte> excused_blocks=new List<byte>(new byte[]{0,8,9,10,11});
for (int y = 0; y < ChunkY; y++)
{
byte block = GetBlockAt(x,y,z);
bool excused = excused_blocks.Contains(block);
if (!excused && h < y) block = 0; // REMOVE SHIT
if (excused && h >= y) block = mat; // ADD DERT
if (block==3 && h == y) block = 2; // ADD GRASS
SetBlockAt(x, y, z, block);
}
int X = x / ChunkX;
int Z = z / ChunkZ;
int _x = x - ((z >> 4) * ChunkX); //(px >> 4) & 0xf;
int _z = z - ((z >> 4) * ChunkZ); //(py >> 4) & 0xf;
Chunk c = GetChunk(X, Z);
c.HeightMap[_x, _z]=h;
SetChunk(c);
}