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;
}
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;
}
Aggregations