@Override public float getTemperature() { return this.biomeBase.getDefaultTemperature(); }
/**Get biome temperature on a scale of 0 to 1, 0 freezing and 1 boiling hot**/ public static float getBiomeTempNorm(Biome biome) { return MathHelper.clamp(biome.getDefaultTemperature(), 0.0F, 1.35F) / 1.35F; }
public boolean isCompatible(Biome biome) { return biome.getDefaultTemperature() >= minTemperature && biome.getDefaultTemperature() <= maxTemperature && biome.getRainfall() >= minRainfall && biome.getRainfall() <= maxRainfall && biome.decorator.treesPerChunk >= minTreesPerChunk && biome.decorator.treesPerChunk <= maxTreesPerChunk && biome.getHeightVariation() >= minHeightVariation && biome.getHeightVariation() <= maxHeightVariation; }
public static EnumTemperature getFromBiome(Biome biome) { if (BiomeHelper.isBiomeHellish(biome)) { return HELLISH; } return getFromValue(biome.getDefaultTemperature()); }
EnumClimate(String spriteName, Biome biome) { climateState = ClimateStateHelper.of(biome.getDefaultTemperature(), biome.getRainfall()); this.spriteName = spriteName; }
public EnumTemperature getTemperature() { return EnumTemperature.getFromValue(this.getBiome().getDefaultTemperature()); }
private static double calculateBiomeDistance(Biome a, Biome b) { if (a == b) { return -1000; } float dr = a.getRainfall() - b.getRainfall(); float dt = a.getDefaultTemperature() - b.getDefaultTemperature(); float dv = a.getHeightVariation() - b.getHeightVariation(); float dh = a.getBaseHeight() - b.getBaseHeight(); return Math.sqrt(dr * dr + dt * dt + dv * dv + dh * dh); }
@Override public EnumTemperature getTemperature() { return EnumTemperature.getFromValue(world.getBiome(getPos()).getDefaultTemperature()); }
@Override public float getChance(World world, BlockPos pos, IAlleleTreeSpecies allele0, IAlleleTreeSpecies allele1, ITreeGenome genome0, ITreeGenome genome1) { final int processedChance = this.chance; final Biome biome = world.getBiome(pos);//WorldChunkManager().getBiomeGenAt(x, z); if (biome.getDefaultTemperature() < this.minTemperature || biome.getDefaultTemperature() > this.maxTemperature) { return 0.0f; } if (biome.getRainfall() < this.minRainfall || biome.getRainfall() > this.maxRainfall) { return 0.0f; } if (this.height > 0.0f && pos.getY() < this.height) { return 0.0f; } if (this.allele0.getUID().equals(allele0.getUID()) && this.allele1.getUID().equals(allele1.getUID())) { return processedChance; } if (this.allele1.getUID().equals(allele0.getUID()) && this.allele0.getUID().equals(allele1.getUID())) { return processedChance; } return 0.0f; } }
@Override public boolean canTolerate(@Nullable IFlower flower, World world, BlockPos pos) { if (flower == null) { return false; } IBlockState soil = world.getBlockState(pos.down()); Biome biome = world.getBiome(pos); EnumAcidity acidity = soil.getValue(BlockSoil.ACIDITY); EnumMoisture moisture = soil.getValue(BlockSoil.MOISTURE); EnumTemperature temperature = EnumTemperature.getFromValue(biome.getDefaultTemperature()); return canTolerate(flower, acidity, moisture, temperature); }
e.printStackTrace(); obj.addProperty("Temperature", biome.getDefaultTemperature()); obj.addProperty("Humidity", biome.getRainfall()); obj.addProperty("Water Tint", biome.getWaterColorMultiplier());
float biomeTemp = biome.getTemperature(pos); if (!tropicalBiome && biome.getDefaultTemperature() <= 0.8F && BiomeConfig.enablesSeasonalEffects(biome))
else if (biome.getDefaultTemperature() >= 0.15F && !ModConfig.seasons.generateSnowAndIce)
else if (biome.getDefaultTemperature() >= 0.15F && !ModConfig.seasons.generateSnowAndIce)
if (!world.getBiome(height).getEnableSnow() && world.getBiome(height).getDefaultTemperature() > -0.5 && world.getBiome(height) != Biomes.ICE_PLAINS && !BiomeDictionary.hasType(world.getBiome(height), Type.SNOWY) && !BiomeDictionary.hasType(world.getBiome(height), Type.SNOWY) && !BiomeDictionary.hasType(world.getBiome(height), Type.WET) && !BiomeDictionary.hasType(world.getBiome(height), Type.OCEAN) && !BiomeDictionary.hasType(world.getBiome(height), Type.RIVER)) { if (random.nextInt((isHills ? IceAndFire.CONFIG.generateDragonRoostChance : IceAndFire.CONFIG.generateDragonRoostChance * 2) + 1) == 0) { BlockPos surface = world.getHeight(new BlockPos(x, 0, z)); if (!world.getBiome(height).getEnableSnow() && world.getBiome(height).getDefaultTemperature() > -0.5 && !BiomeDictionary.hasType(world.getBiome(height), Type.COLD) && !BiomeDictionary.hasType(world.getBiome(height), Type.SNOWY) && !BiomeDictionary.hasType(world.getBiome(height), Type.WET) && !BiomeDictionary.hasType(world.getBiome(height), Type.OCEAN) && !BiomeDictionary.hasType(world.getBiome(height), Type.RIVER) && !BiomeDictionary.hasType(world.getBiome(height), Type.BEACH)) { if (random.nextInt((isHills ? IceAndFire.CONFIG.generateDragonDenChance : IceAndFire.CONFIG.generateDragonDenChance * 2) + 1) == 0) { int newY = 20 + random.nextInt(20);