public void configure(WorldBlock block, World world) { // Assume blocks have map location aspect var locState = MapLocationAspect.getMapLocationState(block); if (locState.position.x > 10) { configureAsAir(block, world); } else { configureAsGround(block, world); } }
public WorldBlock peekBlock(IntVector3 spot) { // Offset so (0,0,0) is here spot += center; if (spot.x < 0 || spot.x >= dim.x || spot.y < 0 || spot.y >= dim.y || spot.z < 0 || spot.z >= dim.z) { return(null); } var block = blocks[spot.x, spot.y, spot.z]; if (block == null) { block = blocks[spot.x, spot.y, spot.z] = new WorldBlock(); // Put the block in the spot MapLocationAspect.imbue(block, spot, this); } return(block); }