Search in sources :

Example 6 with IClimateHousing

use of forestry.api.greenhouse.IClimateHousing in project ForestryMC by ForestryMC.

the class GreenhouseProviderClient method markBlockForRenderUpdate.

public void markBlockForRenderUpdate() {
    IClimateHousing housing = container.getParent();
    if (housing instanceof IGreenhouseController) {
        IGreenhouseController controller = (IGreenhouseController) housing;
        if (!controller.isAssembled()) {
            return;
        }
        BlockPos position = controller.getCenterCoordinates();
        Position2D minEdge = limits.getMinimumCoordinates();
        Position2D maxEdge = limits.getMaximumCoordinates();
        BlockPos minPos = new BlockPos(minEdge.getX(), -limits.getDepth(), minEdge.getZ());
        BlockPos maxPos = new BlockPos(maxEdge.getX() + 1, limits.getHeight(), maxEdge.getZ() + 1);
        minPos = minPos.add(position);
        maxPos = maxPos.add(position);
        world.markBlockRangeForRenderUpdate(minPos, maxPos);
    }
}
Also used : IGreenhouseController(forestry.api.multiblock.IGreenhouseController) Position2D(forestry.greenhouse.api.greenhouse.Position2D) BlockPos(net.minecraft.util.math.BlockPos) IClimateHousing(forestry.api.greenhouse.IClimateHousing)

Aggregations

IClimateHousing (forestry.api.greenhouse.IClimateHousing)6 BlockPos (net.minecraft.util.math.BlockPos)3 EnergyManager (forestry.energy.EnergyManager)2 IGreenhouseControllerInternal (forestry.greenhouse.multiblock.IGreenhouseControllerInternal)2 IErrorLogic (forestry.api.core.IErrorLogic)1 IGreenhouseController (forestry.api.multiblock.IGreenhouseController)1 GreenhouseState (forestry.greenhouse.api.climate.GreenhouseState)1 IClimateContainer (forestry.greenhouse.api.climate.IClimateContainer)1 Position2D (forestry.greenhouse.api.greenhouse.Position2D)1 PacketGreenhouseData (forestry.greenhouse.network.packets.PacketGreenhouseData)1 World (net.minecraft.world.World)1