public void OnSpongePlaced(int x, int y, int z) { SpongePlacedUpdateCoverage(x, y, z); for (int x1 = x - SpongeRange; x1 <= x + SpongeRange; x1++) { for (int y1 = y - SpongeRange; y1 <= y + SpongeRange; y1++) { for (int z1 = z - SpongeRange; z1 <= z + SpongeRange; z1++) { Block block = map.GetBlock(x1, y1, z1); if (block == Block.Water || block == Block.StillWater) { map.SetBlockNoNeighborChange(null, x1, y1, z1, Block.Air); } } } } }
public void Trigger(int x, int y, int z) { // Find where the snow should drop down to (if at all) int dropZ = z; while (dropZ > 0) { if (!LetsSnowThrough(map.GetBlock(x, y, dropZ - 1))) { break; } dropZ--; } // If snow can drop down, start falling... bool snowHasDropped = false; if (dropZ != z) { Block oldBlock = map.GetBlock(x, y, dropZ); map.SetBlockNoNeighborChange(null, x, y, z, Block.Air); if (oldBlock != Block.Snow) { snowHasDropped = true; } z = dropZ; } if (ThisShouldMelt(x, y, z)) { // If we have any hot neighbors, queue melting (2 ticks from now) map.PhysicsQueueTick(x, y, z, Block.Snow); } else if (snowHasDropped) { // Land the dropped snow map.SetBlock(null, x, y, dropZ, Block.Snow); } }