mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 11:49:14 +00:00
Carrot is not fruit (#27)
* Carrot is not fruit * updateBuildScript & spotlessApply
This commit is contained in:
1 parent
6973dbc80d
commit
c5c3aee2fb
1345 files changed
+92079
-90006
No files matched your search
@@ -11,33 +11,15 @@
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.farming.logic.FarmableBasicIC2Crop;
|
||||
import forestry.farming.logic.FarmableReference;
|
||||
import ic2.api.crops.ICropTile;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.CircuitSocketType;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.fuels.EngineBronzeFuel;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
@@ -64,352 +46,392 @@ import forestry.energy.circuits.CircuitElectricEfficiency;
|
||||
import forestry.energy.tiles.EngineDefinition;
|
||||
import forestry.farming.circuits.CircuitFarmLogic;
|
||||
import forestry.farming.logic.FarmLogicRubber;
|
||||
import forestry.farming.logic.FarmableBasicIC2Crop;
|
||||
import forestry.farming.logic.FarmableReference;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
import forestry.plugins.PluginCore;
|
||||
import forestry.plugins.PluginEnergy;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
import ic2.api.crops.ICropTile;
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import ic2.api.recipe.Recipes;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@Plugin(pluginID = "IC2", name = "IndustrialCraft2", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.ic2.description")
|
||||
@Plugin(
|
||||
pluginID = "IC2",
|
||||
name = "IndustrialCraft2",
|
||||
author = "SirSengir",
|
||||
url = Constants.URL,
|
||||
unlocalizedDescription = "for.plugin.ic2.description")
|
||||
public class PluginIC2 extends ForestryPlugin {
|
||||
|
||||
public static PluginIC2 instance;
|
||||
public static PluginIC2 instance;
|
||||
|
||||
private static ItemStack plantBall;
|
||||
private static ItemStack compressedPlantBall;
|
||||
private static ItemStack wrench;
|
||||
private static ItemStack treetap;
|
||||
private static ItemStack rubbersapling;
|
||||
private static ItemStack rubberleaves;
|
||||
private static ItemStack emptyCell;
|
||||
private static ItemStack lavaCell;
|
||||
private static ItemStack uran238;
|
||||
private static ItemStack waterCell;
|
||||
private static ItemStack rubber;
|
||||
private static ItemStack scrap;
|
||||
private static ItemStack silver;
|
||||
private static ItemStack brass;
|
||||
private static ItemStack uuMatter;
|
||||
private static ItemStack plantBall;
|
||||
private static ItemStack compressedPlantBall;
|
||||
private static ItemStack wrench;
|
||||
private static ItemStack treetap;
|
||||
private static ItemStack rubbersapling;
|
||||
private static ItemStack rubberleaves;
|
||||
private static ItemStack emptyCell;
|
||||
private static ItemStack lavaCell;
|
||||
private static ItemStack uran238;
|
||||
private static ItemStack waterCell;
|
||||
private static ItemStack rubber;
|
||||
private static ItemStack scrap;
|
||||
private static ItemStack silver;
|
||||
private static ItemStack brass;
|
||||
private static ItemStack uuMatter;
|
||||
|
||||
public static ItemStack resin;
|
||||
public static ItemStack rubberwood;
|
||||
public static ItemStack resin;
|
||||
public static ItemStack rubberwood;
|
||||
|
||||
public PluginIC2() {
|
||||
if (PluginIC2.instance == null) {
|
||||
PluginIC2.instance = this;
|
||||
}
|
||||
}
|
||||
public PluginIC2() {
|
||||
if (PluginIC2.instance == null) {
|
||||
PluginIC2.instance = this;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded("IC2");
|
||||
}
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded("IC2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "IndustrialCraft2 not found";
|
||||
}
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "IndustrialCraft2 not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<PluginManager.Module> getDependancies() {
|
||||
EnumSet<PluginManager.Module> deps = super.getDependancies();
|
||||
deps.add(PluginManager.Module.FARMING);
|
||||
deps.add(PluginManager.Module.FACTORY);
|
||||
return deps;
|
||||
}
|
||||
@Override
|
||||
public EnumSet<PluginManager.Module> getDependancies() {
|
||||
EnumSet<PluginManager.Module> deps = super.getDependancies();
|
||||
deps.add(PluginManager.Module.FARMING);
|
||||
deps.add(PluginManager.Module.FACTORY);
|
||||
return deps;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
BlockRegistryEnergy energyBlocks = PluginEnergy.blocks;
|
||||
if (energyBlocks != null) {
|
||||
energyBlocks.engine.addDefinitions(
|
||||
new EngineDefinition(BlockEngineType.ELECTRIC),
|
||||
new EngineDefinition(BlockEngineType.GENERATOR)
|
||||
);
|
||||
}
|
||||
BlockRegistryEnergy energyBlocks = PluginEnergy.blocks;
|
||||
if (energyBlocks != null) {
|
||||
energyBlocks.engine.addDefinitions(
|
||||
new EngineDefinition(BlockEngineType.ELECTRIC), new EngineDefinition(BlockEngineType.GENERATOR));
|
||||
}
|
||||
|
||||
emptyCell = IC2Items.getItem("cell");
|
||||
if (emptyCell != null) {
|
||||
lavaCell = IC2Items.getItem("lavaCell");
|
||||
waterCell = IC2Items.getItem("waterCell");
|
||||
} else {
|
||||
Log.fine("IC2 empty cell could not be found. Skipped adding IC2 liquid containers.");
|
||||
}
|
||||
emptyCell = IC2Items.getItem("cell");
|
||||
if (emptyCell != null) {
|
||||
lavaCell = IC2Items.getItem("lavaCell");
|
||||
waterCell = IC2Items.getItem("waterCell");
|
||||
} else {
|
||||
Log.fine("IC2 empty cell could not be found. Skipped adding IC2 liquid containers.");
|
||||
}
|
||||
|
||||
// rubber chain
|
||||
treetap = IC2Items.getItem("treetap");
|
||||
rubberwood = IC2Items.getItem("rubberWood");
|
||||
resin = IC2Items.getItem("resin");
|
||||
rubbersapling = IC2Items.getItem("rubberSapling");
|
||||
rubberleaves = IC2Items.getItem("rubberLeaves");
|
||||
// rubber chain
|
||||
treetap = IC2Items.getItem("treetap");
|
||||
rubberwood = IC2Items.getItem("rubberWood");
|
||||
resin = IC2Items.getItem("resin");
|
||||
rubbersapling = IC2Items.getItem("rubberSapling");
|
||||
rubberleaves = IC2Items.getItem("rubberLeaves");
|
||||
|
||||
// fermentation
|
||||
plantBall = IC2Items.getItem("plantBall");
|
||||
compressedPlantBall = IC2Items.getItem("compressedPlantBall");
|
||||
// fermentation
|
||||
plantBall = IC2Items.getItem("plantBall");
|
||||
compressedPlantBall = IC2Items.getItem("compressedPlantBall");
|
||||
|
||||
// crated
|
||||
resin = IC2Items.getItem("resin");
|
||||
rubber = IC2Items.getItem("rubber");
|
||||
scrap = IC2Items.getItem("scrap");
|
||||
uuMatter = IC2Items.getItem("matter");
|
||||
silver = IC2Items.getItem("silverIngot");
|
||||
brass = IC2Items.getItem("bronzeIngot");
|
||||
// crated
|
||||
resin = IC2Items.getItem("resin");
|
||||
rubber = IC2Items.getItem("rubber");
|
||||
scrap = IC2Items.getItem("scrap");
|
||||
uuMatter = IC2Items.getItem("matter");
|
||||
silver = IC2Items.getItem("silverIngot");
|
||||
brass = IC2Items.getItem("bronzeIngot");
|
||||
|
||||
uran238 = IC2Items.getItem("Uran238");
|
||||
uran238 = IC2Items.getItem("Uran238");
|
||||
|
||||
Circuit.farmRubberManual = new CircuitFarmLogic("manualRubber", FarmLogicRubber.class);
|
||||
Circuit.farmRubberManual = new CircuitFarmLogic("manualRubber", FarmLogicRubber.class);
|
||||
|
||||
ICircuitLayout layoutEngineTin = new CircuitLayout("engine.tin", CircuitSocketType.ELECTRIC_ENGINE);
|
||||
ChipsetManager.circuitRegistry.registerLayout(layoutEngineTin);
|
||||
}
|
||||
ICircuitLayout layoutEngineTin = new CircuitLayout("engine.tin", CircuitSocketType.ELECTRIC_ENGINE);
|
||||
ChipsetManager.circuitRegistry.registerLayout(layoutEngineTin);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
// Remove some items from the recycler
|
||||
if (Recipes.recyclerBlacklist != null) {
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
Recipes.recyclerBlacklist.add(new RecipeInputItemStack(new ItemStack(beeItems.beeQueenGE)));
|
||||
Recipes.recyclerBlacklist.add(new RecipeInputItemStack(new ItemStack(beeItems.beePrincessGE)));
|
||||
}
|
||||
} else {
|
||||
Log.severe("IC2 Recipes.recyclerBlacklist not found.");
|
||||
}
|
||||
// Remove some items from the recycler
|
||||
if (Recipes.recyclerBlacklist != null) {
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
Recipes.recyclerBlacklist.add(new RecipeInputItemStack(new ItemStack(beeItems.beeQueenGE)));
|
||||
Recipes.recyclerBlacklist.add(new RecipeInputItemStack(new ItemStack(beeItems.beePrincessGE)));
|
||||
}
|
||||
} else {
|
||||
Log.severe("IC2 Recipes.recyclerBlacklist not found.");
|
||||
}
|
||||
|
||||
Circuit.energyElectricChoke1 = new CircuitElectricChoke("electric.choke.1");
|
||||
Circuit.energyElectricEfficiency1 = new CircuitElectricEfficiency("electric.efficiency.1");
|
||||
Circuit.energyElectricBoost1 = new CircuitElectricBoost("electric.boost.1", 2, 7, 20);
|
||||
Circuit.energyElectricBoost2 = new CircuitElectricBoost("electric.boost.2", 2, 15, 40);
|
||||
}
|
||||
Circuit.energyElectricChoke1 = new CircuitElectricChoke("electric.choke.1");
|
||||
Circuit.energyElectricEfficiency1 = new CircuitElectricEfficiency("electric.efficiency.1");
|
||||
Circuit.energyElectricBoost1 = new CircuitElectricBoost("electric.boost.1", 2, 7, 20);
|
||||
Circuit.energyElectricBoost2 = new CircuitElectricBoost("electric.boost.2", 2, 15, 40);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
protected void registerBackpackItems() {
|
||||
if (BackpackManager.definitions == null) {
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
protected void registerBackpackItems() {
|
||||
if (BackpackManager.definitions == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBackpackDefinition forester = BackpackManager.definitions.get("forester");
|
||||
IBackpackDefinition forester = BackpackManager.definitions.get("forester");
|
||||
|
||||
if (resin != null) {
|
||||
forester.addValidItem(resin);
|
||||
}
|
||||
if (rubber != null) {
|
||||
forester.addValidItem(rubber);
|
||||
}
|
||||
if (rubbersapling != null) {
|
||||
forester.addValidItem(rubbersapling);
|
||||
}
|
||||
if (rubberleaves != null) {
|
||||
forester.addValidItem(rubberleaves);
|
||||
}
|
||||
}
|
||||
if (resin != null) {
|
||||
forester.addValidItem(resin);
|
||||
}
|
||||
if (rubber != null) {
|
||||
forester.addValidItem(rubber);
|
||||
}
|
||||
if (rubbersapling != null) {
|
||||
forester.addValidItem(rubbersapling);
|
||||
}
|
||||
if (rubberleaves != null) {
|
||||
forester.addValidItem(rubberleaves);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
protected void registerCrates() {
|
||||
ICrateRegistry crateRegistry = StorageManager.crateRegistry;
|
||||
if (resin != null) {
|
||||
crateRegistry.registerCrate(resin, "cratedResin");
|
||||
}
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
protected void registerCrates() {
|
||||
ICrateRegistry crateRegistry = StorageManager.crateRegistry;
|
||||
if (resin != null) {
|
||||
crateRegistry.registerCrate(resin, "cratedResin");
|
||||
}
|
||||
|
||||
if (rubber != null) {
|
||||
crateRegistry.registerCrate(rubber, "cratedRubber");
|
||||
}
|
||||
if (rubber != null) {
|
||||
crateRegistry.registerCrate(rubber, "cratedRubber");
|
||||
}
|
||||
|
||||
if (scrap != null) {
|
||||
crateRegistry.registerCrate(scrap, "cratedScrap");
|
||||
}
|
||||
if (scrap != null) {
|
||||
crateRegistry.registerCrate(scrap, "cratedScrap");
|
||||
}
|
||||
|
||||
if (uuMatter != null) {
|
||||
crateRegistry.registerCrate(uuMatter, "cratedUUM");
|
||||
}
|
||||
if (uuMatter != null) {
|
||||
crateRegistry.registerCrate(uuMatter, "cratedUUM");
|
||||
}
|
||||
|
||||
if (silver != null) {
|
||||
crateRegistry.registerCrateUsingOreDict(silver, "cratedSilver");
|
||||
}
|
||||
if (silver != null) {
|
||||
crateRegistry.registerCrateUsingOreDict(silver, "cratedSilver");
|
||||
}
|
||||
|
||||
if (brass != null) {
|
||||
crateRegistry.registerCrateUsingOreDict(brass, "cratedBrass");
|
||||
}
|
||||
}
|
||||
if (brass != null) {
|
||||
crateRegistry.registerCrateUsingOreDict(brass, "cratedBrass");
|
||||
}
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
protected void registerRecipes() {
|
||||
@Optional.Method(modid = "IC2")
|
||||
protected void registerRecipes() {
|
||||
|
||||
EnumElectronTube.RUBBER.registerTubeRecipe(rubber);
|
||||
EnumElectronTube.URANIUM.registerTubeRecipe(uran238);
|
||||
EnumElectronTube.RUBBER.registerTubeRecipe(rubber);
|
||||
EnumElectronTube.URANIUM.registerTubeRecipe(uran238);
|
||||
|
||||
if (plantBall != null) {
|
||||
RecipeUtil.addFermenterRecipes(plantBall, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat") * 9, Fluids.BIOMASS);
|
||||
}
|
||||
if (compressedPlantBall != null) {
|
||||
RecipeUtil.addFermenterRecipes(compressedPlantBall, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat") * 9, Fluids.BIOMASS);
|
||||
}
|
||||
if (plantBall != null) {
|
||||
RecipeUtil.addFermenterRecipes(
|
||||
plantBall, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat") * 9, Fluids.BIOMASS);
|
||||
}
|
||||
if (compressedPlantBall != null) {
|
||||
RecipeUtil.addFermenterRecipes(
|
||||
compressedPlantBall,
|
||||
ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat") * 9,
|
||||
Fluids.BIOMASS);
|
||||
}
|
||||
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
if (resin != null) {
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, beeItems.propolis.get(EnumPropolis.NORMAL, 1), ImmutableMap.of(resin, 1.0f));
|
||||
} else {
|
||||
Log.fine("Missing IC2 resin, skipping centrifuge recipe for propolis to resin.");
|
||||
}
|
||||
}
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
if (resin != null) {
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
RecipeManagers.centrifugeManager.addRecipe(
|
||||
20, beeItems.propolis.get(EnumPropolis.NORMAL, 1), ImmutableMap.of(resin, 1.0f));
|
||||
} else {
|
||||
Log.fine("Missing IC2 resin, skipping centrifuge recipe for propolis to resin.");
|
||||
}
|
||||
}
|
||||
|
||||
if (rubbersapling != null) {
|
||||
RecipeUtil.addFermenterRecipes(rubbersapling, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
|
||||
} else {
|
||||
Log.fine("Missing IC2 rubber sapling, skipping fermenter recipe for converting rubber sapling to biomass.");
|
||||
}
|
||||
if (rubbersapling != null) {
|
||||
RecipeUtil.addFermenterRecipes(
|
||||
rubbersapling, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
|
||||
} else {
|
||||
Log.fine("Missing IC2 rubber sapling, skipping fermenter recipe for converting rubber sapling to biomass.");
|
||||
}
|
||||
|
||||
if (rubbersapling != null && resin != null) {
|
||||
String saplingName = GameData.getBlockRegistry().getNameForObject(ItemStackUtil.getBlock(rubbersapling));
|
||||
String resinName = GameData.getItemRegistry().getNameForObject(resin.getItem());
|
||||
String imc = String.format("farmArboreal@%s.%s.%s.%s",
|
||||
saplingName, rubbersapling.getItemDamage(),
|
||||
resinName, resin.getItemDamage());
|
||||
Log.finest("Sending IMC '%s'.", imc);
|
||||
FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", imc);
|
||||
}
|
||||
if (rubbersapling != null && resin != null) {
|
||||
String saplingName = GameData.getBlockRegistry().getNameForObject(ItemStackUtil.getBlock(rubbersapling));
|
||||
String resinName = GameData.getItemRegistry().getNameForObject(resin.getItem());
|
||||
String imc = String.format(
|
||||
"farmArboreal@%s.%s.%s.%s",
|
||||
saplingName, rubbersapling.getItemDamage(), resinName, resin.getItemDamage());
|
||||
Log.finest("Sending IMC '%s'.", imc);
|
||||
FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", imc);
|
||||
}
|
||||
|
||||
FluidStack biogas = FluidRegistry.getFluidStack("ic2biogas", 1000);
|
||||
if (biogas != null && PluginManager.Module.ENERGY.isEnabled()) {
|
||||
FuelManager.bronzeEngineFuel.put(biogas.getFluid(), new EngineBronzeFuel(Fluids.BIOMASS.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_BIOMASS, (int) ((Constants.ENGINE_CYCLE_DURATION_BIOMASS * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.biogas"))), 1));
|
||||
}
|
||||
FluidStack biogas = FluidRegistry.getFluidStack("ic2biogas", 1000);
|
||||
if (biogas != null && PluginManager.Module.ENERGY.isEnabled()) {
|
||||
FuelManager.bronzeEngineFuel.put(
|
||||
biogas.getFluid(),
|
||||
new EngineBronzeFuel(
|
||||
Fluids.BIOMASS.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_BIOMASS,
|
||||
(int) ((Constants.ENGINE_CYCLE_DURATION_BIOMASS
|
||||
* ForestryAPI.activeMode.getFloatSetting("fuel.biomass.biogas"))),
|
||||
1));
|
||||
}
|
||||
|
||||
if (waterCell != null) {
|
||||
ItemStack bogEarthCan = ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.can");
|
||||
if (bogEarthCan.stackSize > 0) {
|
||||
RecipeUtil.addRecipe(bogEarthCan, "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', waterCell, 'Y', "sand");
|
||||
}
|
||||
}
|
||||
if (waterCell != null) {
|
||||
ItemStack bogEarthCan = ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.can");
|
||||
if (bogEarthCan.stackSize > 0) {
|
||||
RecipeUtil.addRecipe(bogEarthCan, "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', waterCell, 'Y', "sand");
|
||||
}
|
||||
}
|
||||
|
||||
ICircuitLayout layout = ChipsetManager.circuitRegistry.getLayout("forestry.engine.tin");
|
||||
ICircuitLayout layout = ChipsetManager.circuitRegistry.getLayout("forestry.engine.tin");
|
||||
|
||||
// / Solder Manager
|
||||
ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), Circuit.energyElectricChoke1);
|
||||
ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.energyElectricBoost1);
|
||||
ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), Circuit.energyElectricBoost2);
|
||||
ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), Circuit.energyElectricEfficiency1);
|
||||
|
||||
if (PluginManager.Module.FARMING.isEnabled() && resin != null && rubberwood != null) {
|
||||
ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.RUBBER, 1), Circuit.farmRubberManual);
|
||||
}
|
||||
// / Solder Manager
|
||||
ChipsetManager.solderManager.addRecipe(
|
||||
layout, PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), Circuit.energyElectricChoke1);
|
||||
ChipsetManager.solderManager.addRecipe(
|
||||
layout, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.energyElectricBoost1);
|
||||
ChipsetManager.solderManager.addRecipe(
|
||||
layout, PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), Circuit.energyElectricBoost2);
|
||||
ChipsetManager.solderManager.addRecipe(
|
||||
layout, PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), Circuit.energyElectricEfficiency1);
|
||||
|
||||
Block ic2Crop = GameRegistry.findBlock("IC2", "blockCrop");
|
||||
if (PluginManager.Module.FARMING.isEnabled() && ic2Crop != null) {
|
||||
ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.URANIUM, 1), Circuit.farmIC2CropsManual);
|
||||
Farmables.farmables.put(FarmableReference.IC2Crops.get(), new ArrayList<>());
|
||||
Farmables.farmables.get(FarmableReference.IC2Crops.get()).add(new FarmableBasicIC2Crop());
|
||||
}
|
||||
if (PluginManager.Module.FARMING.isEnabled() && resin != null && rubberwood != null) {
|
||||
ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");
|
||||
ChipsetManager.solderManager.addRecipe(
|
||||
layoutManual, PluginCore.items.tubes.get(EnumElectronTube.RUBBER, 1), Circuit.farmRubberManual);
|
||||
}
|
||||
|
||||
BlockRegistryEnergy energyBlocks = PluginEnergy.blocks;
|
||||
if (energyBlocks != null) {
|
||||
RecipeUtil.addRecipe(energyBlocks.engine.get(BlockEngineType.GENERATOR),
|
||||
"X#X",
|
||||
"XYX",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "ingotGold",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
Block ic2Crop = GameRegistry.findBlock("IC2", "blockCrop");
|
||||
if (PluginManager.Module.FARMING.isEnabled() && ic2Crop != null) {
|
||||
ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");
|
||||
ChipsetManager.solderManager.addRecipe(
|
||||
layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.URANIUM, 1), Circuit.farmIC2CropsManual);
|
||||
Farmables.farmables.put(FarmableReference.IC2Crops.get(), new ArrayList<>());
|
||||
Farmables.farmables.get(FarmableReference.IC2Crops.get()).add(new FarmableBasicIC2Crop());
|
||||
}
|
||||
|
||||
RecipeUtil.addRecipe(energyBlocks.engine.get(BlockEngineType.ELECTRIC),
|
||||
"###",
|
||||
" X ",
|
||||
"YVY",
|
||||
'#', "ingotTin",
|
||||
'X', "blockGlass",
|
||||
'Y', "gearTin",
|
||||
'V', Blocks.piston);
|
||||
}
|
||||
}
|
||||
BlockRegistryEnergy energyBlocks = PluginEnergy.blocks;
|
||||
if (energyBlocks != null) {
|
||||
RecipeUtil.addRecipe(
|
||||
energyBlocks.engine.get(BlockEngineType.GENERATOR),
|
||||
"X#X",
|
||||
"XYX",
|
||||
"X#X",
|
||||
'#',
|
||||
"blockGlass",
|
||||
'X',
|
||||
"ingotGold",
|
||||
'Y',
|
||||
PluginCore.items.sturdyCasing);
|
||||
|
||||
/**
|
||||
* Check if there is an instance of ICropTile.
|
||||
* @param tileEntity tile entity to be checked.
|
||||
* @return true if there is an IC2 crop and false otherwise.
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
public boolean isIC2Crop(TileEntity tileEntity) {
|
||||
return tileEntity instanceof ICropTile;
|
||||
}
|
||||
RecipeUtil.addRecipe(
|
||||
energyBlocks.engine.get(BlockEngineType.ELECTRIC),
|
||||
"###",
|
||||
" X ",
|
||||
"YVY",
|
||||
'#',
|
||||
"ingotTin",
|
||||
'X',
|
||||
"blockGlass",
|
||||
'Y',
|
||||
"gearTin",
|
||||
'V',
|
||||
Blocks.piston);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an IC2 crop is ready to be harvested.
|
||||
* @param tileEntity tile entity to be checked.
|
||||
* @return true if crop size is optimal for harvest and false otherwise.
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
public boolean canHarvestCrop(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile)tileEntity;
|
||||
if (crop.getCrop() == null) {
|
||||
return false;
|
||||
}
|
||||
return crop.getSize() == crop.getCrop().getOptimalHavestSize(crop);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/**
|
||||
* Check if there is an instance of ICropTile.
|
||||
* @param tileEntity tile entity to be checked.
|
||||
* @return true if there is an IC2 crop and false otherwise.
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
public boolean isIC2Crop(TileEntity tileEntity) {
|
||||
return tileEntity instanceof ICropTile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform some of the actions of the crop-matron.
|
||||
* @param tileEntity
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void babysitCrop(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile)tileEntity;
|
||||
/*
|
||||
This part might be unbalanced until a custom farm logic is added and makes use of weed-ex.
|
||||
if (crop.getCrop() != null) {
|
||||
if (crop.getCrop().isWeed(crop)) {
|
||||
crop.reset();
|
||||
}
|
||||
}*/
|
||||
if (crop.getHydrationStorage() <= 200) {
|
||||
crop.setHydrationStorage(200);
|
||||
}
|
||||
if (crop.getNutrientStorage() <= 100) {
|
||||
crop.setNutrientStorage(crop.getNutrientStorage() + 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Check if an IC2 crop is ready to be harvested.
|
||||
* @param tileEntity tile entity to be checked.
|
||||
* @return true if crop size is optimal for harvest and false otherwise.
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
public boolean canHarvestCrop(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile) tileEntity;
|
||||
if (crop.getCrop() == null) {
|
||||
return false;
|
||||
}
|
||||
return crop.getSize() == crop.getCrop().getOptimalHavestSize(crop);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function takes care of everything related to the harvesting of the
|
||||
* crop meaning it will calculate the drops and also do setSizeAfterHarvest().
|
||||
* @param tileEntity tile entity to be checked.
|
||||
* @return arraylist containing the drops.
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
public ArrayList<ItemStack> getCropDrops(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile)tileEntity;
|
||||
if (crop == null || crop.getCrop() == null)
|
||||
return null;
|
||||
ItemStack[] cropDrops;
|
||||
if ((crop.getCrop().canGrow(crop) && crop.getSize() < crop.getCrop().getOptimalHavestSize(crop)) || crop.getSize() == crop.getCrop().getOptimalHavestSize(crop))
|
||||
cropDrops = crop.harvest_automated(true);
|
||||
else
|
||||
cropDrops = crop.harvest_automated(false);
|
||||
if (cropDrops != null) {
|
||||
return new ArrayList<>(Arrays.asList(cropDrops));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* Perform some of the actions of the crop-matron.
|
||||
* @param tileEntity
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void babysitCrop(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile) tileEntity;
|
||||
/*
|
||||
This part might be unbalanced until a custom farm logic is added and makes use of weed-ex.
|
||||
if (crop.getCrop() != null) {
|
||||
if (crop.getCrop().isWeed(crop)) {
|
||||
crop.reset();
|
||||
}
|
||||
}*/
|
||||
if (crop.getHydrationStorage() <= 200) {
|
||||
crop.setHydrationStorage(200);
|
||||
}
|
||||
if (crop.getNutrientStorage() <= 100) {
|
||||
crop.setNutrientStorage(crop.getNutrientStorage() + 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function takes care of everything related to the harvesting of the
|
||||
* crop meaning it will calculate the drops and also do setSizeAfterHarvest().
|
||||
* @param tileEntity tile entity to be checked.
|
||||
* @return arraylist containing the drops.
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
public ArrayList<ItemStack> getCropDrops(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile) tileEntity;
|
||||
if (crop == null || crop.getCrop() == null) return null;
|
||||
ItemStack[] cropDrops;
|
||||
if ((crop.getCrop().canGrow(crop) && crop.getSize() < crop.getCrop().getOptimalHavestSize(crop))
|
||||
|| crop.getSize() == crop.getCrop().getOptimalHavestSize(crop))
|
||||
cropDrops = crop.harvest_automated(true);
|
||||
else cropDrops = crop.harvest_automated(false);
|
||||
if (cropDrops != null) {
|
||||
return new ArrayList<>(Arrays.asList(cropDrops));
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user