use of forestry.core.fluids.FilteredTank in project ForestryMC by ForestryMC.
the class ClimateSourceHygroregulator method removeResources.
@Override
protected void removeResources(IClimateState currentState, ClimateSourceType oppositeType) {
FilteredTank liquidTank = owner.getLiquidTank();
liquidTank.drainInternal(currentRecipe.liquid.amount, true);
}
use of forestry.core.fluids.FilteredTank in project ForestryMC by ForestryMC.
the class ClimateSourceHygroregulator method canWork.
@Override
public boolean canWork(IClimateState currentState, ClimateSourceType oppositeType) {
createRecipe();
FilteredTank liquidTank = owner.getLiquidTank();
IErrorLogic errorLogic = owner.getErrorLogic();
if (currentRecipe != null && liquidTank.drainInternal(currentRecipe.liquid.amount, false) != null) {
errorLogic.setCondition(false, EnumErrorCode.NO_RESOURCE_LIQUID);
return true;
}
errorLogic.setCondition(true, EnumErrorCode.NO_RESOURCE_LIQUID);
return false;
}
use of forestry.core.fluids.FilteredTank in project ForestryMC by ForestryMC.
the class ClimateSourceHygroregulator method createRecipe.
private void createRecipe() {
if (currentRecipe == null) {
FilteredTank liquidTank = owner.getLiquidTank();
FluidStack fluid = liquidTank.getFluid();
if (fluid != null && fluid.amount > 0) {
currentRecipe = owner.getRecipe(fluid);
} else {
currentRecipe = null;
}
}
}
Aggregations