Ejemplo n.º 1
0
  @Override
  public void applyToWorld(World w, int leftBoundary, int rightBoundary) {
    int surf = 0, x = leftBoundary + (rightBoundary - leftBoundary) / 2;
    // find surface
    while (w.getTerrainAt(x, surf) == World.AIR) {
      surf++;
    }

    makeSpawnShop(w, x, surf);
    int center = leftBoundary + (rightBoundary - leftBoundary) / 2;

    for (int i = center - 25; i < center + 25; i++) {
      for (int y = surf - 10; y > 0; y--) {
        w.setTerrainAt(i, y, World.AIR);
      }
    }

    for (int i = leftBoundary; i < rightBoundary; i++) {
      for (int y = (int) (0.2F * w.getHeight()); y < w.getHeight() * mineDepth; y++) {
        if (w.getTerrainAt(i, y) == World.AIR && w.getSeed().nextDouble() <= 0.1) {
          w.setTerrainAt(i, y, World.TORCH);
        }
      }
    }
  }