コード例 #1
0
 @Override
 public ChunkPosition findClosestStructure(World world, String s, int i, int j, int k) {
   if ("Stronghold".equals(s) && strongholdGenerator != null) {
     return strongholdGenerator.getNearestInstance(world, i, j, k);
   } else {
     return null;
   }
 }
コード例 #2
0
 @Override
 protected void generateStructures(int i, int j, byte abyte0[]) {
   if (mapFeaturesEnabled) {
     if (ODNBXlite.Structures[0]) {
       ravineGenerator.generate(this, worldObj, i, j, abyte0);
     }
     if (ODNBXlite.Structures[3]) {
       mineshaftGenerator.generate(this, worldObj, i, j, abyte0);
     }
     if (ODNBXlite.Structures[1]) {
       villageGenerator.generate(this, worldObj, i, j, abyte0);
     }
     if (ODNBXlite.Structures[2]) {
       strongholdGenerator.generate(this, worldObj, i, j, abyte0);
     }
   }
 }
コード例 #3
0
  @Override
  public void populate(IChunkProvider ichunkprovider, int x, int z) {
    rand.setSeed((long) x * 0x12f88dd3L + (long) z * 0x36d41eecL);
    int x1 = x << 4;
    int z1 = z << 4;
    if (mapFeaturesEnabled) {
      if (ODNBXlite.Structures[2]) {
        strongholdGenerator.generateStructuresInChunk(worldObj, rand, x, z);
      }
      if (ODNBXlite.Structures[1]) {
        villageGenerator.generateStructuresInChunk(worldObj, rand, x, z);
      }
      if (ODNBXlite.Structures[3]) {
        mineshaftGenerator.generateStructuresInChunk(worldObj, rand, x, z);
      }
    }
    for (int i = 0; i < 20; i++) {
      int x2 = x1 + rand.nextInt(16);
      int y2 = rand.nextInt(128);
      int z2 = z1 + rand.nextInt(16);
      (new SuperOldWorldGenMinable(Block.oreCoal.blockID))
          .generate_infdev(worldObj, rand, x2, y2, z2);
    }

    for (int i = 0; i < 10; i++) {
      int x2 = x1 + rand.nextInt(16);
      int y2 = rand.nextInt(64);
      int z2 = z1 + rand.nextInt(16);
      (new SuperOldWorldGenMinable(Block.oreIron.blockID))
          .generate_infdev(worldObj, rand, x2, y2, z2);
    }

    if (rand.nextInt(2) == 0) {
      int x2 = x1 + rand.nextInt(16);
      int y2 = rand.nextInt(32);
      int z2 = z1 + rand.nextInt(16);
      (new SuperOldWorldGenMinable(Block.oreGold.blockID))
          .generate_infdev(worldObj, rand, x2, y2, z2);
    }
    if (rand.nextInt(8) == 0) {
      int x2 = x1 + rand.nextInt(16);
      int y2 = rand.nextInt(16);
      int z2 = z1 + rand.nextInt(16);
      (new SuperOldWorldGenMinable(Block.oreDiamond.blockID))
          .generate_infdev(worldObj, rand, x2, y2, z2);
    }
    if (ODNBXlite.getFlag("newores")) {
      for (int i = 0; i < 8; i++) {
        int x2 = x1 + rand.nextInt(16);
        int y2 = rand.nextInt(16);
        int z2 = z1 + rand.nextInt(16);
        (new SuperOldWorldGenMinable(Block.oreRedstone.blockID))
            .generate_infdev(worldObj, rand, x2, y2, z2);
      }
      for (int i = 0; i < 1; i++) {
        int x2 = x1 + rand.nextInt(16);
        int y2 = rand.nextInt(16) + rand.nextInt(16);
        int z2 = z1 + rand.nextInt(16);
        (new SuperOldWorldGenMinable(Block.oreLapis.blockID))
            .generate_infdev(worldObj, rand, x2, y2, z2);
      }
      int max = 0;
      detection:
      for (int i = x1; i < x1 + 16; i++) {
        for (int j = z1; j < z1 + 16; j++) {
          int h = worldObj.getPrecipitationHeight(i, j);
          if (max < h) {
            max = h;
          }
          if (max > 108) {
            break detection;
          }
        }
      }
      if (max > 108) {
        for (int i = 0; i < 3 + rand.nextInt(6); i++) {
          int x2 = x1 + rand.nextInt(16);
          int y2 = rand.nextInt(28) + 4;
          int z2 = z1 + rand.nextInt(16);
          int id = worldObj.getBlockId(x2, y2, z2);
          if (id == Block.stone.blockID) {
            worldObj.setBlock(x2, y2, z2, Block.oreEmerald.blockID);
          }
        }
      }
    }
    int trees =
        (int)
            (treeGen.func_806_a(
                    (double) x1 * 0.050000000000000003D, (double) z1 * 0.050000000000000003D)
                - rand.nextDouble());
    if (trees < 0) {
      trees = 0;
    }
    WorldGenerator treegen =
        ODNBXlite.MapFeatures == ODNBXlite.FEATURES_INFDEV0608
            ? new OldWorldGenTrees(false)
            : new OldWorldGenBigTree();
    if (rand.nextInt(100) == 0) {
      trees++;
    }
    if (ODNBXlite.MapTheme == ODNBXlite.THEME_WOODS) {
      trees += 20;
    }
    for (int i = 0; i < trees; i++) {
      int x2 = x1 + rand.nextInt(16) + 8;
      int z2 = z1 + rand.nextInt(16) + 8;
      treegen.setScale(1.0D, 1.0D, 1.0D);
      treegen.generate(worldObj, rand, x2, worldObj.getHeightValue(x2, z2), z2);
    }
    spawnAnimals(x * 16, z * 16);
  }