use of forestry.api.fuels.RainSubstrate in project ForestryMC by ForestryMC.
the class TileMillRainmaker method openGui.
@Override
public void openGui(EntityPlayer player, ItemStack heldItem) {
if (!player.world.isRemote && !heldItem.isEmpty()) {
// We don't have a gui, but we can be activated
if (FuelManager.rainSubstrate.containsKey(heldItem) && charge == 0) {
RainSubstrate substrate = FuelManager.rainSubstrate.get(heldItem);
if (substrate.getItem().isItemEqual(heldItem)) {
addCharge(substrate);
heldItem.shrink(1);
}
}
sendNetworkUpdate();
}
}
use of forestry.api.fuels.RainSubstrate 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);
}
Aggregations