mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 06:43:05 +00:00
First 1.8.9 Version
This commit is contained in:
1 parent
d35cc1df09
commit
5a3850c264
1657 files changed
+26844
-13269
No files matched your search
@@ -1,100 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableBasicAgricraft;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
@Plugin(pluginID = "AgriCraft", name = "AgriCraft", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.agricraft.description")
|
||||
public class PluginAgriCraft extends ForestryPlugin {
|
||||
|
||||
private static final String AgriCraft = "AgriCraft";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(AgriCraft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "AgriCraft not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
|
||||
ImmutableList<String> seeds = ImmutableList.of(
|
||||
"Allium", //Vanilla
|
||||
"Dandelion",
|
||||
"Daisy",
|
||||
"TulipRed",
|
||||
"TulipPink",
|
||||
"TulipOrange",
|
||||
"TulipWhite",
|
||||
"Sugarcane",
|
||||
"Cactus",
|
||||
"Carrot",
|
||||
"Potato",
|
||||
"Poppy",
|
||||
"Orchid",
|
||||
"ShroomRed",
|
||||
"ShroomBrown",
|
||||
|
||||
"BotaniaCyan", //Botania
|
||||
"BotaniaLime",
|
||||
"BotaniaRed",
|
||||
"BotaniaLightGray",
|
||||
"BotaniaOrange",
|
||||
"BotaniaBlack",
|
||||
"BotaniaLightBlue",
|
||||
"BotaniaPink",
|
||||
"BotaniaWhite",
|
||||
"BotaniaGreen",
|
||||
"BotaniaYellow",
|
||||
"BotaniaMagenta",
|
||||
"BotaniaBrown",
|
||||
"BotaniaPurple",
|
||||
"BotaniaBlue",
|
||||
"BotaniaGray"
|
||||
|
||||
|
||||
);
|
||||
int seedamount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
for (String seedName : seeds) {
|
||||
ItemStack seed = GameRegistry.findItemStack(AgriCraft, "seed" + seedName, 1);
|
||||
if (seed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{seed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
}
|
||||
}
|
||||
|
||||
Block cropBlock = GameRegistry.findBlock(AgriCraft, "crops");
|
||||
if (cropBlock != null && PluginManager.Module.FARMING.isEnabled()) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicAgricraft(cropBlock, 7));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,13 +16,10 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
@@ -31,6 +28,7 @@ import forestry.api.storage.BackpackManager;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableBasicFruit;
|
||||
@@ -95,7 +93,7 @@ public class PluginBiomesOPlenty extends ForestryPlugin {
|
||||
|
||||
for (String key : saplingItemKeys) {
|
||||
Item saplingItem = GameRegistry.findItem(BoP, key);
|
||||
String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem);
|
||||
String saplingName = ItemStackUtil.getItemNameFromRegistryAsSting(saplingItem);
|
||||
FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));
|
||||
}
|
||||
|
||||
|
||||
@@ -12,13 +12,12 @@ package forestry.plugins.compat;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import forestry.plugins.Plugin;
|
||||
|
||||
import buildcraft.api.fuels.BuildcraftFuelRegistry;
|
||||
|
||||
@@ -10,13 +10,12 @@
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
import buildcraft.api.recipes.BuildcraftRecipeRegistry;
|
||||
|
||||
|
||||
@@ -13,11 +13,8 @@ package forestry.plugins.compat;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
@@ -65,7 +62,7 @@ public class PluginBuildCraftStatements extends ForestryPlugin implements ITrigg
|
||||
|
||||
@Optional.Method(modid = "BuildCraftAPI|statements")
|
||||
@Override
|
||||
public Collection<ITriggerExternal> getExternalTriggers(ForgeDirection side, TileEntity tile) {
|
||||
public Collection<ITriggerExternal> getExternalTriggers(EnumFacing side, TileEntity tile) {
|
||||
if (tile instanceof ITriggerProvider) {
|
||||
return ((ITriggerProvider) tile).getExternalTriggers(side, tile);
|
||||
}
|
||||
|
||||
@@ -12,9 +12,7 @@ package forestry.plugins.compat;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.Log;
|
||||
|
||||
@@ -12,12 +12,11 @@ package forestry.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
||||
@Plugin(pluginID = "Chisel", name = "Chisel", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.chisel.description")
|
||||
public class PluginChisel extends ForestryPlugin {
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
|
||||
@Plugin(pluginID = "EnderIO", name = "EnderIO", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.enderIO.description")
|
||||
public class PluginEnderIO extends ForestryPlugin {
|
||||
|
||||
private static final String EnderIO = "EnderIO";
|
||||
|
||||
private static final String FLUID_FUEL_ADD = "fluidFuel:add";
|
||||
private static final String FLUID_COOLANT_ADD = "fluidCoolant:add";
|
||||
|
||||
private static final String KEY_FLUID_NAME = "fluidName";
|
||||
private static final String KEY_POWER_PER_CYCLE = "powerPerCycle";
|
||||
private static final String KEY_TOTAL_BURN_TIME = "totalBurnTime";
|
||||
private static final String KEY_COOLING_PER_MB = "coolingPerMb";
|
||||
|
||||
private static final float WATER_COOLING_PER_MB = 0.0023f;
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(EnderIO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "EnderIO not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
Fluid ethanol = Fluids.ETHANOL.getFluid();
|
||||
if (ethanol != null) {
|
||||
int ethanolBurnTime = Math.round(Constants.ENGINE_CYCLE_DURATION_ETHANOL * ForestryAPI.activeMode.getFloatSetting("fuel.ethanol.combustion"));
|
||||
addFuel(ethanol, 40, ethanolBurnTime);
|
||||
}
|
||||
|
||||
Fluid crushedIce = Fluids.ICE.getFluid();
|
||||
if (crushedIce != null) {
|
||||
addCoolant(crushedIce, Constants.ICE_COOLING_MULTIPLIER);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addFuel(Fluid fluid, int powerPerCycle, int totalBurnTime) {
|
||||
NBTTagCompound fuelTag = new NBTTagCompound();
|
||||
fuelTag.setString(KEY_FLUID_NAME, fluid.getName());
|
||||
fuelTag.setInteger(KEY_POWER_PER_CYCLE, powerPerCycle);
|
||||
fuelTag.setInteger(KEY_TOTAL_BURN_TIME, totalBurnTime);
|
||||
|
||||
FMLInterModComms.sendMessage(EnderIO, FLUID_FUEL_ADD, fuelTag);
|
||||
}
|
||||
|
||||
private static void addCoolant(Fluid fluid, float coolingMultiplier) {
|
||||
float coolingPerMb = coolingMultiplier * WATER_COOLING_PER_MB;
|
||||
NBTTagCompound coolantTag = new NBTTagCompound();
|
||||
coolantTag.setString(KEY_FLUID_NAME, fluid.getName());
|
||||
coolantTag.setFloat(KEY_COOLING_PER_MB, coolingPerMb);
|
||||
|
||||
FMLInterModComms.sendMessage(EnderIO, FLUID_COOLANT_ADD, coolantTag);
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.apiculture.items.EnumPropolis;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
@Plugin(pluginID = "Erebus", name = "Erebus", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.erebus.description")
|
||||
public class PluginErebus extends ForestryPlugin {
|
||||
|
||||
private static final String EREBUS = "erebus";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(EREBUS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "Erebus not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
super.registerRecipes();
|
||||
Item materials = GameRegistry.findItem(EREBUS, "materials");
|
||||
ItemStack honeyDrip = new ItemStack(materials, 1, 21);
|
||||
FluidStack honeyOutput = Fluids.HONEY.getFluid(Constants.FLUID_PER_HONEY_DROP);
|
||||
if (PluginManager.Module.FACTORY.isEnabled()) {
|
||||
ItemStack remnants = null;
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
remnants = PluginApiculture.items.propolis.get(EnumPropolis.NORMAL, 1);
|
||||
}
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{honeyDrip}, honeyOutput, remnants, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.circuits.Circuit;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.items.EnumElectronTube;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.circuits.CircuitFarmLogic;
|
||||
import forestry.farming.logic.FarmLogicEnder;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import forestry.plugins.PluginCore;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
@Plugin(pluginID = "ExtraUtilities", name = "ExtraUtilities", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.extrautilities.description")
|
||||
public class PluginExtraUtilities extends ForestryPlugin {
|
||||
|
||||
private static final String ExU = "ExtraUtilities";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(ExU);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "ExtraUtilities not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
Block exUEnderLilly = GameRegistry.findBlock(ExU, "plant/ender_lilly");
|
||||
Farmables.farmables.put("farmEnder", new ArrayList<IFarmable>());
|
||||
if (Config.isExUtilEnderLilyEnabled()) {
|
||||
Circuit.farmEnderManaged = new CircuitFarmLogic("managedEnder", FarmLogicEnder.class);
|
||||
Farmables.farmables.get("farmEnder").add(new FarmableGenericCrop(new ItemStack(exUEnderLilly, 1, 0), exUEnderLilly, 7));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
super.registerRecipes();
|
||||
|
||||
if (PluginManager.Module.FARMING.isEnabled() && Config.isExUtilEnderLilyEnabled()) {
|
||||
ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed");
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.ENDER, 1), Circuit.farmEnderManaged);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableBasicGrowthCraft;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import forestry.plugins.PluginApiculture;
|
||||
import forestry.plugins.PluginCore;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
@Plugin(pluginID = "Growthcraft", name = "Growthcraft", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.growthcraft.description")
|
||||
public class PluginGrowthCraft extends ForestryPlugin {
|
||||
|
||||
private static final String GC = "Growthcraft";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(GC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "GrowthCraft not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
|
||||
int saplingYield = ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling");
|
||||
int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
|
||||
int seedamount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
|
||||
ItemStack appleSeed = GameRegistry.findItemStack("Growthcraft|Apples", "grc.appleSeeds", 1);
|
||||
ItemStack grapeSeed = GameRegistry.findItemStack("Growthcraft|Grapes", "grc.grapeSeeds", 1);
|
||||
ItemStack hopSeed = GameRegistry.findItemStack("Growthcraft|Hops", "grc.hopSeeds", 1);
|
||||
ItemStack riceSeed = GameRegistry.findItemStack("Growthcraft|Rice", "grc.rice", 1);
|
||||
|
||||
if (appleSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{appleSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
BackpackManager.backpackItems[2].add(appleSeed);
|
||||
}
|
||||
if (grapeSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{grapeSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
BackpackManager.backpackItems[2].add(grapeSeed);
|
||||
}
|
||||
if (hopSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{hopSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
BackpackManager.backpackItems[2].add(hopSeed);
|
||||
}
|
||||
if (riceSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{riceSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
BackpackManager.backpackItems[2].add(riceSeed);
|
||||
}
|
||||
|
||||
ItemStack hops = GameRegistry.findItemStack("Growthcraft|Hops", "grc.hops", 1);
|
||||
|
||||
if (hops != null) {
|
||||
RecipeUtil.addFermenterRecipes(hops, saplingYield, Fluids.BIOMASS);
|
||||
BackpackManager.backpackItems[2].add(hops);
|
||||
|
||||
}
|
||||
Block hopVine = GameRegistry.findBlock("Growthcraft|Hops", "grc.hopVine");
|
||||
if (hopVine != null) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicGrowthCraft(hopVine, 3, false, false)); // need custom fruit to weed out rope
|
||||
}
|
||||
Block riceBlock = GameRegistry.findBlock("Growthcraft|Rice", "grc.riceBlock");
|
||||
if (riceBlock != null) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicGrowthCraft(riceBlock, 7, true, false)); //need to set paddyfield to 7
|
||||
}
|
||||
|
||||
ItemStack emptyComb = new ItemStack(GameRegistry.findItem("Growthcraft|Bees", "grc.honeyComb"), 1, 0);
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, emptyComb, ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 1.0f)
|
||||
);
|
||||
|
||||
if (PluginManager.Module.APICULTURE.isEnabled()) {
|
||||
ItemStack fullComb = new ItemStack(GameRegistry.findItem("Growthcraft|Bees", "grc.honeyComb"), 1, 1);
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, fullComb, ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 1.0f,
|
||||
PluginApiculture.items.honeyDrop.getItemStack(), 0.9f,
|
||||
PluginApiculture.items.honeydew.getItemStack(), 0.1f)
|
||||
);
|
||||
}
|
||||
|
||||
ItemStack bamboo = GameRegistry.findItemStack("Growthcraft|Bamboo", "grc.bamboo", 1);
|
||||
ItemStack bambooShoot = GameRegistry.findItemStack("Growthcraft|Bamboo", "grc.bambooShoot", 1);
|
||||
ItemStack bambooShootFood = GameRegistry.findItemStack("Growthcraft|Bamboo", "grc.bambooShootFood", 1);
|
||||
if (bamboo != null) {
|
||||
RecipeUtil.addFermenterRecipes(bamboo, saplingYield, Fluids.BIOMASS);
|
||||
BackpackManager.backpackItems[2].add(bamboo);
|
||||
}
|
||||
if (bambooShoot != null) {
|
||||
RecipeUtil.addFermenterRecipes(bambooShoot, saplingYield, Fluids.BIOMASS);
|
||||
BackpackManager.backpackItems[2].add(bambooShoot);
|
||||
}
|
||||
if (bambooShootFood != null) {
|
||||
RecipeUtil.addFermenterRecipes(bambooShootFood, saplingYield, Fluids.BIOMASS);
|
||||
BackpackManager.backpackItems[2].add(bambooShootFood);
|
||||
}
|
||||
|
||||
ItemStack grapes = GameRegistry.findItemStack("Growthcraft|Grapes", "grc.grapes", 1); //squeeze
|
||||
|
||||
if (grapes != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{grapes}, Fluids.JUICE.getFluid(juiceAmount));
|
||||
BackpackManager.backpackItems[2].add(grapes);
|
||||
}
|
||||
Block grapeBlock = GameRegistry.findBlock("Growthcraft|Grapes", "grc.grapeBlock");
|
||||
if (grapeBlock != null) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicGrowthCraft(grapeBlock, 0, false, true));
|
||||
}
|
||||
|
||||
ItemStack bambooLeaves = GameRegistry.findItemStack("Growthcraft|Bamboo", "grc.bambooLeaves", 1);
|
||||
if (bambooLeaves != null) {
|
||||
BackpackManager.backpackItems[2].add(bambooLeaves);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,365 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.fuels.MoistenerFuel;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableBasicFruit;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
import forestry.plugins.PluginCore;
|
||||
|
||||
@Plugin(pluginID = "HarvestCraft", name = "HarvestCraft", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.harvestcraft.description")
|
||||
public class PluginHarvestCraft extends ForestryPlugin {
|
||||
|
||||
private static final String HC = "harvestcraft";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(HC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "HarvestCraft not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
|
||||
ImmutableList<String> berries = ImmutableList.of(
|
||||
"cranberry",
|
||||
"blackberry",
|
||||
"blueberry",
|
||||
"raspberry",
|
||||
"strawberry"
|
||||
);
|
||||
|
||||
ImmutableList<String> fruits = ImmutableList.of(
|
||||
"pineapple",
|
||||
"cactusfruit",
|
||||
"cantaloupe",
|
||||
"grape",
|
||||
"kiwi",
|
||||
"chilipepper"
|
||||
);
|
||||
|
||||
ImmutableList<String> treeFruits = ImmutableList.of(
|
||||
"banana",
|
||||
"dragonfruit",
|
||||
"lemon",
|
||||
"lime",
|
||||
"mango",
|
||||
"orange",
|
||||
"papaya",
|
||||
"peach",
|
||||
"pear",
|
||||
"plum",
|
||||
"pomegranate",
|
||||
"starfruit",
|
||||
"apricot",
|
||||
"date",
|
||||
"fig",
|
||||
"grapefruit",
|
||||
"persimmon",
|
||||
"avocado",
|
||||
"coconut",
|
||||
"durian"
|
||||
);
|
||||
|
||||
ImmutableList<String> trees = ImmutableList.of(
|
||||
"nutmeg",
|
||||
"olive",
|
||||
"peppercorn"
|
||||
);
|
||||
|
||||
ImmutableList<String> treesSpecial = ImmutableList.of(
|
||||
"cinnamon",
|
||||
"maple",
|
||||
"paperbark",
|
||||
"vanillabean",
|
||||
"apple" // to prevent apples from getting double registered
|
||||
);
|
||||
|
||||
ImmutableList<String> herbs = ImmutableList.of(
|
||||
"garlic"
|
||||
);
|
||||
|
||||
ImmutableList<String> spices = ImmutableList.of(
|
||||
"ginger",
|
||||
"spiceleaf"
|
||||
//"mustardseed" Mustard is inconsistent and annoying.
|
||||
);
|
||||
|
||||
ImmutableList<String> vegetables = ImmutableList.of(
|
||||
"asparagus",
|
||||
"bean",
|
||||
"beet",
|
||||
"broccoli",
|
||||
"cauliflower",
|
||||
"celery",
|
||||
"leek",
|
||||
"lettuce",
|
||||
"onion",
|
||||
"parsnip",
|
||||
"radish",
|
||||
"rutabaga",
|
||||
"scallion",
|
||||
"soybean",
|
||||
"sweetpotato",
|
||||
"turnip",
|
||||
"whitemushroom",
|
||||
"artichoke",
|
||||
"bellpepper",
|
||||
"brusselsprout",
|
||||
"cabbage",
|
||||
"corn",
|
||||
"cucumber",
|
||||
"eggplant",
|
||||
"okra",
|
||||
"peas",
|
||||
"rhubarb",
|
||||
"seaweed",
|
||||
"tomato",
|
||||
"wintersquash",
|
||||
"zucchini",
|
||||
"bambooshoot",
|
||||
"spinach"
|
||||
);
|
||||
|
||||
ImmutableList<String> grains = ImmutableList.of(
|
||||
"barley",
|
||||
"oats",
|
||||
"rye"
|
||||
);
|
||||
|
||||
ImmutableList<String> cropNuts = ImmutableList.of(
|
||||
"peanut"
|
||||
);
|
||||
|
||||
ImmutableList<String> nuts = ImmutableList.of(
|
||||
"walnut",
|
||||
"almond",
|
||||
"cashew",
|
||||
"chestnut",
|
||||
"pecan",
|
||||
"pistachio",
|
||||
"cherry" //Cherries in forestry make seed oil
|
||||
);
|
||||
|
||||
ImmutableList.Builder<String> genericCropsBuilder = ImmutableList.builder();
|
||||
genericCropsBuilder.add(
|
||||
"cotton",
|
||||
"rice",
|
||||
"tea",
|
||||
"coffee",
|
||||
"candleberry"
|
||||
);
|
||||
genericCropsBuilder.addAll(herbs);
|
||||
genericCropsBuilder.addAll(spices);
|
||||
|
||||
ImmutableList<String> genericCrops = genericCropsBuilder.build();
|
||||
|
||||
ImmutableList.Builder<String> plants = ImmutableList.builder();
|
||||
|
||||
int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 25;
|
||||
int seedamount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
ItemStack wheatamount = ForestryAPI.activeMode.getStackSetting("recipe.output.compost.wheat");
|
||||
|
||||
juiceAmount = Math.max(juiceAmount, 1); // Produce at least 1 mb of juice.
|
||||
for (String berryName : berries) {
|
||||
ItemStack berry = GameRegistry.findItemStack(HC, berryName + "Item", 1);
|
||||
ItemStack berrySeed = GameRegistry.findItemStack(HC, berryName + "seedItem", 1);
|
||||
Block berryBlock = GameRegistry.findBlock(HC, "pam" + berryName + "Crop");
|
||||
if (berry != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{berry}, Fluids.JUICE.getFluid(juiceAmount));
|
||||
}
|
||||
if (berrySeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{berrySeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
}
|
||||
if (berrySeed != null && berryBlock != null) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(berrySeed, berryBlock, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(berryBlock, 7));
|
||||
}
|
||||
plants.add(berryName);
|
||||
}
|
||||
|
||||
juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
|
||||
for (String fruitName : fruits) {
|
||||
ItemStack fruit = GameRegistry.findItemStack(HC, fruitName + "Item", 1);
|
||||
ItemStack fruitSeed = GameRegistry.findItemStack(HC, fruitName + "seedItem", 1);
|
||||
Block fruitBlock = GameRegistry.findBlock(HC, "pam" + fruitName + "Crop");
|
||||
if (fruit != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{fruit}, Fluids.JUICE.getFluid(juiceAmount));
|
||||
}
|
||||
if (fruitSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{fruitSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
}
|
||||
if (fruitSeed != null && fruitBlock != null) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(fruitSeed, fruitBlock, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(fruitBlock, 7));
|
||||
}
|
||||
plants.add(fruitName);
|
||||
}
|
||||
|
||||
juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 2; // vegetables produce less juice
|
||||
juiceAmount = Math.max(juiceAmount, 1); // Produce at least 1 mb of juice.
|
||||
for (String vegetableName : vegetables) {
|
||||
ItemStack vegetable = GameRegistry.findItemStack(HC, vegetableName + "Item", 1);
|
||||
ItemStack vegetableSeed = GameRegistry.findItemStack(HC, vegetableName + "seedItem", 1);
|
||||
Block vegetableBlock = GameRegistry.findBlock(HC, "pam" + vegetableName + "Crop");
|
||||
if (vegetable != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{vegetable}, Fluids.JUICE.getFluid(juiceAmount));
|
||||
}
|
||||
if (vegetableSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{vegetableSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
}
|
||||
if (vegetableSeed != null && vegetableBlock != null) {
|
||||
Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(vegetableSeed, vegetableBlock, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(vegetableBlock, 7));
|
||||
}
|
||||
plants.add(vegetableName);
|
||||
}
|
||||
|
||||
for (String grainName : grains) {
|
||||
ItemStack grain = GameRegistry.findItemStack(HC, grainName + "Item", 1);
|
||||
ItemStack grainSeed = GameRegistry.findItemStack(HC, grainName + "seedItem", 1);
|
||||
Block grainBlock = GameRegistry.findBlock(HC, "pam" + grainName + "Crop");
|
||||
if (grain != null && wheatamount.stackSize > 0) {
|
||||
RecipeUtil.addRecipe(wheatamount, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', grain);
|
||||
FuelManager.moistenerResource.put(grain, new MoistenerFuel(grain, PluginCore.items.mouldyWheat.getItemStack(), 0, 300));
|
||||
}
|
||||
if (grainSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{grainSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
RecipeManagers.moistenerManager.addRecipe(grainSeed, new ItemStack(Blocks.mycelium), 5000);
|
||||
}
|
||||
if (grainSeed != null && grainBlock != null) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(grainSeed, grainBlock, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(grainBlock, 7));
|
||||
}
|
||||
plants.add(grainName);
|
||||
}
|
||||
|
||||
for (String treeFruitName : treeFruits) {
|
||||
ItemStack treeFruit = GameRegistry.findItemStack(HC, treeFruitName + "Item", 1);
|
||||
Block treeFruitBlock = GameRegistry.findBlock(HC, "pam" + (Character.toUpperCase(treeFruitName.charAt(0)) + treeFruitName.substring(1)));
|
||||
if (treeFruitBlock != null) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(treeFruitBlock, 2));
|
||||
}
|
||||
if (treeFruit != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{treeFruit}, Fluids.JUICE.getFluid(juiceAmount));
|
||||
}
|
||||
plants.add(treeFruitName);
|
||||
}
|
||||
|
||||
for (String treeName : trees) {
|
||||
Block fruitBlock = GameRegistry.findBlock(HC, "pam" + (Character.toUpperCase(treeName.charAt(0)) + treeName.substring(1)));
|
||||
if (fruitBlock != null) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(fruitBlock, 2));
|
||||
}
|
||||
plants.add(treeName);
|
||||
}
|
||||
|
||||
for (String treeName : treesSpecial) {
|
||||
Block fruitBlock = GameRegistry.findBlock(HC, "pam" + (Character.toUpperCase(treeName.charAt(0)) + treeName.substring(1)));
|
||||
if (fruitBlock != null) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(fruitBlock, 2));
|
||||
}
|
||||
}
|
||||
|
||||
for (String cropName : genericCrops) {
|
||||
ItemStack genericCropSeed = GameRegistry.findItemStack(HC, cropName + "seedItem", 1);
|
||||
Block genericCropBlock = GameRegistry.findBlock(HC, "pam" + cropName + "Crop");
|
||||
if (genericCropSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{genericCropSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
}
|
||||
if (genericCropSeed != null && genericCropBlock != null) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(genericCropSeed, genericCropBlock, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(genericCropBlock, 7));
|
||||
}
|
||||
plants.add(cropName);
|
||||
}
|
||||
ItemStack mustardCropSeed = GameRegistry.findItemStack(HC, "mustard" + "seedItem", 1);
|
||||
Block mustardCropBlock = GameRegistry.findBlock(HC, "pam" + "mustardseeds" + "Crop");
|
||||
ItemStack mustardFruit = GameRegistry.findItemStack(HC, "mustard" + "seedsItem", 1);
|
||||
if (mustardCropSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{mustardCropSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
}
|
||||
if (mustardCropSeed != null && mustardCropBlock != null) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(mustardCropSeed, mustardCropBlock, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(mustardCropBlock, 7));
|
||||
}
|
||||
if (mustardFruit != null) {
|
||||
RecipeUtil.addFermenterRecipes(mustardFruit, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
|
||||
}
|
||||
|
||||
for (String plantName : plants.build()) {
|
||||
ItemStack plant = GameRegistry.findItemStack(HC, plantName + "Item", 1);
|
||||
if (plant != null) {
|
||||
RecipeUtil.addFermenterRecipes(plant, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
|
||||
}
|
||||
}
|
||||
|
||||
for (String cropnutName : cropNuts) {
|
||||
ItemStack cropnut = GameRegistry.findItemStack(HC, cropnutName + "Item", 1);
|
||||
ItemStack cropnutSeed = GameRegistry.findItemStack(HC, cropnutName + "seedItem", 1);
|
||||
Block cropnutBlock = GameRegistry.findBlock(HC, "pam" + cropnutName + "Crop");
|
||||
if (cropnutSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{cropnutSeed}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
}
|
||||
if (cropnutSeed != null && cropnutBlock != null) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(cropnutSeed, cropnutBlock, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(cropnutBlock, 7));
|
||||
}
|
||||
if (cropnut != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[]{cropnut}, Fluids.SEEDOIL.getFluid(3 * seedamount));
|
||||
}
|
||||
}
|
||||
|
||||
for (String nutName : nuts) {
|
||||
ItemStack nut = GameRegistry.findItemStack(HC, nutName + "Item", 1);
|
||||
Block nutBlock = GameRegistry.findBlock(HC, "pam" + (Character.toUpperCase(nutName.charAt(0)) + nutName.substring(1)));
|
||||
if (nutBlock != null) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(nutBlock, 2));
|
||||
}
|
||||
if (nut != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[]{nut}, Fluids.SEEDOIL.getFluid(3 * seedamount));
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack hcHoneyItem = GameRegistry.findItemStack(HC, "honeyItem", 1);
|
||||
if (hcHoneyItem != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{hcHoneyItem}, Fluids.HONEY.getFluid(Constants.FLUID_PER_HONEY_DROP));
|
||||
}
|
||||
|
||||
ItemStack hcBeeswaxItem = GameRegistry.findItemStack(HC, "beeswaxItem", 1);
|
||||
if (hcBeeswaxItem != null) {
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.capsule"), "XXX ", 'X', hcBeeswaxItem);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,25 +13,19 @@ 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.farming.logic.FarmableBasicIC2Crop;
|
||||
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 net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.CircuitSocketType;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
@@ -68,7 +62,6 @@ import forestry.plugins.PluginApiculture;
|
||||
import forestry.plugins.PluginCore;
|
||||
import forestry.plugins.PluginEnergy;
|
||||
import forestry.plugins.PluginManager;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.recipe.RecipeInputItemStack;
|
||||
import ic2.api.recipe.Recipes;
|
||||
@@ -240,6 +233,7 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "IC2")
|
||||
protected void registerRecipes() {
|
||||
|
||||
@@ -273,8 +267,8 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
}
|
||||
|
||||
if (rubbersapling != null && resin != null) {
|
||||
String saplingName = GameData.getBlockRegistry().getNameForObject(ItemStackUtil.getBlock(rubbersapling));
|
||||
String resinName = GameData.getItemRegistry().getNameForObject(resin.getItem());
|
||||
String saplingName = ItemStackUtil.getBlockNameFromRegistryAsSting(ItemStackUtil.getBlock(rubbersapling));
|
||||
String resinName = ItemStackUtil.getItemNameFromRegistryAsSting(resin.getItem());
|
||||
String imc = String.format("farmArboreal@%s.%s.%s.%s",
|
||||
saplingName, rubbersapling.getItemDamage(),
|
||||
resinName, resin.getItemDamage());
|
||||
@@ -339,20 +333,20 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
* @param tileEntity tile entity to be checked.
|
||||
* @return true if there is an IC2 crop and false otherwise.
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
/*@Optional.Method(modid = "IC2")
|
||||
public boolean isIC2Crop(TileEntity tileEntity) {
|
||||
if (tileEntity != null && tileEntity instanceof ICropTile) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 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")
|
||||
/*@Optional.Method(modid = "IC2")
|
||||
public boolean canHarvestCrop(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile)tileEntity;
|
||||
@@ -364,13 +358,13 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Perform some of the actions of the crop-matron.
|
||||
* @param tileEntity
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
/*@Optional.Method(modid = "IC2")
|
||||
public void babysitCrop(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile)tileEntity;
|
||||
@@ -381,14 +375,14 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
crop.reset();
|
||||
}
|
||||
}*/
|
||||
if (crop.getHydrationStorage() <= 200) {
|
||||
/*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
|
||||
@@ -396,7 +390,7 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
* @param tileEntity tile entity to be checked.
|
||||
* @return arraylist containing the drops.
|
||||
*/
|
||||
@Optional.Method(modid = "IC2")
|
||||
/*@Optional.Method(modid = "IC2")
|
||||
public ArrayList<ItemStack> getCropDrops(TileEntity tileEntity) {
|
||||
if (isIC2Crop(tileEntity)) {
|
||||
ICropTile crop = (ICropTile)tileEntity;
|
||||
@@ -406,5 +400,24 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}*/
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
public boolean isIC2Crop(TileEntity tileEntity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
public boolean canHarvestCrop(TileEntity tileEntity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
public void babysitCrop(TileEntity tileEntity) {
|
||||
}
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
public ArrayList<ItemStack> getCropDrops(TileEntity tileEntity) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
|
||||
@Plugin(pluginID = "ImmersiveEngineering", name = "ImmersiveEngineering", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.immersiveengineering.description")
|
||||
public class PluginImmersiveEngineering extends ForestryPlugin {
|
||||
|
||||
private static final String ImEng = "ImmersiveEngineering";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(ImEng);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "Immersive Engineering not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void postInit() {
|
||||
|
||||
ItemStack hempSeed = GameRegistry.findItemStack(ImEng, "seed", 1);
|
||||
Block hempCrop = GameRegistry.findBlock(ImEng, "hemp");
|
||||
ItemStack hempFiber = new ItemStack(GameRegistry.findItem(ImEng, "material"), 1, 3);
|
||||
int seedAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
if (hempSeed != null && hempCrop != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{hempSeed}, Fluids.SEEDOIL.getFluid(seedAmount));
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(hempSeed, hempCrop, 4, hempFiber));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,282 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
|
||||
@Plugin(pluginID = "MagicalCrops", name = "MagicalCrops", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.magicalcrops.description")
|
||||
public class PluginMagicalCrops extends ForestryPlugin {
|
||||
|
||||
private static final String MagCrop = "magicalcrops";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(MagCrop);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "Magical Crops not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void postInit() {
|
||||
|
||||
ImmutableList<String> magicSeeds = ImmutableList.of(
|
||||
"Essence",
|
||||
"Coal",
|
||||
"Dye",
|
||||
"Redstone",
|
||||
"Glowstone",
|
||||
"Obsidian",
|
||||
"Iron",
|
||||
"Gold",
|
||||
"Lapis",
|
||||
"Ender",
|
||||
"Nether",
|
||||
"Experience",
|
||||
"Blaze",
|
||||
"Diamond",
|
||||
"Emerald"
|
||||
);
|
||||
|
||||
ImmutableList<String> elementSeeds = ImmutableList.of(
|
||||
"Air",
|
||||
"Water",
|
||||
"Earth",
|
||||
"Fire"
|
||||
);
|
||||
|
||||
ImmutableList<String> modMagicSeeds = ImmutableList.of(
|
||||
"Copper",
|
||||
"Tin",
|
||||
"Silver",
|
||||
"Lead",
|
||||
"Quartz",
|
||||
"Sapphire",
|
||||
"Ruby",
|
||||
"Peridot",
|
||||
"Aluminium",
|
||||
"Force",
|
||||
"Cobalt",
|
||||
"Ardite",
|
||||
"Nickel",
|
||||
"Platinum",
|
||||
"ThaumcraftShard",
|
||||
"Uranium",
|
||||
"Oil",
|
||||
"Rubber",
|
||||
"Vinteum",
|
||||
"BlueTopaz",
|
||||
"Chimerite",
|
||||
"Moonstone",
|
||||
"Sunstone",
|
||||
"Iridium",
|
||||
"Yellorite",
|
||||
"Osmium",
|
||||
"Manganese",
|
||||
"Sulfur",
|
||||
"Darkiron"
|
||||
);
|
||||
|
||||
ImmutableList<String> soulSeeds = ImmutableList.of(
|
||||
"Cow",
|
||||
"Creeper",
|
||||
"Magma",
|
||||
"Skeleton",
|
||||
"Slime",
|
||||
"Spider",
|
||||
"Ghast",
|
||||
"Wither"
|
||||
);
|
||||
|
||||
ImmutableList<String> potionSeeds = ImmutableList.of(
|
||||
"Fire",
|
||||
"Water",
|
||||
"Strength",
|
||||
"Regen",
|
||||
"Night",
|
||||
"Speed"
|
||||
);
|
||||
|
||||
ImmutableList<String> seeds = ImmutableList.of(
|
||||
"Blackberry",
|
||||
"Blueberry",
|
||||
"Chili",
|
||||
"Cucumber",
|
||||
"Grape",
|
||||
"Raspberry",
|
||||
"Strawberry",
|
||||
"Sweetcorn",
|
||||
"Tomato",
|
||||
"SugarCane"
|
||||
);
|
||||
|
||||
ImmutableList<String> betaSeeds = ImmutableList.of(
|
||||
"Air",
|
||||
"Airshard",
|
||||
"Aluminium",
|
||||
"Alumite",
|
||||
"Amber",
|
||||
"Ardite",
|
||||
"Blaze",
|
||||
"Blizz",
|
||||
"Bronze",
|
||||
"CertusQuartz",
|
||||
"Chicken",
|
||||
"Coal",
|
||||
"Cobalt",
|
||||
"ConductiveIron",
|
||||
"Copper",
|
||||
"Cow",
|
||||
"Creeper",
|
||||
"DarkSteel",
|
||||
"Diamond",
|
||||
"Draconium",
|
||||
"Dye",
|
||||
"Earth",
|
||||
"Earthshard",
|
||||
"ElectricalSteel",
|
||||
"Electrum",
|
||||
"Emerald",
|
||||
"Enderium",
|
||||
"Enderman",
|
||||
"EnergeticAlloy",
|
||||
"Experience",
|
||||
"Fire",
|
||||
"Fireshard",
|
||||
"Fluix",
|
||||
"Ghast",
|
||||
"Glowstone",
|
||||
"Gold",
|
||||
"Invar",
|
||||
"Iron",
|
||||
"Lapis",
|
||||
"Lead",
|
||||
"Lumium",
|
||||
"Manasteel",
|
||||
"Manyullyn",
|
||||
"Minicio",
|
||||
"Nature",
|
||||
"Nether",
|
||||
"Nickel",
|
||||
"Obsidian",
|
||||
"Ordershard",
|
||||
"Osmium",
|
||||
"Peridot",
|
||||
"Pig",
|
||||
"Platinum",
|
||||
"PulsatingIron",
|
||||
"Quartz",
|
||||
"Quicksilver",
|
||||
"RedstoneAlloy",
|
||||
"Redstone",
|
||||
"Rubber",
|
||||
"Ruby",
|
||||
"Saltpeter",
|
||||
"Sapphire",
|
||||
"Sheep",
|
||||
"Signalum",
|
||||
"Silver",
|
||||
"Skeleton",
|
||||
"Slime",
|
||||
"Soularium",
|
||||
"Spider",
|
||||
"Steel",
|
||||
"Sulfur",
|
||||
"Terrasteel",
|
||||
"Thaumium",
|
||||
"Tin",
|
||||
"VibrantAlloy",
|
||||
"Water",
|
||||
"Watershard",
|
||||
"Wither",
|
||||
"Yellorite"
|
||||
);
|
||||
|
||||
int seedAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
|
||||
for (String magicSeedName : magicSeeds) {
|
||||
addRecipes("_MagicSeeds", "_MagicCrop", magicSeedName, seedAmount);
|
||||
}
|
||||
|
||||
for (String elementSeedName : elementSeeds) {
|
||||
addRecipes("_ElementSeeds", "_ElementCrop", elementSeedName, seedAmount);
|
||||
}
|
||||
|
||||
for (String modMagicSeedName : modMagicSeeds) {
|
||||
addRecipes("_ModMagicSeeds", "_ModMagicCrop", modMagicSeedName, seedAmount);
|
||||
}
|
||||
|
||||
for (String soulSeedName : soulSeeds) {
|
||||
addRecipes("_SoulSeeds", "_SoulCrop", soulSeedName, seedAmount);
|
||||
}
|
||||
|
||||
for (String potionSeedName : potionSeeds) {
|
||||
addRecipes("_PotionSeeds", "_PotionCrop", potionSeedName, seedAmount);
|
||||
}
|
||||
|
||||
for (String seedName : seeds) {
|
||||
addRecipes("_Seeds", "_Crop", seedName, seedAmount);
|
||||
}
|
||||
for (String seedName : betaSeeds) {
|
||||
addBetaRecipes("Seeds", "Crop", seedName, "");
|
||||
addBetaRecipes("Seeds", "Crop", seedName, "magicalcrops_");
|
||||
}
|
||||
|
||||
Item cropProduce = GameRegistry.findItem(MagCrop, MagCrop + "_CropProduce");
|
||||
if (cropProduce != null) {
|
||||
int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
|
||||
ItemStack produce = new ItemStack(GameRegistry.findItem(MagCrop, MagCrop + "_CropProduce"), 1, OreDictionary.WILDCARD_VALUE);
|
||||
RecipeUtil.addFermenterRecipes(produce, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{produce}, Fluids.JUICE.getFluid(juiceAmount));
|
||||
}
|
||||
}
|
||||
|
||||
private static void addRecipes(String seedPrefix, String cropPrefix, String name, int fluidAmount) {
|
||||
ItemStack seed = GameRegistry.findItemStack(MagCrop, MagCrop + seedPrefix + name, 1);
|
||||
Block crop = GameRegistry.findBlock(MagCrop, MagCrop + cropPrefix + name);
|
||||
if (seed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{seed}, Fluids.SEEDOIL.getFluid(fluidAmount));
|
||||
}
|
||||
if (seed != null && crop != null && Config.isMagicalCropsSupportEnabled()) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(seed, crop, 7));
|
||||
}
|
||||
}
|
||||
|
||||
private static void addBetaRecipes(String seedSuffix, String cropSuffix, String name, String middlefix) {
|
||||
ItemStack seed = GameRegistry.findItemStack(MagCrop, middlefix + name + seedSuffix, 1);
|
||||
Block crop = GameRegistry.findBlock(MagCrop, middlefix + name + cropSuffix);
|
||||
if (seed != null && crop != null && Config.isMagicalCropsSupportEnabled()) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(seed, crop, 7));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,13 +17,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
@@ -34,6 +31,7 @@ import forestry.api.storage.StorageManager;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
@@ -96,19 +94,23 @@ public class PluginNatura extends ForestryPlugin {
|
||||
ItemStack saplingWild = new ItemStack(saplingItem, 1, OreDictionary.WILDCARD_VALUE);
|
||||
RecipeUtil.addFermenterRecipes(saplingWild, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
|
||||
|
||||
String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem);
|
||||
String saplingName = ItemStackUtil.getItemNameFromRegistryAsSting(saplingItem);
|
||||
FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));
|
||||
}
|
||||
|
||||
berryBlight = GameRegistry.findItemStack(NATURA, "berryBlight", 1);
|
||||
berryDusk = GameRegistry.findItemStack(NATURA, "berryDusk", 1);
|
||||
berrySky = GameRegistry.findItemStack(NATURA, "berrySky", 1);
|
||||
berrySting = GameRegistry.findItemStack(NATURA, "berrySting", 1);
|
||||
berryRasp = GameRegistry.findItemStack(NATURA, "berryRasp", 1);
|
||||
berryBlue = GameRegistry.findItemStack(NATURA, "berryBlue", 1);
|
||||
berryBlack = GameRegistry.findItemStack(NATURA, "berryBlack", 1);
|
||||
berryMalo = GameRegistry.findItemStack(NATURA, "berryMalo", 1);
|
||||
itemBarley = GameRegistry.findItemStack(NATURA, "barleyFood", 1);
|
||||
Item netherBerry = GameRegistry.findItem(NATURA, "berry.nether");
|
||||
Item berry = GameRegistry.findItem(NATURA, "berry");
|
||||
Item barley = GameRegistry.findItem(NATURA, "barleyFood");
|
||||
|
||||
berryBlight = new ItemStack(netherBerry, 1, 0);
|
||||
berryDusk = new ItemStack(netherBerry, 1, 1);
|
||||
berrySky = new ItemStack(netherBerry, 1, 2);
|
||||
berrySting = new ItemStack(netherBerry, 1, 3);
|
||||
berryRasp = new ItemStack(berry, 1, 0);
|
||||
berryBlue = new ItemStack(berry, 1, 1);
|
||||
berryBlack = new ItemStack(berry, 1, 2);
|
||||
berryMalo = new ItemStack(berry, 1, 3);
|
||||
itemBarley = new ItemStack(barley);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -200,8 +202,9 @@ public class PluginNatura extends ForestryPlugin {
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
ItemStack seedBarley = GameRegistry.findItemStack(NATURA, "seedBarley", 1);
|
||||
ItemStack seedCotton = GameRegistry.findItemStack(NATURA, "seedCotton", 1);
|
||||
Item seed = GameRegistry.findItem(NATURA, "barley.seed");
|
||||
ItemStack seedBarley = new ItemStack(seed, 1, 0);
|
||||
ItemStack seedCotton = new ItemStack(seed, 1, 1);
|
||||
|
||||
ArrayList<ItemStack> seedList = new ArrayList<>();
|
||||
if (seedBarley != null) {
|
||||
|
||||
@@ -1,459 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableBasicFruit;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.farming.logic.FarmableStacked;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
|
||||
@Plugin(pluginID = "PlantMegaPack", name = "PlantMegaPack", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.plantmegapack.description")
|
||||
public class PluginPlantMegaPack extends ForestryPlugin {
|
||||
|
||||
private static final String PlantMP = "plantmegapack";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(PlantMP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "Plant Mega Pack not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
|
||||
ImmutableList<String> reedLikePlant = ImmutableList.of(
|
||||
"bambooAsper",
|
||||
"bambooFargesiaRobusta",
|
||||
"bambooGiantTimber",
|
||||
"bambooGolden",
|
||||
"bambooMoso",
|
||||
"bambooShortTassled",
|
||||
"bambooTimorBlack",
|
||||
"bambooTropicalBlue",
|
||||
"bambooWetForest"
|
||||
);
|
||||
|
||||
ImmutableList<String> landCropPlant = ImmutableList.of(
|
||||
"Beet",
|
||||
"BellPepperYellow",
|
||||
"Celery",
|
||||
"Corn",
|
||||
"Cucumber",
|
||||
"Lettuce",
|
||||
"Onion",
|
||||
"Spinach",
|
||||
"Tomato"
|
||||
);
|
||||
|
||||
ImmutableMap<String, Integer> desertPlant = ImmutableMap.<String, Integer>builder()
|
||||
.put("cactusArmatocereusMatucanensis", 6)
|
||||
.put("cactusBaseballBat", 6)
|
||||
.put("cactusEchinocereusMetornii", 2)
|
||||
.put("cactusGoldenCereus", 3)
|
||||
.put("cactusGoldenSaguaro", 6)
|
||||
.put("cactusMatucanaAureiflora", 1)
|
||||
.put("cactusPricklyPear", 5)
|
||||
.put("cactusSnowPole", 6)
|
||||
.put("cactusToothpick", 6)
|
||||
|
||||
.put("desertApachePlume", 4)
|
||||
.put("desertBrittlebush", 4)
|
||||
.put("desertBroadLeafGilia", 4)
|
||||
.put("desertBroomSnakeweed", 4)
|
||||
.put("desertKangarooPaw", 4)
|
||||
.put("desertOcotillo", 4)
|
||||
.put("desertPeninsulaOnion", 4)
|
||||
.put("desertSeepwood", 4)
|
||||
.put("desertWhiteSage", 4)
|
||||
.build();
|
||||
|
||||
ImmutableMap<String, Integer> nonGrowingFlowers = ImmutableMap.<String, Integer>builder()
|
||||
.put("flowerAchillea", 9) // number of flowers in the block, usually meta+1
|
||||
.put("flowerAlpineThistle", 1)
|
||||
.put("flowerAzalea", 13)
|
||||
.put("flowerBegonia", 9)
|
||||
.put("flowerBell", 10)
|
||||
.put("flowerBirdofParadise", 1)
|
||||
.put("flowerBlueStar", 1)
|
||||
.put("flowerBurningLove", 1)
|
||||
.put("flowerCandelabraAloe", 1)
|
||||
.put("flowerCarnation", 7)
|
||||
.put("flowerCelosia", 7)
|
||||
//.put("flowerColumbine", 5) //poisonous
|
||||
.put("flowerDahlia", 8)
|
||||
.put("flowerDaisy", 8)
|
||||
.put("flowerDelphinium", 4)
|
||||
.put("flowerDottedBlazingstar", 1)
|
||||
.put("flowerElephantEars", 1)
|
||||
.put("flowerFoamFlower", 1)
|
||||
.put("flowerFuchsia", 1)
|
||||
.put("flowerGeranium", 5)
|
||||
.put("flowerGladiolus", 9)
|
||||
.put("flowerHawkweed", 4)
|
||||
.put("flowerHydrangea", 6)
|
||||
.put("flowerJacobsLadder", 1)
|
||||
.put("flowerLily", 5)
|
||||
.put("flowerLionsTail", 1)
|
||||
.put("flowerLupine", 10)
|
||||
.put("flowerMarigold", 2)
|
||||
.put("flowerMediterraneanSeaHolly", 1)
|
||||
//.put("flowerMezereon", 1) //poisonous
|
||||
.put("flowerNemesia", 12)
|
||||
.put("flowerNewGuineaImpatiens", 1)
|
||||
.put("flowerParrotsBeak", 1)
|
||||
.put("flowerPeruvianLily", 1)
|
||||
.put("flowerPurpleConeflower", 1)
|
||||
.put("flowerRose", 13)
|
||||
.put("flowerRoseCampion", 1)
|
||||
.put("flowerStreamsideBluebells", 1)
|
||||
.put("flowerTorchLily", 1)
|
||||
.put("flowerTulip", 7)
|
||||
.put("flowerViolet", 1)
|
||||
.put("flowerWildCarrot", 1) //is not actually a carrot
|
||||
.put("flowerWildDaffodil", 1)
|
||||
.put("flowerWoodlandPinkroot", 1)
|
||||
.put("flowerYellowToadflax", 1)
|
||||
.put("floatingWaterHyacinth", 1)
|
||||
.put("floatingWaterLily", 13)
|
||||
.build();
|
||||
|
||||
ImmutableMap<String, Integer> floatingWaterPlant = ImmutableMap.<String, Integer>builder()
|
||||
.put("cropSacredLotus", 4)
|
||||
.put("cropWatercress", 4)
|
||||
.put("cropTaro", 4)
|
||||
.put("cropWasabi", 4)
|
||||
.put("cropLaksaLeaf", 4)
|
||||
.put("cropCentella", 4)
|
||||
.put("cropRice", 4)
|
||||
.put("cropWaterSpinach", 4)
|
||||
.put("cropWildRice", 4)
|
||||
|
||||
.put("immersedArrowArum", 4)
|
||||
.put("immersedCommonReed", 4)
|
||||
.put("immersedDuckPotato", 4)
|
||||
.put("immersedEuropeanBurReed", 4)
|
||||
.put("immersedGreySedge", 4)
|
||||
.put("immersedSimplestemBurReed", 4)
|
||||
.put("immersedSoftstemBulrush", 4)
|
||||
.put("immersedWaterMannagrass", 4)
|
||||
.put("immersedYellowFlag", 4)
|
||||
.build();
|
||||
|
||||
ImmutableMap<String, Integer> fungusPlant = ImmutableMap.<String, Integer>builder()
|
||||
.put("fungusBlackPowderpuff", 1)
|
||||
.put("fungusChanterelle", 1)
|
||||
//.put("fungusDeathCap", 1) poisonous
|
||||
.put("fungusGiantClub", 1)
|
||||
.put("fungusParasol", 2)
|
||||
.put("fungusStinkhorn", 1)
|
||||
.put("fungusWeepingMilkCap", 1)
|
||||
.put("fungusWoodBlewit", 1)
|
||||
//.put("fungusWoollyGomphus", 2) poisonous
|
||||
.build();
|
||||
|
||||
ImmutableMap<String, Integer> junglePlant = ImmutableMap.<String, Integer>builder()
|
||||
.put("jungleConeHeadedGuzmania", 2)
|
||||
.put("jungleDevilsTongue", 6)
|
||||
.put("jungleHoneySpurge", 1)
|
||||
.put("jungleJungleLantern", 6)
|
||||
.put("jungleLazarusBell", 2)
|
||||
.put("jungleLobsterClaws", 6)
|
||||
.put("jungleLollipopPlant", 2)
|
||||
.put("jungleMadagascarPalm", 6)
|
||||
.put("junglePalmLily", 6)
|
||||
.put("junglePanamaQueen", 2)
|
||||
.put("junglePorteaAlatisepala", 2)
|
||||
.put("jungleRacinaeaFraseri", 6)
|
||||
.put("jungleRicheaDracophylla", 2)
|
||||
//.put("jungleShellflower", 4) 2 tall needs specialcase
|
||||
.put("jungleSilverVase", 2)
|
||||
.put("jungleStaghornClubmoss", 2)
|
||||
.put("jungleTorchGinger", 2)
|
||||
.put("jungleVoodooLily", 6)
|
||||
.put("leafyEmeraldPhilodendron", 2) //jungle plant
|
||||
.build();
|
||||
|
||||
ImmutableMap<String, Integer> vanillaPlant = ImmutableMap.<String, Integer>builder()
|
||||
.put("beachHighTideBush", 6)
|
||||
.put("beachSeaLavender", 4)
|
||||
.put("beachSeaSandwort", 4)
|
||||
.put("leafyDustyMiller", 1) //beach plant
|
||||
|
||||
.put("fernCretanBrake", 1)
|
||||
//.put("fernDwarfPalmetto", 0) doesn't grow
|
||||
.put("fernHayScented", 2)
|
||||
.put("fernKangaroo", 2)
|
||||
.put("fernMaidenhairSpleenwort", 3)
|
||||
.put("fernOstrich", 6)
|
||||
.put("fernScalyTree", 6)
|
||||
.put("fernSword", 6)
|
||||
.put("fernWoodsia", 2)
|
||||
|
||||
.put("forestArcticGentian", 1)
|
||||
.put("forestAustralianBugle", 2)
|
||||
.put("forestBroadleafMeadowsweet", 2)
|
||||
.put("forestDeadnettle", 2)
|
||||
.put("forestDeceivingTrillium", 2)
|
||||
.put("forestFairySlipper", 2)
|
||||
.put("forestHorseweed", 2)
|
||||
.put("forestKneelingAngelica", 2)
|
||||
//.put("forestLilyoftheValley", //poisonous
|
||||
.put("forestNorthernPitcherPlant", 2)
|
||||
.put("forestPinesap", 2)
|
||||
.put("forestRedHelleborine", 2)
|
||||
.put("forestSalal", 2)
|
||||
.put("forestVanillaLeaf", 1)
|
||||
.put("forestWesternWallflower", 2)
|
||||
.put("forestWildColumbine", 2)
|
||||
.put("forestWildMint", 2)
|
||||
.put("forestWolfsFootClubmoss", 1)
|
||||
.put("leafyColeus", 1) //forest plant
|
||||
.put("leafyStonecrop", 1) //forest plant
|
||||
|
||||
.put("grassBlueWheatgrass", 1)
|
||||
.put("grassCord", 6)
|
||||
.put("grassFountain", 2)
|
||||
.put("grassMeadow", 2)
|
||||
.put("grassMeadowFoxtail", 1)
|
||||
.put("grassPrairie", 1)
|
||||
.put("grassSilverMoor", 2)
|
||||
.put("grassSwitch", 6)
|
||||
|
||||
.put("mountainAlpineArmeria", 2)
|
||||
.put("mountainAlpineBellflower", 2)
|
||||
.put("mountainBistort", 2)
|
||||
.put("mountainEdelweiss", 2)
|
||||
.put("mountainHouseleek", 2)
|
||||
.put("mountainIris", 1)
|
||||
.put("mountainNorthernWillowherb", 2)
|
||||
.put("mountainScarletTrumpet", 2)
|
||||
.put("mountainYellowBellflower", 1)
|
||||
.put("leafyKrisPlant", 2) // mountain plaint
|
||||
|
||||
.put("plainsPrairieBrome", 6) //skips some metas
|
||||
.put("plainsPrairieSage", 4)
|
||||
.put("plainsReedCanaryGrass", 6) //skips some metas
|
||||
.put("plainsShortrayFleabane", 4)
|
||||
.put("plainsSmallPasqueFlower", 4)
|
||||
.put("plainsSmoothAster", 4)
|
||||
.put("plainsThreeFloweredAvens", 4)
|
||||
.put("leafyPricklyLettuce", 1) //plains plant
|
||||
//.put("leafyStingingNettle", 2) plains plant, poisonous
|
||||
|
||||
.put("savannaButterflyWeed", 2)
|
||||
.put("savannaHoaryVervain", 2)
|
||||
.put("savannaLeadplant", 2)
|
||||
.put("savannaMarcela", 2)
|
||||
.put("savannaNorthernBedstraw", 1)
|
||||
.put("savannaPiersonsMilkVetch", 2)
|
||||
.put("savannaPropellerPlant", 2)
|
||||
.put("savannaShonaCabbage", 2)
|
||||
.put("savannaTexasTickseed", 2)
|
||||
.put("leafyPaleYucca", 2) //savanna Plant
|
||||
.put("leafyDevilsShoestring", 2)
|
||||
|
||||
.put("shrubAlpineCurrant", 2)
|
||||
.put("shrubBarberry", 2)
|
||||
.put("shrubBoxwood", 2)
|
||||
.put("shrubButterfly", 2)
|
||||
.put("shrubCanyonCreekAbelia", 2)
|
||||
.put("shrubCapeJasmine", 2)
|
||||
.put("shrubCedarCylinder", 6)
|
||||
.put("shrubCedarGlobe", 2)
|
||||
.put("shrubCedarPyramid", 6)
|
||||
.put("shrubCypressGreen", 1)
|
||||
.put("shrubCypressYellow", 1)
|
||||
.put("shrubDaphne", 2)
|
||||
//.put("shrubDwarfElder", 4) poisonous, also grows 2 tall at meta 4
|
||||
.put("shrubHolly", 2)
|
||||
.put("shrubHummingbirdBush", 2)
|
||||
.put("shrubJuniperSavin", 2)
|
||||
.put("shrubKerria", 2)
|
||||
.put("shrubLavender", 2)
|
||||
.put("shrubLindera", 3)
|
||||
.put("shrubMeadowsweet", 2)
|
||||
.put("shrubMottlecah", 2)
|
||||
.put("shrubNinebark", 2)
|
||||
.put("shrubSargentViburnum", 2)
|
||||
//.put("shrubSpicebush",2) poisonous
|
||||
.put("shrubWeepingForsythia", 2)
|
||||
.put("shrubWinterberry", 2)
|
||||
.put("shrubWolfWillow", 2)
|
||||
|
||||
.put("wetlandsCattails", 6)
|
||||
.put("wetlandsClubrush", 2)
|
||||
.put("wetlandsCommonRush", 2)
|
||||
.put("wetlandsFloweringRush", 2)
|
||||
.put("wetlandsPickerelweed", 2)
|
||||
.put("wetlandsReedMannagrass", 2)
|
||||
.put("wetlandsSwampMilkweed", 2)
|
||||
.put("wetlandsWaterHorsetail", 1)
|
||||
.put("wetlandsWhiteTurtlehead", 2)
|
||||
.build();
|
||||
|
||||
ImmutableMap<String, Integer> berryBushPlant = ImmutableMap.<String, Integer>builder()
|
||||
.put("Beauty", 4)
|
||||
.put("Black", 4)
|
||||
.put("Blue", 4)
|
||||
.put("Elder", 4)
|
||||
.put("Goose", 4)
|
||||
.put("Huckle", 4)
|
||||
.put("Orange", 4)
|
||||
.put("Snow", 4)
|
||||
.put("Straw", 4)
|
||||
.build();
|
||||
|
||||
ImmutableList<String> waterPlant = ImmutableList.of(
|
||||
"oceanCommonEelgrass",
|
||||
"oceanCoralWeed",
|
||||
"oceanMozuku",
|
||||
"oceanRockweed",
|
||||
"oceanSeaGrapes",
|
||||
"oceanSeaLettuce",
|
||||
"oceanTangle",
|
||||
"riverAmazonSword",
|
||||
"riverCanadianWaterweed",
|
||||
"riverCoonsTail",
|
||||
"riverEelgrass",
|
||||
"riverWaterWisteria",
|
||||
"riverWrightsWaternymph",
|
||||
"waterKelpGiantGRN",
|
||||
"waterKelpGiantYEL"
|
||||
);
|
||||
|
||||
ImmutableMap<String, String> specialCaseTwoTall = ImmutableMap.<String, String>builder()
|
||||
.put("grassSeaOats", FlowerManager.FlowerTypeVanilla)
|
||||
.put("jungleShellflower", FlowerManager.FlowerTypeJungle)
|
||||
.build();
|
||||
|
||||
int seedamount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
|
||||
|
||||
for (String reedLike : reedLikePlant) {
|
||||
Block reedBlock = GameRegistry.findBlock(PlantMP, reedLike);
|
||||
ItemStack reedStack = GameRegistry.findItemStack(PlantMP, reedLike, 1);
|
||||
if (reedBlock != null && reedStack != null) {
|
||||
RecipeUtil.addFermenterRecipes(reedStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
|
||||
Farmables.farmables.get("farmPoales").add(new FarmableStacked(reedBlock, 14, 4));
|
||||
}
|
||||
}
|
||||
|
||||
for (String landCrop : landCropPlant) {
|
||||
Block landCropBlock = GameRegistry.findBlock(PlantMP, "crop" + landCrop);
|
||||
ItemStack seedStack = GameRegistry.findItemStack(PlantMP, "seed" + landCrop, 1);
|
||||
ItemStack foodStack = GameRegistry.findItemStack(PlantMP, "food" + landCrop, 1);
|
||||
if (landCropBlock != null) {
|
||||
if (foodStack != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{foodStack}, Fluids.JUICE.getFluid(juiceAmount));
|
||||
}
|
||||
if (seedStack != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{seedStack}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
}
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(seedStack, landCropBlock, 4));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(landCropBlock, 4));
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Integer> flower : nonGrowingFlowers.entrySet()) {
|
||||
Block flowerPlantBlock = GameRegistry.findBlock(PlantMP, flower.getKey());
|
||||
if (flowerPlantBlock != null) {
|
||||
for (int i = 0; i < flower.getValue(); i++) {
|
||||
FlowerManager.flowerRegistry.registerPlantableFlower(flowerPlantBlock, i, 0.75, FlowerManager.FlowerTypeVanilla);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<String, Integer> wPlant : floatingWaterPlant.entrySet()) {
|
||||
Block waterPlantBlock = GameRegistry.findBlock(PlantMP, wPlant.getKey());
|
||||
if (waterPlantBlock != null) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(waterPlantBlock, wPlant.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 25;
|
||||
juiceAmount = Math.max(juiceAmount, 1); // Produce at least 1 mb of juice.
|
||||
|
||||
for (Map.Entry<String, Integer> berryBushCrop : berryBushPlant.entrySet()) {
|
||||
Block berryBushCropBlock = GameRegistry.findBlock(PlantMP, "berrybush" + berryBushCrop.getKey());
|
||||
ItemStack berryBushStack = GameRegistry.findItemStack(PlantMP, "berrybush" + berryBushCrop.getKey(), 1);
|
||||
ItemStack foodStack = GameRegistry.findItemStack(PlantMP, "berries" + berryBushCrop.getKey(), 1);
|
||||
if (berryBushCropBlock != null) {
|
||||
if (foodStack != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{foodStack}, Fluids.JUICE.getFluid(juiceAmount));
|
||||
}
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(berryBushStack, berryBushCropBlock, berryBushCrop.getValue()));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(berryBushCropBlock, berryBushCrop.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
addMetaFlower(desertPlant, FlowerManager.FlowerTypeCacti, false);
|
||||
addMetaFlower(junglePlant, FlowerManager.FlowerTypeJungle, true);
|
||||
addMetaFlower(vanillaPlant, FlowerManager.FlowerTypeVanilla, true);
|
||||
addMetaFlower(fungusPlant, FlowerManager.FlowerTypeMushrooms, true);
|
||||
|
||||
for (Map.Entry<String, String> special : specialCaseTwoTall.entrySet()) {
|
||||
Block plantBlock = GameRegistry.findBlock(PlantMP, special.getKey());
|
||||
ItemStack specialStack = GameRegistry.findItemStack(PlantMP, special.getKey(), 1);
|
||||
if (plantBlock != null && plantBlock != null) {
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(plantBlock, special.getValue());
|
||||
FlowerManager.flowerRegistry.registerPlantableFlower(plantBlock, 0, 0.75, special.getValue());
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(specialStack, plantBlock, 4));
|
||||
}
|
||||
}
|
||||
|
||||
for (String wPlant : waterPlant) {
|
||||
ItemStack waterPlantStack = GameRegistry.findItemStack(PlantMP, wPlant, 1);
|
||||
if (waterPlantStack != null) {
|
||||
RecipeUtil.addFermenterRecipes(waterPlantStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void addMetaFlower(ImmutableMap<String, Integer> flowerMap, String flowertype, boolean plantable) {
|
||||
for (Map.Entry<String, Integer> flower : flowerMap.entrySet()) {
|
||||
Block flowerBlock = GameRegistry.findBlock(PlantMP, flower.getKey());
|
||||
ItemStack flowerStack = GameRegistry.findItemStack(PlantMP, flower.getKey(), 1);
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(flowerBlock, flowertype);
|
||||
if (plantable && flowerBlock != null) {
|
||||
FlowerManager.flowerRegistry.registerPlantableFlower(flowerBlock, 0, 0.75, flowertype);
|
||||
}
|
||||
if (flowerStack != null && flowerBlock != null) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(flowerStack, flowerBlock, flower.getValue()));
|
||||
if (flower.getValue() < 5) {
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(flowerBlock, flower.getValue()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableBasicFruit;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
|
||||
@Plugin(pluginID = "RotaryCraft", name = "RotaryCraft", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.rotarycraft.description")
|
||||
public class PluginRotaryCraft extends ForestryPlugin {
|
||||
|
||||
private static final String RC = "RotaryCraft";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(RC);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "RotaryCraft not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
|
||||
ItemStack canolaSeed = GameRegistry.findItemStack(RC, "rotarycraft_item_canola", 1);
|
||||
Block canolaCrop = GameRegistry.findBlock(RC, "rotarycraft_block_canola");
|
||||
|
||||
int seedAmount = (ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed") / 16);
|
||||
seedAmount = Math.max(seedAmount, 1); // Produce at least 1 mb.
|
||||
if (canolaSeed != null && canolaCrop != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{canolaSeed}, Fluids.SEEDOIL.getFluid(seedAmount));
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(canolaSeed, canolaCrop, 9));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(canolaCrop, 9));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.logic.FarmableBasicFruit;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.Plugin;
|
||||
|
||||
@Plugin(pluginID = "Witchery", name = "Witchery", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.witchery.description")
|
||||
public class PluginWitchery extends ForestryPlugin {
|
||||
|
||||
private static final String Witch = "witchery";
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(Witch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "Witchery not found";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
|
||||
ImmutableList<String> flowersAccept = ImmutableList.of(
|
||||
"bloodrose",
|
||||
"plantmine",
|
||||
"glintweed"
|
||||
);
|
||||
|
||||
ImmutableMap<String, Integer> cropSeed = ImmutableMap.<String, Integer>builder()
|
||||
.put("belladonna", 4)
|
||||
.put("mandrake", 4)
|
||||
.put("mindrake", 4)
|
||||
.put("snowbell", 4)
|
||||
.put("wolfsbane", 7)
|
||||
.put("wormwood", 4)
|
||||
.build();
|
||||
ImmutableList<String> cropDirect = ImmutableList.of(
|
||||
"garlic" //meta 5
|
||||
);
|
||||
int seedamount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
|
||||
Item saplingItem = GameRegistry.findItem(Witch, "witchsapling");
|
||||
ItemStack saplingStack = new ItemStack(saplingItem, 1, OreDictionary.WILDCARD_VALUE);
|
||||
RecipeUtil.addFermenterRecipes(saplingStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
|
||||
String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem);
|
||||
FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));
|
||||
|
||||
for (String flowerAcceptName : flowersAccept) {
|
||||
Block flowerBlock = GameRegistry.findBlock(Witch, flowerAcceptName);
|
||||
if (flowerBlock != null) {
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(flowerBlock, FlowerManager.FlowerTypeVanilla);
|
||||
}
|
||||
}
|
||||
for (String cropDirectName : cropDirect) {
|
||||
Block cropDirectBlock = GameRegistry.findBlock(Witch, cropDirectName + "plant");
|
||||
ItemStack cropDirectStack = GameRegistry.findItemStack(Witch, cropDirectName, 1);
|
||||
if (cropDirectStack != null && cropDirectBlock != null) {
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(cropDirectStack, cropDirectBlock, 5));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(cropDirectBlock, 5));
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, Integer> cropSeedName : cropSeed.entrySet()) {
|
||||
Block cropSeedBlock = GameRegistry.findBlock(Witch, cropSeedName.getKey());
|
||||
ItemStack cropSeedStack = GameRegistry.findItemStack(Witch, "seeds" + cropSeedName.getKey(), 1);
|
||||
if (cropSeedStack != null && cropSeedBlock != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{cropSeedStack}, Fluids.SEEDOIL.getFluid(seedamount));
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(cropSeedStack, cropSeedBlock, cropSeedName.getValue()));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(cropSeedBlock, cropSeedName.getValue()));
|
||||
}
|
||||
|
||||
}
|
||||
Block artichokeBlock = GameRegistry.findBlock(Witch, "artichoke");
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(artichokeBlock, 4));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user