Search in sources :

Example 1 with IWallBlock

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

the class WallBlockHandler method createBlock.

@Override
public IWallBlock createBlock(IGreenhouseBlockStorage storage, @Nullable IBlankBlock root, @Nullable EnumFacing rootFacing, @Nullable BlockPos position) {
    IWallBlock wallBlock = new WallBlock(storage.getProvider(), position);
    wallBlock.setRoot(root);
    wallBlock.setRootFace(rootFacing);
    wallBlock.onCreate();
    return wallBlock;
}
Also used : IWallBlock(forestry.greenhouse.api.greenhouse.IWallBlock) IWallBlock(forestry.greenhouse.api.greenhouse.IWallBlock)

Example 2 with IWallBlock

use of forestry.greenhouse.api.greenhouse.IWallBlock 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

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