Beispiel #1
0
  private void setupBiomeMapping() {
    biomeMapping.clear();
    if (controllerType == ControllerType.CONTROLLER_FILTERED) {
      BiomeGenBase[] biomeGenArray = BiomeGenBase.getBiomeGenArray();
      final Set<Integer> ids = new HashSet<Integer>();
      for (BiomeGenBase biome : biomes) {
        if (biome != null) {
          ids.add(biome.biomeID);
        } else {
          ids.add(BiomeGenBase.plains.biomeID);
        }
      }

      ControllerType.BiomeFilter biomeFilter =
          new ControllerType.BiomeFilter() {
            @Override
            public boolean match(BiomeGenBase biome) {
              return ids.contains(biome.biomeID);
            }

            @Override
            public double calculateBiomeDistance(BiomeGenBase a, BiomeGenBase b) {
              return calculateBiomeDistance(a, b, false, false, false);
            }
          };
      BiomeControllerMapping.makeFilteredBiomeMap(biomeGenArray, biomeMapping, biomeFilter);
    }
  }
Beispiel #2
0
 public Map<Integer, Integer> getBiomeMapping() {
   if (biomeMapping.isEmpty()) {
     setupBiomeMapping();
   }
   return biomeMapping;
 }