Search in sources :

Example 16 with IClimateState

use of forestry.api.climate.IClimateState in project Binnie by ForestryMC.

the class GardeningManager method getBiomeMoisture.

@Override
public float getBiomeMoisture(World world, BlockPos pos) {
    IClimateState info = ForestryAPI.climateManager.getClimateState(world, pos);
    double humidity = info.getHumidity();
    double temperature = info.getTemperature();
    double moisture = 3.2 * (humidity - 0.5) - 0.4 * (1.0 + temperature + 0.5 * temperature * temperature) + 1.1 - 1.6 * (temperature - 0.9) * (temperature - 0.9) - 0.002 * (pos.getY() - 64);
    return (float) ((moisture == 0.0) ? moisture : ((moisture < 0.0) ? (-Math.sqrt(moisture * moisture)) : Math.sqrt(moisture * moisture)));
}
Also used : IClimateState(forestry.api.climate.IClimateState)

Aggregations

IClimateState (forestry.api.climate.IClimateState)16 IClimateContainer (forestry.greenhouse.api.climate.IClimateContainer)4 BlockPos (net.minecraft.util.math.BlockPos)4 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 IGreenhouseBlock (forestry.greenhouse.api.greenhouse.IGreenhouseBlock)2 IGreenhouseControllerInternal (forestry.greenhouse.multiblock.IGreenhouseControllerInternal)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 IGreenhouseComponent (forestry.api.multiblock.IGreenhouseComponent)1 IColoredBlock (forestry.core.blocks.IColoredBlock)1 PacketUpdateClimate (forestry.core.network.packets.PacketUpdateClimate)1 IClimateModifier (forestry.greenhouse.api.climate.IClimateModifier)1 IClimateSource (forestry.greenhouse.api.climate.IClimateSource)1 IGreenhouseClimateManager (forestry.greenhouse.api.climate.IGreenhouseClimateManager)1 IGreenhouseProvider (forestry.greenhouse.api.greenhouse.IGreenhouseProvider)1 GuiGreenhouse (forestry.greenhouse.gui.GuiGreenhouse)1 PacketSelectClimateTargeted (forestry.greenhouse.network.packets.PacketSelectClimateTargeted)1 Block (net.minecraft.block.Block)1 IBlockState (net.minecraft.block.state.IBlockState)1 BlockColors (net.minecraft.client.renderer.color.BlockColors)1 ItemStack (net.minecraft.item.ItemStack)1