Search in sources :

Example 1 with IGreenhouseProviderListener

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

the class WallBlockHandler method onCheckPosition.

@Override
public boolean onCheckPosition(IGreenhouseBlockStorage storage, IBlankBlock rootBlock, BlockPos position, EnumFacing facing, IGreenhouseBlock block, List<IGreenhouseBlock> newBlocksToCheck) {
    IGreenhouseProvider provider = storage.getProvider();
    if (block == null && isValidWallBlock(provider.getWorld(), position)) {
        for (IGreenhouseProviderListener listener : provider.getListeners()) {
            listener.onCheckPosition(position);
        }
        IWallBlock wallBlock = createBlock(storage, rootBlock, facing, position);
        storage.setBlock(position, wallBlock);
        rootBlock.setFaceTested(facing, true);
        rootBlock.setNearWall(true);
        return true;
    }
    return false;
}
Also used : IGreenhouseProviderListener(forestry.greenhouse.api.greenhouse.IGreenhouseProviderListener) IGreenhouseProvider(forestry.greenhouse.api.greenhouse.IGreenhouseProvider) IWallBlock(forestry.greenhouse.api.greenhouse.IWallBlock)

Aggregations

IGreenhouseProvider (forestry.greenhouse.api.greenhouse.IGreenhouseProvider)1 IGreenhouseProviderListener (forestry.greenhouse.api.greenhouse.IGreenhouseProviderListener)1 IWallBlock (forestry.greenhouse.api.greenhouse.IWallBlock)1