Package me.daddychurchill.CityWorld.Support

Examples of me.daddychurchill.CityWorld.Support.SurroundingLots


  }

  @Override
  protected void generateActualChunk(WorldGenerator generator, PlatMap platmap, ByteChunk chunk, BiomeGrid biomes, DataContext context, int platX, int platZ) {
    // look around
    SurroundingLots farms = new SurroundingLots(platmap, platX, platZ);
   
    // what type of ground do we have
    chunk.setLayer(generator.streetLevel - 1, 2, generator.oreProvider.surfaceMaterial);
   
    // in-between bits bits
    Material dividerMaterial = isolationNormalMaterial;
    if (generator.worldEnvironment == Environment.NETHER) {
      dividerMaterial = isolationNetherMaterial;
    }
   
    // draw the isolation blocks
    if (!farms.toNorth()) {
      chunk.setBlocks(1, 15, generator.streetLevel, 0, 1, dividerMaterial);
      if (farms.toWest())
        chunk.setBlock(0, generator.streetLevel, 0, dividerMaterial);
      if (farms.toEast())
        chunk.setBlock(15, generator.streetLevel, 0, dividerMaterial);
    }
    if (!farms.toSouth()) {
      chunk.setBlocks(1, 15, generator.streetLevel, 15, 16, dividerMaterial);
      if (farms.toWest())
        chunk.setBlock(0, generator.streetLevel, 15, dividerMaterial);
      if (farms.toEast())
        chunk.setBlock(15, generator.streetLevel, 15, dividerMaterial);
    }
    if (!farms.toWest()) {
      chunk.setBlocks(0, 1, generator.streetLevel, 1, 15, dividerMaterial);
      if (farms.toNorth())
        chunk.setBlock(0, generator.streetLevel, 0, dividerMaterial);
      if (farms.toSouth())
        chunk.setBlock(0, generator.streetLevel, 15, dividerMaterial);
    }
    if (!farms.toEast()) {
      chunk.setBlocks(15, 16, generator.streetLevel, 1, 15, dividerMaterial);
      if (farms.toNorth())
        chunk.setBlock(15, generator.streetLevel, 0, dividerMaterial);
      if (farms.toSouth())
        chunk.setBlock(15, generator.streetLevel, 15, dividerMaterial);
    }
  }
