Search in sources :

Example 1 with TileFarmGearbox

use of forestry.farming.tiles.TileFarmGearbox in project ForestryMC by ForestryMC.

the class FarmController method isMachineWhole.

@Override
protected void isMachineWhole() throws MultiblockValidationException {
    super.isMachineWhole();
    boolean hasGearbox = false;
    for (IMultiblockComponent part : connectedParts) {
        if (part instanceof TileFarmGearbox) {
            hasGearbox = true;
            break;
        }
    }
    if (!hasGearbox) {
        throw new MultiblockValidationException(Translator.translateToLocal("for.multiblock.farm.error.needGearbox"));
    }
}
Also used : TileFarmGearbox(forestry.farming.tiles.TileFarmGearbox) IMultiblockComponent(forestry.api.multiblock.IMultiblockComponent) MultiblockValidationException(forestry.core.multiblock.MultiblockValidationException)

Aggregations

IMultiblockComponent (forestry.api.multiblock.IMultiblockComponent)1 MultiblockValidationException (forestry.core.multiblock.MultiblockValidationException)1 TileFarmGearbox (forestry.farming.tiles.TileFarmGearbox)1