Advertisement
TTFTCUTS

Biome dictionary best guess 2.0

Jun 30th, 2014
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.85 KB | None | 0 0
  1.     public static void makeBestGuess(BiomeGenBase biome)
  2.     {    
  3.         if(biome.theBiomeDecorator.treesPerChunk >= 3)
  4.         {
  5.             if(biome.isHighHumidity() && biome.temperature >= 0.9F)
  6.             {
  7.                 BiomeDictionary.registerBiomeType(biome, JUNGLE);
  8.             }
  9.             else if(!biome.isHighHumidity())
  10.             {
  11.                 BiomeDictionary.registerBiomeType(biome, FOREST);
  12.  
  13.         if (biome.temperature <= 0.2f) {
  14.             BiomeDictionary.registerBiomeType(biome, CONIFEROUS);
  15.         }
  16.             }
  17.         }
  18.         else if(biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F)
  19.         {
  20.             if(!biome.isHighHumidity() || biome.rootHeight >= 0.0F)
  21.             {
  22.                 BiomeDictionary.registerBiomeType(biome, PLAINS);
  23.             }
  24.         }
  25.  
  26.  
  27.     // WET
  28.     if(biome.rainfall > 0.85f)
  29.     {
  30.         BiomeDictionary.registerBiomeType(biome, WET);
  31.     }
  32.  
  33.     // DRY
  34.     if(biome.rainfall < 0.15f)
  35.     {
  36.         BiomeDictionary.registerBiomeType(biome, DRY);
  37.     }
  38.  
  39.     // HOT
  40.     if(biome.temperature > 0.85f)
  41.     {
  42.         BiomeDictionary.registerBiomeType(biome, HOT);
  43.     }
  44.  
  45.     // COLD
  46.     if(biome.temperature < 0.15f)
  47.     {
  48.         BiomeDictionary.registerBiomeType(biome, COLD);
  49.     }
  50.  
  51.     // DENSE/SPARSE
  52.     if(biome.theBiomeDecorator.treesPerChunk > 0 && biome.theBiomeDecorator.treesPerChunk < 3)
  53.     {
  54.         BiomeDictionary.registerBiomeType(biome, SPARSE);
  55.     }
  56.     else if(biome.theBiomeDecorator.treesPerChunk >= 10)
  57.     {
  58.         BiomeDictionary.registerBiomeType(biome, DENSE);
  59.     }
  60.    
  61.     // SWAMP
  62.         if(biome.isHighHumidity() && biome.rootHeight < 0.0F && (biome.heightVariation <= 0.3F && biome.heightVariation >= 0.0F))
  63.         {
  64.             BiomeDictionary.registerBiomeType(biome, SWAMP);
  65.         }
  66.  
  67.     // WATER
  68.         if(biome.rootHeight <= -0.5F)
  69.         {
  70.             BiomeDictionary.registerBiomeType(biome, WATER);
  71.         }
  72.  
  73.     // HILLS
  74.     if(biome.heightVariation >= 0.4F && biome.heightVariation < 1.5F)
  75.         {
  76.             BiomeDictionary.registerBiomeType(biome, HILLS);
  77.         }
  78.  
  79.     // MOUNTAIN
  80.         if(biome.heightVariation >= 1.5F)
  81.         {
  82.             BiomeDictionary.registerBiomeType(biome, MOUNTAIN);
  83.         }
  84.        
  85.     // SNOWY
  86.         if(biome.getEnableSnow())
  87.         {
  88.             BiomeDictionary.registerBiomeType(biome, SNOWY);
  89.         }
  90.  
  91.     // SAVANNA
  92.     if(biome.topBlock != Blocks.sand && biome.temperature >= 1.0f && biome.rainfall < 0.2f)
  93.         {
  94.             BiomeDictionary.registerBiomeType(biome, SAVANNA);
  95.         }
  96.        
  97.     // SANDY / MESA / MUSHROOM
  98.         if(biome.topBlock == Blocks.sand )
  99.         {
  100.             BiomeDictionary.registerBiomeType(biome, SANDY);
  101.         }
  102.     else if(biome.topBlock == Blocks.hardened_clay)
  103.     {
  104.         BiomeDictionary.registerBiomeType(biome, MESA);
  105.     }
  106.     else if(biome.topBlock == Blocks.mycelium)
  107.     {
  108.         BiomeDictionary.registerBiomeType(biome, MUSHROOM);
  109.     }
  110.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement