use of forestry.api.fuels.FermenterFuel in project ForestryMC by ForestryMC.
the class TileFermenter method checkFuel.
private void checkFuel() {
if (fuelBurnTime <= 0) {
ItemStack fuel = getStackInSlot(InventoryFermenter.SLOT_FUEL);
if (!fuel.isEmpty()) {
FermenterFuel fermenterFuel = FuelManager.fermenterFuel.get(fuel);
if (fermenterFuel != null) {
fuelBurnTime = fuelTotalTime = fermenterFuel.getBurnDuration();
fuelCurrentFerment = fermenterFuel.getFermentPerCycle();
decrStackSize(InventoryFermenter.SLOT_FUEL, 1);
}
}
}
}
use of forestry.api.fuels.FermenterFuel in project ForestryMC by ForestryMC.
the class ModuleFactory method preInit.
@Override
public void preInit() {
ItemRegistryCore coreItems = ModuleCore.getItems();
// Set fuels and resources for the fermenter
ItemStack fertilizerCompound = coreItems.fertilizerCompound.getItemStack();
FuelManager.fermenterFuel.put(fertilizerCompound, new FermenterFuel(fertilizerCompound, ForestryAPI.activeMode.getIntegerSetting("fermenter.value.fertilizer"), ForestryAPI.activeMode.getIntegerSetting("fermenter.cycles.fertilizer")));
int cyclesCompost = ForestryAPI.activeMode.getIntegerSetting("fermenter.cycles.compost");
int valueCompost = ForestryAPI.activeMode.getIntegerSetting("fermenter.value.compost");
ItemStack fertilizerBio = coreItems.compost.getItemStack();
ItemStack mulch = coreItems.mulch.getItemStack();
FuelManager.fermenterFuel.put(fertilizerBio, new FermenterFuel(fertilizerBio, valueCompost, cyclesCompost));
FuelManager.fermenterFuel.put(mulch, new FermenterFuel(mulch, valueCompost, cyclesCompost));
// Add moistener resources
ItemStack wheat = new ItemStack(Items.WHEAT);
ItemStack mouldyWheat = coreItems.mouldyWheat.getItemStack();
ItemStack decayingWheat = coreItems.decayingWheat.getItemStack();
FuelManager.moistenerResource.put(wheat, new MoistenerFuel(wheat, mouldyWheat, 0, 300));
FuelManager.moistenerResource.put(mouldyWheat, new MoistenerFuel(mouldyWheat, decayingWheat, 1, 600));
FuelManager.moistenerResource.put(decayingWheat, new MoistenerFuel(decayingWheat, mulch, 2, 900));
// Set fuels for our own engines
ItemStack peat = coreItems.peat.getItemStack();
FuelManager.copperEngineFuel.put(peat, new EngineCopperFuel(peat, Constants.ENGINE_COPPER_FUEL_VALUE_PEAT, Constants.ENGINE_COPPER_CYCLE_DURATION_PEAT));
ItemStack bituminousPeat = coreItems.bituminousPeat.getItemStack();
FuelManager.copperEngineFuel.put(bituminousPeat, new EngineCopperFuel(bituminousPeat, Constants.ENGINE_COPPER_FUEL_VALUE_BITUMINOUS_PEAT, Constants.ENGINE_COPPER_CYCLE_DURATION_BITUMINOUS_PEAT));
Fluid biomass = Fluids.BIOMASS.getFluid();
if (biomass != null) {
FuelManager.bronzeEngineFuel.put(biomass, new EngineBronzeFuel(biomass, Constants.ENGINE_FUEL_VALUE_BIOMASS, (int) (Constants.ENGINE_CYCLE_DURATION_BIOMASS * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.biogas")), 1));
}
FuelManager.bronzeEngineFuel.put(FluidRegistry.WATER, new EngineBronzeFuel(FluidRegistry.WATER, Constants.ENGINE_FUEL_VALUE_WATER, Constants.ENGINE_CYCLE_DURATION_WATER, 3));
Fluid milk = Fluids.MILK.getFluid();
if (milk != null) {
FuelManager.bronzeEngineFuel.put(milk, new EngineBronzeFuel(milk, Constants.ENGINE_FUEL_VALUE_MILK, Constants.ENGINE_CYCLE_DURATION_MILK, 3));
}
Fluid seedOil = Fluids.SEED_OIL.getFluid();
if (seedOil != null) {
FuelManager.bronzeEngineFuel.put(seedOil, new EngineBronzeFuel(seedOil, Constants.ENGINE_FUEL_VALUE_SEED_OIL, Constants.ENGINE_CYCLE_DURATION_SEED_OIL, 1));
}
Fluid honey = Fluids.FOR_HONEY.getFluid();
if (honey != null) {
FuelManager.bronzeEngineFuel.put(honey, new EngineBronzeFuel(honey, Constants.ENGINE_FUEL_VALUE_HONEY, Constants.ENGINE_CYCLE_DURATION_HONEY, 1));
}
Fluid juice = Fluids.JUICE.getFluid();
if (juice != null) {
FuelManager.bronzeEngineFuel.put(juice, new EngineBronzeFuel(juice, Constants.ENGINE_FUEL_VALUE_JUICE, Constants.ENGINE_CYCLE_DURATION_JUICE, 1));
}
// Set rain substrates
ItemStack iodineCharge = coreItems.iodineCharge.getItemStack();
ItemStack dissipationCharge = coreItems.craftingMaterial.getDissipationCharge();
FuelManager.rainSubstrate.put(iodineCharge, new RainSubstrate(iodineCharge, Constants.RAINMAKER_RAIN_DURATION_IODINE, 0.01f));
FuelManager.rainSubstrate.put(dissipationCharge, new RainSubstrate(dissipationCharge, 0.075f));
ICircuitLayout layoutMachineUpgrade = new CircuitLayout("machine.upgrade", CircuitSocketType.MACHINE);
ChipsetManager.circuitRegistry.registerLayout(layoutMachineUpgrade);
}
use of forestry.api.fuels.FermenterFuel in project ForestryMC by ForestryMC.
the class FermenterRecipeWrapper method getIngredients.
@Override
public void getIngredients(IIngredients ingredients) {
List<ItemStack> fuelInputs = new ArrayList<>();
for (FermenterFuel fuel : FuelManager.fermenterFuel.values()) {
fuelInputs.add(fuel.getItem());
}
ingredients.setInputLists(ItemStack.class, Arrays.asList(Collections.singletonList(fermentable), fuelInputs));
FluidStack fluidInput = getRecipe().getFluidResource().copy();
fluidInput.amount = getRecipe().getFermentationValue();
ingredients.setInput(FluidStack.class, fluidInput);
int amount = Math.round(getRecipe().getFermentationValue() * getRecipe().getModifier());
if (fermentable.getItem() instanceof IVariableFermentable) {
amount *= ((IVariableFermentable) fermentable.getItem()).getFermentationModifier(fermentable);
}
FluidStack fluidOutput = new FluidStack(getRecipe().getOutput(), amount);
ingredients.setOutput(FluidStack.class, fluidOutput);
}
Aggregations