View Full Code Here


  @Override
  protected void generateActualChunk(WorldGenerator generator, PlatMap platmap, ByteChunk chunk, BiomeGrid biomes, DataContext context, int platX, int platZ) {

    // look around
    SurroundingLots neighbors = new SurroundingLots(platmap, platX, platZ);
   
    // starting with the bottom
    int lowestY = getBottomY(generator);
    int highestY = generator.streetLevel - groundDepth - 1;
   
    // cistern?
    if (generator.settings.includeCisterns) {
      chunk.setLayer(lowestY, cisternMaterial);
     
      // fill with water
      lowestY++;
      if (generator.settings.includeAbovegroundFluids)
        chunk.setBlocks(0, chunk.width, lowestY, lowestY + waterDepth, 0, chunk.width, generator.oreProvider.fluidMaterial);
     
      // clear out the rest
      chunk.setBlocks(0, chunk.width, lowestY + waterDepth, highestY + 1, 0, chunk.width, getAirMaterial(generator, lowestY + waterDepth));
     
      // outer columns and walls as needed
      if (neighbors.toNorth()) {
        chunk.setBlocks(3, 5, lowestY, highestY, 0, 1, cisternMaterial);
        chunk.setBlocks(11, 13, lowestY, highestY, 0, 1, cisternMaterial);
      } else
        chunk.setBlocks(0, 16, lowestY, highestY + 1, 0, 1, cisternMaterial);
      if (neighbors.toSouth()) {
        chunk.setBlocks(3, 5, lowestY, highestY, 15, 16, cisternMaterial);
        chunk.setBlocks(11, 13, lowestY, highestY, 15, 16, cisternMaterial);
      } else
        chunk.setBlocks(0, 16, lowestY, highestY + 1, 15, 16, cisternMaterial);
      if (neighbors.toWest()) {
        chunk.setBlocks(0, 1, lowestY, highestY, 3, 5, cisternMaterial);
        chunk.setBlocks(0, 1, lowestY, highestY, 11, 13, cisternMaterial);
      } else
        chunk.setBlocks(0, 1, lowestY, highestY + 1, 0, 16, cisternMaterial);
      if (neighbors.toEast()) {
        chunk.setBlocks(15, 16, lowestY, highestY, 3, 5, cisternMaterial);
        chunk.setBlocks(15, 16, lowestY, highestY, 11, 13, cisternMaterial);
      } else
        chunk.setBlocks(15, 16, lowestY, highestY + 1, 0, 16, cisternMaterial);
     
      // center columns
      chunk.setBlocks(7, 9, lowestY, highestY, 3, 5, cisternMaterial);
      chunk.setBlocks(7, 9, lowestY, highestY, 11, 13, cisternMaterial);
      chunk.setBlocks(3, 5, lowestY, highestY, 7, 9, cisternMaterial);
      chunk.setBlocks(11, 13, lowestY, highestY, 7, 9, cisternMaterial);
     
      // ceiling supports
      chunk.setBlocks(3, 5, highestY, highestY + 1, 0, 16, cisternMaterial);
      chunk.setBlocks(11, 13, highestY, highestY + 1, 0, 16, cisternMaterial);
      chunk.setBlocks(0, 16, highestY, highestY + 1, 3, 5, cisternMaterial);
      chunk.setBlocks(0, 16, highestY, highestY + 1, 11, 13, cisternMaterial);
 
      // top it off
      chunk.setLayer(highestY + 1, cisternMaterial);
    } else {
     
      // backfill with dirt
      chunk.setLayer(lowestY, highestY + 2 - lowestY, generator.oreProvider.subsurfaceMaterial);
    }
   
    // top it off
    chunk.setLayer(highestY + 2, generator.oreProvider.subsurfaceMaterial);
    chunk.setLayer(highestY + 3, generator.oreProvider.surfaceMaterial);
   
    // surface features
    int surfaceY = generator.streetLevel + 1;
    if (!neighbors.toNorth() && HeightInfo.isBuildableToNorth(generator, chunk)) {
      chunk.setBlocks(0, 6, surfaceY, surfaceY + 1, 0, 1, columnMaterial);
      chunk.setBlocks(0, 6, surfaceY + 1, surfaceY + 2, 0, 1, fenceMaterial);
      chunk.setBlocks(10, 16, surfaceY, surfaceY + 1, 0, 1, columnMaterial);
      chunk.setBlocks(10, 16, surfaceY + 1, surfaceY + 2, 0, 1, fenceMaterial);
      chunk.setBlocks(6, surfaceY, surfaceY + 2, 0, columnMaterial);
      chunk.setBlocks(7, 9, surfaceY, surfaceY + 1, 0, 1, stepMaterial);
      chunk.setBlocks(9, surfaceY, surfaceY + 2, 0, columnMaterial);
      chunk.setBlock(6, surfaceY, 1, columnMaterial);
      chunk.setBlock(9, surfaceY, 1, columnMaterial);
    }
    if (!neighbors.toSouth() && HeightInfo.isBuildableToSouth(generator, chunk)) {
      chunk.setBlocks(0, 6, surfaceY, surfaceY + 1, 15, 16, columnMaterial);
      chunk.setBlocks(0, 6, surfaceY + 1, surfaceY + 2, 15, 16, fenceMaterial);
      chunk.setBlocks(10, 16, surfaceY, surfaceY + 1, 15, 16, columnMaterial);
      chunk.setBlocks(10, 16, surfaceY + 1, surfaceY + 2, 15, 16, fenceMaterial);
      chunk.setBlocks(6, surfaceY, surfaceY + 2, 15, columnMaterial);
      chunk.setBlocks(7, 9, surfaceY, surfaceY + 1, 15, 16, stepMaterial);
      chunk.setBlocks(9, surfaceY, surfaceY + 2, 15, columnMaterial);
      chunk.setBlock(6, surfaceY, 14, columnMaterial);
      chunk.setBlock(9, surfaceY, 14, columnMaterial);
    }
    if (!neighbors.toWest() && HeightInfo.isBuildableToWest(generator, chunk)) {
      chunk.setBlocks(0, 1, surfaceY, surfaceY + 1, 0, 6, columnMaterial);
      chunk.setBlocks(0, 1, surfaceY + 1, surfaceY + 2, 0, 6, fenceMaterial);
      chunk.setBlocks(0, 1, surfaceY, surfaceY + 1, 10, 16, columnMaterial);
      chunk.setBlocks(0, 1, surfaceY + 1, surfaceY + 2, 10, 16, fenceMaterial);
      chunk.setBlocks(0, surfaceY, surfaceY + 2, 6, columnMaterial);
      chunk.setBlocks(0, 1, surfaceY, surfaceY + 1, 7, 9, stepMaterial);
      chunk.setBlocks(0, surfaceY, surfaceY + 2, 9, columnMaterial);
      chunk.setBlock(1, surfaceY, 6, columnMaterial);
      chunk.setBlock(1, surfaceY, 9, columnMaterial);
    }
    if (!neighbors.toEast() && HeightInfo.isBuildableToEast(generator, chunk)) {
      chunk.setBlocks(15, 16, surfaceY, surfaceY + 1, 0, 6, columnMaterial);
      chunk.setBlocks(15, 16, surfaceY + 1, surfaceY + 2, 0, 6, fenceMaterial);
      chunk.setBlocks(15, 16, surfaceY, surfaceY + 1, 10, 16, columnMaterial);
      chunk.setBlocks(15, 16, surfaceY + 1, surfaceY + 2, 10, 16, fenceMaterial);
      chunk.setBlocks(15, surfaceY, surfaceY + 2, 6, columnMaterial);
View Full Code Here

  protected void generateActualBlocks(WorldGenerator generator, PlatMap platmap, RealChunk chunk, DataContext context, int platX, int platZ) {
    int surfaceY = generator.streetLevel + 1;
   
    // way down?
    if (generator.settings.includeCisterns) {
      SurroundingLots neighbors = new SurroundingLots(platmap, platX, platZ);
      if (!neighbors.toNorth() && HeightInfo.isBuildableToNorth(generator, chunk)) {
        int lowestY = generator.streetLevel - cisternDepth + 1 + waterDepth;
        chunk.setBlocks(4, 7, lowestY, lowestY + 1, 1, 2, ledgeMaterial);
        chunk.setLadder(5, lowestY + 1, surfaceY, 1, Direction.General.SOUTH);
        chunk.setTrapDoor(5, surfaceY, 1, Direction.TrapDoor.EAST);
      }
View Full Code Here

      PlatMap platmap, ByteChunk chunk, BiomeGrid biomes,
      DataContext context, int platX, int platZ) {
    int groundY = getBottomY(generator);

    // look around
    SurroundingLots neighbors = new SurroundingLots(platmap, platX, platZ);
   
    // top it off
    chunk.setLayer(groundY, 2, generator.oreProvider.subsurfaceMaterial);
//    chunk.setLayer(groundY + 1, RoadLot.pavementId);
   
View Full Code Here

      PlatMap platmap, RealChunk chunk, DataContext context, int platX,
      int platZ) {
    int groundY = getBottomY(generator);
   
    // look around
    SurroundingLots neighbors = new SurroundingLots(platmap, platX, platZ);
   
    // shed please
    if (chunkOdds.getRandomInt(neighbors.getNeighborCount() + 2) == 0)
      generator.houseProvider.generateShed(generator, chunk, context, chunkOdds, 7, groundY + 2, 7, 2 + chunkOdds.getRandomInt(2));

    // it looked so nice for a moment... but the moment has passed
    if (generator.settings.includeDecayedBuildings)
      destroyLot(generator, groundY, groundY + 4);
View Full Code Here

TOP

Related Classes of me.daddychurchill.CityWorld.Support.SurroundingLots

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.