Search in sources :

Example 6 with IClimateContainer

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

the class WallBlock method onCreate.

@Override
public void onCreate() {
    IClimateContainer container = provider.getClimateContainer();
    for (IClimateSourceOwner sourceOwner : GreenhouseManager.climateManager.getSources(provider.getWorld(), new Position2D(pos))) {
        IClimateSource source = sourceOwner.getClimateSource();
        sources.add(source);
        container.addClimateSource(source);
        source.onAdded(container);
    }
}
Also used : IClimateSourceOwner(forestry.greenhouse.api.climate.IClimateSourceOwner) IClimateContainer(forestry.greenhouse.api.climate.IClimateContainer) Position2D(forestry.greenhouse.api.greenhouse.Position2D) IClimateSource(forestry.greenhouse.api.climate.IClimateSource)

Example 7 with IClimateContainer

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

the class WallBlock method onRemove.

@Override
public void onRemove() {
    IClimateContainer container = provider.getClimateContainer();
    Iterator<IClimateSource> iterator = sources.iterator();
    while (iterator.hasNext()) {
        IClimateSource source = iterator.next();
        source.onRemoved(container);
        container.removeClimateSource(source);
        iterator.remove();
    }
}
Also used : IClimateContainer(forestry.greenhouse.api.climate.IClimateContainer) IClimateSource(forestry.greenhouse.api.climate.IClimateSource)

Aggregations

IClimateContainer (forestry.greenhouse.api.climate.IClimateContainer)7 IClimateState (forestry.api.climate.IClimateState)4 IClimateSource (forestry.greenhouse.api.climate.IClimateSource)2 IGreenhouseBlock (forestry.greenhouse.api.greenhouse.IGreenhouseBlock)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 IClimateHousing (forestry.api.greenhouse.IClimateHousing)1 IGreenhouseComponent (forestry.api.multiblock.IGreenhouseComponent)1 IColoredBlock (forestry.core.blocks.IColoredBlock)1 IClimateSourceOwner (forestry.greenhouse.api.climate.IClimateSourceOwner)1 IGreenhouseClimateManager (forestry.greenhouse.api.climate.IGreenhouseClimateManager)1 IGreenhouseProvider (forestry.greenhouse.api.greenhouse.IGreenhouseProvider)1 Position2D (forestry.greenhouse.api.greenhouse.Position2D)1 IGreenhouseControllerInternal (forestry.greenhouse.multiblock.IGreenhouseControllerInternal)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 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1