Search in sources :

Example 1 with TileGreenhousePlain

use of forestry.greenhouse.tiles.TileGreenhousePlain in project ForestryMC by ForestryMC.

the class GreenhouseController method isGoodForExteriorLevel.

/* RectangularMultiblockControllerBase */
@Override
public void isGoodForExteriorLevel(IMultiblockComponent part, int level) throws MultiblockValidationException {
    int maxLevel = getMaximumCoord().getY() - getMinimumCoord().getY();
    if (level == maxLevel && !(part instanceof TileGreenhousePlain)) {
        throw new MultiblockValidationException(Translator.translateToLocal("for.multiblock.greenhouse.error.needPlainOnTop"));
    }
    IGreenhouseBlock logicBlock = GreenhouseBlockManager.getInstance().getBlock(world, part.getCoordinates());
    if (logicBlock != null && logicBlock.getProvider() != getProvider()) {
        throw new MultiblockValidationException(Translator.translateToLocal("for.multiblock.greenhouse.error.needSpace"));
    }
}
Also used : TileGreenhousePlain(forestry.greenhouse.tiles.TileGreenhousePlain) MultiblockValidationException(forestry.core.multiblock.MultiblockValidationException) IGreenhouseBlock(forestry.greenhouse.api.greenhouse.IGreenhouseBlock)

Aggregations

MultiblockValidationException (forestry.core.multiblock.MultiblockValidationException)1 IGreenhouseBlock (forestry.greenhouse.api.greenhouse.IGreenhouseBlock)1 TileGreenhousePlain (forestry.greenhouse.tiles.TileGreenhousePlain)1