package org.pfaa.chemica.model;

public class Condition {
	public double temperature;
	public double pressure;
	
	public Condition(double temperature, double pressure) {
		super();
		this.temperature = temperature;
		this.pressure = pressure;
	}
	
	public static Condition STP = new Condition(Constants.STANDARD_TEMPERATURE, Constants.STANDARD_PRESSURE);
}

@@ -26,16 +26,139 @@
 model;%0A%0A
+import net.minecraft.world.EnumSkyBlock;%0Aimport net.minecraft.world.World;%0Aimport net.minecraft.world.biome.BiomeGenBase;%0A%0A
 public c
@@ -364,16 +364,1348 @@
 e;%0A%09%7D%0A%09%0A
+%09public static Condition ofWorldCoordinates(World world, int x, int y, int z) %7B%0A%09%09double temperature = getTemperatureAt(world, x, y, z);%0A%09%09%0A%09%09double pressure = getPressureAt(world, x, y, z);%0A%09%09return new Condition(temperature, pressure);%0A%09%7D%0A%09%0A%09private static double getPressureAt(World world, int x, int y, int z) %7B%0A%09%09int sealevel = world.provider.hasNoSky ? world.provider.getActualHeight() : %0A%09%09%09world.provider.getAverageGroundLevel();%0A%09%09return Constants.STANDARD_PRESSURE - %0A%09%09%09%09(y - sealevel) * (2/3) * Constants.STANDARD_PRESSURE / %0A%09%09%09%09                 (world.provider.getHeight() - sealevel);%0A%09%7D%0A%0A%09private static float getTemperatureAt(World world, int x, int y, int z) %7B%0A%09%09BiomeGenBase biomegenbase = world.getBiomeGenForCoords(x, z);%0A%09%09float biometemp = biomegenbase.getFloatTemperature(x, y, z);%0A%09%09double temperature = (biometemp - 0.15F) * 45 / (2.0F - 0.15F);%0A%09%09boolean isHeated = world.getSavedLightValue(EnumSkyBlock.Block, x, y, z) == 10;%0A%09%09if (isHeated) %7B%0A%09%09%09temperature = Math.max(temperature, Constants.STANDARD_TEMPERATURE);%0A%09%09%7D%0A%09%09// TODO: if near fire, we are %3E=100C; if near a fluid, we consider its temperature somehow. %0A%09%09// But how to determine %22near%22 3x3? But should we allow for heat insulation somehow? %0A%09%09// Maybe if surrounded by insulating blocks (or the same fluid)? %0A%09%09return (float)temperature;%0A%09%7D%0A%0A
 %09public 

add helpers for getting conditions at specific world coordinate (biome/height dependent); not sure if this will ever be used