Search in sources :

Example 1 with IGreenhouseClimateManager

use of forestry.greenhouse.api.climate.IGreenhouseClimateManager in project ForestryMC by ForestryMC.

the class ClimateWorldManager method getClimateState.

public IClimateState getClimateState(World world, BlockPos pos) {
    IClimateState cacheState = stateCache.getIfPresent(pos);
    if (cacheState == null) {
        IGreenhouseClimateManager climateSourceManager = GreenhouseManager.climateManager;
        if (climateSourceManager != null) {
            IClimateContainer container = climateSourceManager.getContainer(world, pos);
            if (container != null) {
                cacheState = container.getState();
            }
        }
        if (cacheState == null) {
            cacheState = parent.getBiomeState(world, pos);
        }
        stateCache.put(pos, cacheState);
    }
    return cacheState;
}
Also used : IClimateContainer(forestry.greenhouse.api.climate.IClimateContainer) IClimateState(forestry.api.climate.IClimateState) IGreenhouseClimateManager(forestry.greenhouse.api.climate.IGreenhouseClimateManager)

Example 2 with IGreenhouseClimateManager

use of forestry.greenhouse.api.climate.IGreenhouseClimateManager in project ForestryMC by ForestryMC.

the class ModuleGreenhouse method doInit.

@Override
public void doInit() {
    IGreenhouseHelper helper = GreenhouseManager.helper;
    GameRegistry.registerTileEntity(TileGreenhousePlain.class, "forestry.GreenhousePlain");
    GameRegistry.registerTileEntity(TileHygroregulator.class, "forestry.ClimateSourceHygroregulator");
    GameRegistry.registerTileEntity(TileGreenhouseGearbox.class, "forestry.GreenhouseGearbox");
    GameRegistry.registerTileEntity(TileGreenhouseControl.class, "forestry.GreenhouseController");
    GameRegistry.registerTileEntity(TileGreenhouseWindow.class, "forestry.ClimateSourceWindow");
    GameRegistry.registerTileEntity(TileFan.class, "forestry.GreenhouseFan");
    GameRegistry.registerTileEntity(TileHeater.class, "forestry.GreenhouseHeater");
    GameRegistry.registerTileEntity(TileDehumidifier.class, "forestry.GreenhouseDryer");
    GameRegistry.registerTileEntity(TileHumidifier.class, "forestry.GreenhouseSprinkler");
    helper.registerWindowGlass("glass", new ItemStack(Blocks.GLASS), "blocks/glass");
    for (EnumDyeColor dye : EnumDyeColor.values()) {
        helper.registerWindowGlass("glass" + dye.getName(), new ItemStack(Blocks.STAINED_GLASS, 1, dye.getMetadata()), "blocks/glass_" + dye.getName());
    }
    IGreenhouseClimateManager climateSourceManager = GreenhouseClimateManager.getInstance();
    climateSourceManager.registerModifier(new WeatherModifier());
    climateSourceManager.registerModifier(new TimeModifier());
    climateSourceManager.registerModifier(new AltitudeModifier());
    climateSourceManager.registerModifier(new ClimateSourceModifier());
    Circuits.climatiserTemperature1 = new CircuitClimateSource("climatiser.temperature.1", ClimateType.TEMPERATURE, 0.125F, 0.125F, 0.25F);
    Circuits.climatiserTemperature2 = new CircuitClimateSource("climatiser.temperature.2", ClimateType.TEMPERATURE, 0.25F, 0.25F, 0.5F);
    Circuits.climatiserHumidity1 = new CircuitClimateSource("climatiser.humidity.1", ClimateType.HUMIDITY, 0.125F, 0.125F, 0.25F);
    Circuits.climatiserHumidity2 = new CircuitClimateSource("climatiser.humidity.2", ClimateType.HUMIDITY, 0.25F, 0.25F, 0.5F);
    proxy.inti();
}
Also used : IGreenhouseHelper(forestry.greenhouse.api.greenhouse.IGreenhouseHelper) TimeModifier(forestry.greenhouse.climate.modifiers.TimeModifier) ClimateSourceModifier(forestry.greenhouse.climate.modifiers.ClimateSourceModifier) WeatherModifier(forestry.greenhouse.climate.modifiers.WeatherModifier) CircuitClimateSource(forestry.greenhouse.circuits.CircuitClimateSource) ItemStack(net.minecraft.item.ItemStack) EnumDyeColor(net.minecraft.item.EnumDyeColor) IGreenhouseClimateManager(forestry.greenhouse.api.climate.IGreenhouseClimateManager) AltitudeModifier(forestry.greenhouse.climate.modifiers.AltitudeModifier)

Aggregations

IGreenhouseClimateManager (forestry.greenhouse.api.climate.IGreenhouseClimateManager)2 IClimateState (forestry.api.climate.IClimateState)1 IClimateContainer (forestry.greenhouse.api.climate.IClimateContainer)1 IGreenhouseHelper (forestry.greenhouse.api.greenhouse.IGreenhouseHelper)1 CircuitClimateSource (forestry.greenhouse.circuits.CircuitClimateSource)1 AltitudeModifier (forestry.greenhouse.climate.modifiers.AltitudeModifier)1 ClimateSourceModifier (forestry.greenhouse.climate.modifiers.ClimateSourceModifier)1 TimeModifier (forestry.greenhouse.climate.modifiers.TimeModifier)1 WeatherModifier (forestry.greenhouse.climate.modifiers.WeatherModifier)1 EnumDyeColor (net.minecraft.item.EnumDyeColor)1 ItemStack (net.minecraft.item.ItemStack)1