Search in sources :

Example 1 with IFarmHousing

use of forestry.api.farming.IFarmHousing in project ForestryMC by ForestryMC.

the class CircuitFarmLogic method onInsertion.

@Override
public void onInsertion(int slot, Object tile) {
    IFarmHousing housing = getCircuitable(tile);
    if (housing == null) {
        return;
    }
    logic.setManual(isManual);
    housing.setFarmLogic(FarmDirection.values()[slot], logic);
}
Also used : IFarmHousing(forestry.api.farming.IFarmHousing)

Example 2 with IFarmHousing

use of forestry.api.farming.IFarmHousing in project Binnie by ForestryMC.

the class CircuitGarden method onRemoval.

@Override
public void onRemoval(int slot, Object tile) {
    IFarmHousing farmHousing = getCircuitable(tile);
    if (farmHousing == null) {
        return;
    }
    farmHousing.resetFarmLogic(FarmDirection.values()[slot]);
}
Also used : IFarmHousing(forestry.api.farming.IFarmHousing)

Example 3 with IFarmHousing

use of forestry.api.farming.IFarmHousing in project Binnie by ForestryMC.

the class CircuitGarden method onInsertion.

@Override
public void onInsertion(int slot, Object tile) {
    IFarmHousing housing = getCircuitable(tile);
    if (housing == null) {
        return;
    }
    logic.setManual(isManual);
    housing.setFarmLogic(FarmDirection.values()[slot], logic);
}
Also used : IFarmHousing(forestry.api.farming.IFarmHousing)

Example 4 with IFarmHousing

use of forestry.api.farming.IFarmHousing in project PneumaticCraft by MineMaarten.

the class FarmLogicPlasticNormal method getFarmLogic.

@Override
protected IFarmLogic getFarmLogic(IFarmHousing housing) throws Throwable {
    ArrayList<IFarmable> origList = (ArrayList<IFarmable>) Farmables.farmables.get("farmVegetables");
    ArrayList<IFarmable> backup = new ArrayList<IFarmable>(origList);
    origList.clear();
    origList.add(new FarmablePlastic(getBlock()));
    IFarmLogic logic = getLogicClass("FarmLogicVegetable").getConstructor(IFarmHousing.class).newInstance(housing);
    origList.clear();
    origList.addAll(backup);
    return logic;
}
Also used : IFarmable(forestry.api.farming.IFarmable) IFarmHousing(forestry.api.farming.IFarmHousing) ArrayList(java.util.ArrayList) IFarmLogic(forestry.api.farming.IFarmLogic)

Example 5 with IFarmHousing

use of forestry.api.farming.IFarmHousing in project ForestryMC by ForestryMC.

the class CircuitFarmLogic method onRemoval.

@Override
public void onRemoval(int slot, Object tile) {
    IFarmHousing farmHousing = getCircuitable(tile);
    if (farmHousing == null) {
        return;
    }
    farmHousing.resetFarmLogic(FarmDirection.values()[slot]);
}
Also used : IFarmHousing(forestry.api.farming.IFarmHousing)

Aggregations

IFarmHousing (forestry.api.farming.IFarmHousing)5 IFarmLogic (forestry.api.farming.IFarmLogic)1 IFarmable (forestry.api.farming.IFarmable)1 ArrayList (java.util.ArrayList)1