2015-06-14 01:31:46 +02:00
|
|
|
package techreborn.compat.recipes;
|
|
|
|
|
2015-11-23 15:40:30 +01:00
|
|
|
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
|
|
|
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
2015-10-03 11:21:13 +02:00
|
|
|
import forestry.api.arboriculture.EnumWoodType;
|
|
|
|
import forestry.api.arboriculture.TreeManager;
|
2015-09-08 19:39:59 +02:00
|
|
|
import forestry.api.fuels.FuelManager;
|
|
|
|
import forestry.api.fuels.GeneratorFuel;
|
2015-06-14 01:31:46 +02:00
|
|
|
import ic2.api.item.IC2Items;
|
|
|
|
import net.minecraft.init.Items;
|
|
|
|
import net.minecraft.item.ItemStack;
|
2015-09-14 22:34:56 +02:00
|
|
|
import net.minecraftforge.fluids.Fluid;
|
2015-06-14 01:31:46 +02:00
|
|
|
import net.minecraftforge.fluids.FluidRegistry;
|
|
|
|
import net.minecraftforge.fluids.FluidStack;
|
|
|
|
import net.minecraftforge.oredict.OreDictionary;
|
2015-11-08 13:15:45 +01:00
|
|
|
import reborncore.api.fuel.FluidPowerManager;
|
2015-06-14 01:31:46 +02:00
|
|
|
import techreborn.api.recipe.RecipeHandler;
|
|
|
|
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
|
|
|
import techreborn.compat.ICompatModule;
|
2015-08-16 00:31:02 +02:00
|
|
|
import techreborn.config.ConfigTechReborn;
|
2015-06-14 01:31:46 +02:00
|
|
|
|
2015-09-14 22:34:56 +02:00
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.Map;
|
2015-09-08 19:39:59 +02:00
|
|
|
|
2015-06-14 01:31:46 +02:00
|
|
|
public class RecipesForestry implements ICompatModule {
|
|
|
|
@Override
|
|
|
|
public void preInit(FMLPreInitializationEvent event) {
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void init(FMLInitializationEvent event) {
|
2015-10-03 13:39:18 +02:00
|
|
|
|
2015-06-14 01:31:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void postInit(FMLPostInitializationEvent event) {
|
2015-10-03 13:39:18 +02:00
|
|
|
if (ConfigTechReborn.AllowForestryRecipes) {
|
|
|
|
ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
|
|
|
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
|
|
|
ItemStack log = TreeManager.woodItemAccess.getLog(woodType, true);
|
|
|
|
log.stackSize = 1;
|
|
|
|
ItemStack plank = TreeManager.woodItemAccess.getPlanks(woodType, true);
|
|
|
|
plank.stackSize = 6;
|
|
|
|
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, null, new FluidStack(FluidRegistry.WATER, 1000), plank, pulpStack, null, 200, 30, false));
|
|
|
|
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, IC2Items.getItem("waterCell"), null, plank, pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
|
|
|
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, new ItemStack(Items.water_bucket), null, plank, pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
|
|
|
|
|
|
|
log = TreeManager.woodItemAccess.getLog(woodType, false);
|
|
|
|
log.stackSize = 1;
|
|
|
|
plank = TreeManager.woodItemAccess.getPlanks(woodType, false);
|
|
|
|
plank.stackSize = 6;
|
|
|
|
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, null, new FluidStack(FluidRegistry.WATER, 1000), plank, pulpStack, null, 200, 30, false));
|
|
|
|
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, IC2Items.getItem("waterCell"), null, plank, pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
|
|
|
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, new ItemStack(Items.water_bucket), null, plank, pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Iterator entries = FuelManager.generatorFuel.entrySet().iterator();
|
|
|
|
while (entries.hasNext()) {
|
|
|
|
Map.Entry thisEntry = (Map.Entry) entries.next();
|
|
|
|
Fluid fluid = (Fluid) thisEntry.getKey();
|
|
|
|
GeneratorFuel generatorFuel = (GeneratorFuel) thisEntry.getValue();
|
|
|
|
FluidPowerManager.fluidPowerValues.put(fluid, (double) (generatorFuel.eu / generatorFuel.rate));
|
|
|
|
}
|
2015-06-14 01:31:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void serverStarting(FMLServerStartingEvent event) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|