First 1.8.9 Version

This commit is contained in:
Nedelosk committed 2016-01-22 19:33:35 +01:00
1 parent d35cc1df09
commit 5a3850c264
1657 files changed
+26844 -13269

No files matched your search

@@ -16,10 +16,8 @@ import java.util.Random;
import net.minecraft.command.ICommand;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.fml.common.IFuelHandler;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
import forestry.core.IPickupHandler;
import forestry.core.IResupplyHandler;
import forestry.core.ISaveEventHandler;
@@ -21,11 +21,12 @@ import java.util.Random;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
@@ -35,24 +36,22 @@ import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.Forestry;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeType;
import forestry.api.apiculture.FlowerManager;
import forestry.api.apiculture.IBeekeepingMode;
import forestry.api.apiculture.hives.HiveManager;
import forestry.api.apiculture.hives.IHiveRegistry.HiveType;
import forestry.api.core.ForestryAPI;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IClassification;
@@ -64,7 +63,6 @@ import forestry.api.storage.ICrateRegistry;
import forestry.api.storage.StorageManager;
import forestry.apiculture.ArmorApiaristHelper;
import forestry.apiculture.SaveEventHandlerApiculture;
import forestry.apiculture.VillageHandlerApiculture;
import forestry.apiculture.blocks.BlockAlveary;
import forestry.apiculture.blocks.BlockApicultureType;
import forestry.apiculture.blocks.BlockCandle;
@@ -116,6 +114,7 @@ import forestry.core.proxy.Proxies;
import forestry.core.recipes.RecipeUtil;
import forestry.core.tiles.MachineDefinition;
import forestry.core.utils.EntityUtil;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.Log;
import forestry.core.utils.Stack;
import forestry.core.utils.StringUtil;
@@ -196,10 +195,10 @@ public class PluginApiculture extends ForestryPlugin {
ApicultureTriggers.initialize();
}
if (Config.enableVillagers) {
/*if (Config.enableVillagers) {
// Register village components with the Structure registry.
VillageHandlerApiculture.registerVillageComponents();
}
}*/
// Commands
PluginCore.rootCommand.addChildCommand(new CommandBee());
@@ -300,14 +299,14 @@ public class PluginApiculture extends ForestryPlugin {
BeeManager.villageBees[1].add(BeeDefinition.COMMON.getGenome());
BeeManager.villageBees[1].add(BeeDefinition.VALIANT.getGenome());
if (Config.enableVillagers) {
/*if (Config.enableVillagers) {
// Register villager stuff
VillageHandlerApiculture villageHandler = new VillageHandlerApiculture();
VillagerRegistry.instance().registerVillageCreationHandler(villageHandler);
VillagerRegistry.instance().registerVillagerId(Constants.ID_VILLAGER_BEEKEEPER);
Proxies.render.registerVillagerSkin(Constants.ID_VILLAGER_BEEKEEPER, Constants.TEXTURE_SKIN_BEEKPEEPER);
VillagerRegistry.instance().registerVillageTradeHandler(Constants.ID_VILLAGER_BEEKEEPER, villageHandler);
}
}*/
proxy.initializeRendering();
@@ -356,7 +355,7 @@ public class PluginApiculture extends ForestryPlugin {
List<String> plantableFlowerNames = new ArrayList<>();
if (flowers != null) {
for (IFlower flower : flowers) {
String name = GameData.getBlockRegistry().getNameForObject(flower.getBlock());
String name = ItemStackUtil.getBlockNameFromRegistryAsSting(flower.getBlock());
if (name == null) {
Log.severe("Could not find name for flower: " + flower + " with type: " + flowerType);
continue;
@@ -560,7 +559,7 @@ public class PluginApiculture extends ForestryPlugin {
'I', "ingotIron",
'G', "blockGlass");
// STABILISER
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.Type.STABILIZER),
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.Type.STABILISER),
"G G",
"GXG",
"G G",
@@ -747,42 +746,42 @@ public class PluginApiculture extends ForestryPlugin {
private static void registerBeehiveDrops() {
ItemStack honeyComb = items.beeComb.get(EnumHoneyComb.HONEY, 1);
hiveRegistry.addDrops(HiveRegistry.forest,
hiveRegistry.addDrops(HiveType.FOREST.getHiveName(),
new HiveDrop(80, BeeDefinition.FOREST, honeyComb).setIgnobleShare(0.7f),
new HiveDrop(8, BeeDefinition.FOREST.getRainResist(), honeyComb),
new HiveDrop(3, BeeDefinition.VALIANT, honeyComb)
);
hiveRegistry.addDrops(HiveRegistry.meadows,
hiveRegistry.addDrops(HiveType.MEADOWS.getHiveName(),
new HiveDrop(80, BeeDefinition.MEADOWS, honeyComb).setIgnobleShare(0.7f),
new HiveDrop(3, BeeDefinition.VALIANT, honeyComb)
);
ItemStack parchedComb = items.beeComb.get(EnumHoneyComb.PARCHED, 1);
hiveRegistry.addDrops(HiveRegistry.desert,
hiveRegistry.addDrops(HiveType.DESERT.getHiveName(),
new HiveDrop(80, BeeDefinition.MODEST, parchedComb).setIgnobleShare(0.7f),
new HiveDrop(3, BeeDefinition.VALIANT, parchedComb)
);
ItemStack silkyComb = items.beeComb.get(EnumHoneyComb.SILKY, 1);
hiveRegistry.addDrops(HiveRegistry.jungle,
hiveRegistry.addDrops(HiveType.JUNGLE.getHiveName(),
new HiveDrop(80, BeeDefinition.TROPICAL, silkyComb).setIgnobleShare(0.7f),
new HiveDrop(3, BeeDefinition.VALIANT, silkyComb)
);
ItemStack mysteriousComb = items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1);
hiveRegistry.addDrops(HiveRegistry.end,
hiveRegistry.addDrops(HiveType.END.getHiveName(),
new HiveDrop(90, BeeDefinition.ENDED, mysteriousComb)
);
ItemStack frozenComb = items.beeComb.get(EnumHoneyComb.FROZEN, 1);
hiveRegistry.addDrops(HiveRegistry.snow,
hiveRegistry.addDrops(HiveType.SNOW.getHiveName(),
new HiveDrop(80, BeeDefinition.WINTRY, frozenComb).setIgnobleShare(0.5f),
new HiveDrop(3, BeeDefinition.VALIANT, frozenComb)
);
ItemStack mossyComb = items.beeComb.get(EnumHoneyComb.MOSSY, 1);
hiveRegistry.addDrops(HiveRegistry.swamp,
hiveRegistry.addDrops(HiveType.SWAMP.getHiveName(),
new HiveDrop(80, BeeDefinition.MARSHY, mossyComb).setIgnobleShare(0.4f),
new HiveDrop(3, BeeDefinition.VALIANT, mossyComb)
);
@@ -816,13 +815,13 @@ public class PluginApiculture extends ForestryPlugin {
}
private static void createHives() {
hiveRegistry.registerHive(HiveRegistry.forest, HiveDescription.FOREST);
hiveRegistry.registerHive(HiveRegistry.meadows, HiveDescription.MEADOWS);
hiveRegistry.registerHive(HiveRegistry.desert, HiveDescription.DESERT);
hiveRegistry.registerHive(HiveRegistry.jungle, HiveDescription.JUNGLE);
hiveRegistry.registerHive(HiveRegistry.end, HiveDescription.END);
hiveRegistry.registerHive(HiveRegistry.snow, HiveDescription.SNOW);
hiveRegistry.registerHive(HiveRegistry.swamp, HiveDescription.SWAMP);
hiveRegistry.registerHive(HiveType.FOREST.getHiveName(), HiveDescription.FOREST);
hiveRegistry.registerHive(HiveType.MEADOWS.getHiveName(), HiveDescription.MEADOWS);
hiveRegistry.registerHive(HiveType.DESERT.getHiveName(), HiveDescription.DESERT);
hiveRegistry.registerHive(HiveType.JUNGLE.getHiveName(), HiveDescription.JUNGLE);
hiveRegistry.registerHive(HiveType.END.getHiveName(), HiveDescription.END);
hiveRegistry.registerHive(HiveType.SNOW.getHiveName(), HiveDescription.SNOW);
hiveRegistry.registerHive(HiveType.SWAMP.getHiveName(), HiveDescription.SWAMP);
}
private static void createAlleles() {
@@ -926,11 +925,9 @@ public class PluginApiculture extends ForestryPlugin {
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Pre event) {
if (event.map.getTextureType() == 1) {
EntityFXSnow.icons = new IIcon[3];
for (int i = 0; i < EntityFXSnow.icons.length; i++) {
EntityFXSnow.icons[i] = event.map.registerIcon("forestry:particles/snow." + (i + 1));
}
EntityFXSnow.sprites = new TextureAtlasSprite[3];
for (int i = 0; i < EntityFXSnow.sprites.length; i++) {
EntityFXSnow.sprites[i] = event.map.registerSprite(new ResourceLocation("forestry:items/particles/snow." + (i + 1)));
}
}
}
@@ -19,21 +19,18 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.ChestGenHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.FuelBurnTimeEvent;
import net.minecraftforge.fml.common.IFuelHandler;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import forestry.api.arboriculture.EnumGermlingType;
import forestry.api.arboriculture.EnumWoodType;
import forestry.api.arboriculture.TreeManager;
@@ -43,9 +40,9 @@ import forestry.api.recipes.RecipeManagers;
import forestry.api.storage.ICrateRegistry;
import forestry.api.storage.StorageManager;
import forestry.arboriculture.IWoodTyped;
import forestry.arboriculture.VillageHandlerArboriculture;
import forestry.arboriculture.WoodItemAccess;
import forestry.arboriculture.blocks.BlockArboricultureType;
import forestry.arboriculture.blocks.BlockFruitPod;
import forestry.arboriculture.blocks.BlockRegistryArboriculture;
import forestry.arboriculture.commands.CommandTree;
import forestry.arboriculture.genetics.TreeBranchDefinition;
@@ -54,19 +51,18 @@ import forestry.arboriculture.genetics.TreeFactory;
import forestry.arboriculture.genetics.TreeHelper;
import forestry.arboriculture.genetics.TreeMutationFactory;
import forestry.arboriculture.genetics.TreekeepingMode;
import forestry.arboriculture.genetics.alleles.AlleleFruit;
import forestry.arboriculture.genetics.alleles.AlleleGrowth;
import forestry.arboriculture.genetics.alleles.AlleleLeafEffect;
import forestry.arboriculture.items.ItemRegistryArboriculture;
import forestry.arboriculture.network.PacketRegistryArboriculture;
import forestry.arboriculture.proxy.ProxyArboriculture;
import forestry.arboriculture.render.TextureLeaves;
import forestry.arboriculture.tiles.TileArboristChest;
import forestry.arboriculture.tiles.TileFruitPod;
import forestry.arboriculture.tiles.TileLeaves;
import forestry.arboriculture.tiles.TileSapling;
import forestry.arboriculture.tiles.TileWood;
import forestry.core.blocks.BlockCoreType;
import forestry.core.config.Config;
import forestry.core.config.Constants;
import forestry.core.fluids.Fluids;
import forestry.core.genetics.alleles.AllelePlantType;
@@ -75,6 +71,7 @@ import forestry.core.network.IPacketRegistry;
import forestry.core.proxy.Proxies;
import forestry.core.recipes.RecipeUtil;
import forestry.core.tiles.MachineDefinition;
import forestry.core.utils.ItemStackUtil;
import forestry.factory.recipes.FabricatorRecipe;
@Plugin(pluginID = "Arboriculture", name = "Arboriculture", author = "Binnie & SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.arboriculture.description")
@@ -84,10 +81,6 @@ public class PluginArboriculture extends ForestryPlugin {
public static ProxyArboriculture proxy;
public static String treekeepingMode = "NORMAL";
public static int modelIdSaplings;
public static int modelIdLeaves;
public static int modelIdPods;
public static final List<Block> validFences = new ArrayList<>();
public static ItemRegistryArboriculture items;
@@ -124,7 +117,6 @@ public class PluginArboriculture extends ForestryPlugin {
public void preInit() {
super.preInit();
// register for FuelBurnTimeEvent
MinecraftForge.EVENT_BUS.register(this);
for (EnumWoodType woodType : EnumWoodType.VALUES) {
@@ -147,13 +139,23 @@ public class PluginArboriculture extends ForestryPlugin {
blocks.arboriculture.addDefinition(definitionChest);
// Init rendering
proxy.initializeRendering();
proxy.initializeModels();
// Register vanilla and forestry fence ids
validFences.add(blocks.fences);
validFences.add(blocks.fencesFireproof);
validFences.add(Blocks.fence);
validFences.add(Blocks.fence_gate);
validFences.add(Blocks.oak_fence);
validFences.add(Blocks.spruce_fence);
validFences.add(Blocks.birch_fence);
validFences.add(Blocks.jungle_fence);
validFences.add(Blocks.dark_oak_fence);
validFences.add(Blocks.acacia_fence);
validFences.add(Blocks.oak_fence_gate);
validFences.add(Blocks.spruce_fence_gate);
validFences.add(Blocks.birch_fence_gate);
validFences.add(Blocks.jungle_fence_gate);
validFences.add(Blocks.dark_oak_fence_gate);
validFences.add(Blocks.acacia_fence_gate);
validFences.add(Blocks.nether_brick_fence);
// Commands
@@ -176,11 +178,11 @@ public class PluginArboriculture extends ForestryPlugin {
blocks.arboriculture.init();
if (Config.enableVillagers) {
/*if (Config.enableVillagers) {
VillagerRegistry.instance().registerVillagerId(Constants.ID_VILLAGER_LUMBERJACK);
Proxies.render.registerVillagerSkin(Constants.ID_VILLAGER_LUMBERJACK, Constants.TEXTURE_SKIN_LUMBERJACK);
VillagerRegistry.instance().registerVillageTradeHandler(Constants.ID_VILLAGER_LUMBERJACK, new VillageHandlerArboriculture());
}
}*/
}
@Override
@@ -345,7 +347,6 @@ public class PluginArboriculture extends ForestryPlugin {
TreeBranchDefinition.createAlleles();
AlleleFruit.createAlleles();
AlleleGrowth.createAlleles();
AlleleLeafEffect.createAlleles();
AllelePlantType.createAlleles();
@@ -380,7 +381,7 @@ public class PluginArboriculture extends ForestryPlugin {
@Override
public boolean processIMCMessage(IMCMessage message) {
if (message.key.equals("add-fence-block") && message.isStringMessage()) {
Block block = GameData.getBlockRegistry().getRaw(message.getStringValue());
Block block = ItemStackUtil.getBlockFromRegistry(message.getStringValue());
if (block != null && block != Blocks.air) {
validFences.add(block);
@@ -418,12 +419,30 @@ public class PluginArboriculture extends ForestryPlugin {
if (items.sapling == item) {
return 100;
}
Block block = Block.getBlockFromItem(item);
if (block instanceof IWoodTyped) {
IWoodTyped woodTypedBlock = (IWoodTyped) block;
if (woodTypedBlock.isFireproof()) {
return 0;
} else if (blocks.slabs == block) {
return 150;
}
}
return 0;
}
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Pre event) {
TextureLeaves.registerAllSprites();
BlockFruitPod.registerSprites();
}
/*@SubscribeEvent
public void fuelBurnTimeEvent(FuelBurnTimeEvent fuelBurnTimeEvent) {
Item item = fuelBurnTimeEvent.fuel.getItem();
Block block = Block.getBlockFromItem(item);
@@ -438,5 +457,5 @@ public class PluginArboriculture extends ForestryPlugin {
fuelBurnTimeEvent.setResult(Event.Result.DENY);
}
}
}
}*/
}
+17 -8
View File
@@ -10,17 +10,20 @@
******************************************************************************/
package forestry.plugins;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.command.ICommand;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.IFuelHandler;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.IFuelHandler;
import forestry.api.circuits.ChipsetManager;
import forestry.api.core.ForestryAPI;
import forestry.api.genetics.AlleleManager;
@@ -52,8 +55,8 @@ import forestry.core.items.ItemRegistryCore;
import forestry.core.multiblock.MultiblockLogicFactory;
import forestry.core.network.IPacketRegistry;
import forestry.core.network.PacketRegistryCore;
import forestry.core.proxy.Proxies;
import forestry.core.recipes.RecipeUtil;
import forestry.core.render.model.RenderHandler;
import forestry.core.tiles.MachineDefinition;
import forestry.core.utils.ClimateUtil;
import forestry.core.utils.ForestryModEnvWarningCallable;
@@ -92,6 +95,8 @@ public class PluginCore extends ForestryPlugin {
@Override
public void preInit() {
super.preInit();
MinecraftForge.EVENT_BUS.register(this);
rootCommand.addChildCommand(new CommandVersion());
rootCommand.addChildCommand(new CommandPlugins());
@@ -106,8 +111,6 @@ public class PluginCore extends ForestryPlugin {
public void doInit() {
super.doInit();
Proxies.render.init();
blocks.core.init();
ForestryModEnvWarningCallable.register();
@@ -211,7 +214,7 @@ public class PluginCore extends ForestryPlugin {
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.can"), " # ", "# #", '#', "ingotTin");
// / GEARS
ArrayList<ItemStack> stoneGear = OreDictionary.getOres("gearStone");
List<ItemStack> stoneGear = OreDictionary.getOres("gearStone");
Object gearCenter;
if (!stoneGear.isEmpty()) {
gearCenter = "gearStone";
@@ -324,4 +327,10 @@ public class PluginCore extends ForestryPlugin {
return 0;
}
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onBakeModel(ModelBakeEvent event) {
RenderHandler.registerModels(event);
}
}
@@ -12,9 +12,7 @@ package forestry.plugins;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import cpw.mods.fml.common.SidedProxy;
import net.minecraftforge.fml.common.SidedProxy;
import forestry.api.core.ForestryAPI;
import forestry.core.config.Constants;
import forestry.core.recipes.RecipeUtil;
@@ -22,12 +22,14 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.registry.GameData;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import forestry.api.circuits.ChipsetManager;
import forestry.api.circuits.CircuitSocketType;
import forestry.api.circuits.ICircuitLayout;
@@ -38,9 +40,10 @@ import forestry.core.circuits.CircuitLayout;
import forestry.core.config.Constants;
import forestry.core.items.EnumElectronTube;
import forestry.core.recipes.RecipeUtil;
import forestry.core.utils.ItemStackUtil;
import forestry.core.utils.Log;
import forestry.farming.blocks.BlockFarmType;
import forestry.farming.blocks.BlockRegistryFarming;
import forestry.farming.blocks.EnumBlockFarmType;
import forestry.farming.circuits.CircuitFarmLogic;
import forestry.farming.logic.FarmLogicArboreal;
import forestry.farming.logic.FarmLogicCereal;
@@ -87,6 +90,8 @@ public class PluginFarming extends ForestryPlugin {
@Override
public void preInit() {
super.preInit();
MinecraftForge.EVENT_BUS.register(this);
Farmables.farmables.put("farmArboreal", new ArrayList<IFarmable>());
Farmables.farmables.get("farmArboreal").add(new FarmableVanillaSapling());
@@ -124,7 +129,7 @@ public class PluginFarming extends ForestryPlugin {
Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(new ItemStack(Items.potato), Blocks.potatoes, 7));
Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(new ItemStack(Items.carrot), Blocks.carrots, 7));
proxy.initializeRendering();
proxy.initializeModels();
// Layouts
ICircuitLayout layoutManaged = new CircuitLayout("farms.managed", CircuitSocketType.FARM);
@@ -200,7 +205,7 @@ public class PluginFarming extends ForestryPlugin {
String windfallMetaString = matchResult.group(4);
try {
Block sapling = GameData.getBlockRegistry().getRaw(saplingString);
Block sapling = ItemStackUtil.getBlockFromRegistry(saplingString);
if (sapling == null || sapling == Blocks.air) {
throw new RuntimeException("can't find block for " + saplingString);
}
@@ -209,7 +214,7 @@ public class PluginFarming extends ForestryPlugin {
if (windfallString == null) {
farmables.add(new FarmableGenericSapling(sapling, saplingMeta));
} else {
Item windfall = GameData.getItemRegistry().getRaw(windfallString);
Item windfall = ItemStackUtil.getItemFromRegistry(windfallString);
if (windfall == null) {
throw new RuntimeException("can't find item for " + windfallString);
}
@@ -244,11 +249,11 @@ public class PluginFarming extends ForestryPlugin {
}
try {
Item seed = GameData.getItemRegistry().getRaw(items[0]);
Item seed = ItemStackUtil.getItemFromRegistry(items[0]);
if (seed == null) {
throw new RuntimeException("can't find item for " + items[0]);
}
Block crop = GameData.getBlockRegistry().getRaw(items[2]);
Block crop = ItemStackUtil.getBlockFromRegistry(items[2]);
if (crop == null || crop == Blocks.air) {
throw new RuntimeException("can't find block for " + items[2]);
}
@@ -270,11 +275,11 @@ public class PluginFarming extends ForestryPlugin {
@Override
protected void registerRecipes() {
ItemStack basic = blocks.farm.get(BlockFarmType.BASIC, 1);
ItemStack gearbox = blocks.farm.get(BlockFarmType.GEARBOX, 1);
ItemStack hatch = blocks.farm.get(BlockFarmType.HATCH, 1);
ItemStack valve = blocks.farm.get(BlockFarmType.VALVE, 1);
ItemStack control = blocks.farm.get(BlockFarmType.CONTROL, 1);
ItemStack basic = blocks.farm.get(EnumBlockFarmType.BASIC, 1);
ItemStack gearbox = blocks.farm.get(EnumBlockFarmType.GEARBOX, 1);
ItemStack hatch = blocks.farm.get(EnumBlockFarmType.HATCH, 1);
ItemStack valve = blocks.farm.get(EnumBlockFarmType.VALVE, 1);
ItemStack control = blocks.farm.get(EnumBlockFarmType.CONTROL, 1);
for (EnumFarmBlockTexture block : EnumFarmBlockTexture.values()) {
NBTTagCompound compound = new NBTTagCompound();
@@ -343,4 +348,10 @@ public class PluginFarming extends ForestryPlugin {
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.APATITE, 1), Circuit.farmShroomManual);
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.LAPIS, 1), Circuit.farmCocoaManual);
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void handleTextureRemap(TextureStitchEvent.Pre event) {
EnumFarmBlockTexture.registerSprites();
}
}
@@ -19,19 +19,14 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.fml.common.eventhandler.Event;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import forestry.api.core.ForestryAPI;
import forestry.api.fuels.FuelManager;
import forestry.api.fuels.GeneratorFuel;
@@ -44,6 +39,8 @@ import forestry.core.fluids.LiquidRegistryHelper;
import forestry.core.items.EnumContainerType;
import forestry.core.items.ItemLiquidContainer;
import forestry.core.items.ItemRegistryFluids;
import forestry.core.proxy.Proxies;
import forestry.core.utils.BlockUtil;
import forestry.core.utils.Log;
import forestry.core.utils.StringUtil;
@@ -58,7 +55,9 @@ public class PluginFluids extends ForestryPlugin {
if (forestryFluid.getFluid() == null && Config.isFluidEnabled(forestryFluid)) {
String fluidName = forestryFluid.getTag();
if (!FluidRegistry.isFluidRegistered(fluidName)) {
Fluid fluid = new Fluid(fluidName).setDensity(forestryFluid.getDensity()).setViscosity(forestryFluid.getViscosity()).setTemperature(forestryFluid.getTemperature());
Fluid fluid = new Fluid(fluidName,
forestryFluid.getResources()[0], forestryFluid.flowTextureExists() ? forestryFluid.getResources()[1]
: forestryFluid.getResources()[0]).setDensity(forestryFluid.getDensity()).setViscosity(forestryFluid.getViscosity()).setTemperature(forestryFluid.getTemperature());
FluidRegistry.registerFluid(fluid);
createBlock(forestryFluid);
}
@@ -73,9 +72,10 @@ public class PluginFluids extends ForestryPlugin {
if (fluidBlock == null) {
fluidBlock = forestryFluid.makeBlock();
if (fluidBlock != null) {
fluidBlock.setBlockName("forestry.fluid." + forestryFluid.getTag());
fluidBlock.setUnlocalizedName("forestry.fluid." + forestryFluid.getTag());
GameRegistry.registerBlock(fluidBlock, ItemBlock.class, StringUtil.cleanBlockName(fluidBlock));
forestryFluidsWithBlocks.add(forestryFluid);
Proxies.render.registerFluidStateMapper(fluidBlock, forestryFluid);
}
} else {
GameRegistry.UniqueIdentifier blockID = GameRegistry.findUniqueIdentifierFor(fluidBlock);
@@ -97,7 +97,6 @@ public class PluginFluids extends ForestryPlugin {
@Override
public void preInit() {
MinecraftForge.EVENT_BUS.register(getTextureHook());
MinecraftForge.EVENT_BUS.register(getFillBucketHook());
}
@@ -152,41 +151,18 @@ public class PluginFluids extends ForestryPlugin {
}
}
public static class TextureHook {
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Post event) {
if (event.map.getTextureType() == 0) {
for (Fluids fluidType : forestryFluidsWithBlocks) {
Fluid fluid = fluidType.getFluid();
Block fluidBlock = fluidType.getBlock();
if (fluid != null && fluidBlock != null) {
fluid.setIcons(fluidBlock.getBlockTextureFromSide(1), fluidBlock.getBlockTextureFromSide(2));
}
}
}
}
}
private static Object getTextureHook() {
return new TextureHook();
}
public static class FillBucketHook {
@SubscribeEvent
public void fillBucket(FillBucketEvent event) {
MovingObjectPosition movingObjectPosition = event.target;
int x = movingObjectPosition.blockX;
int y = movingObjectPosition.blockY;
int z = movingObjectPosition.blockZ;
Block targetedBlock = event.world.getBlock(x, y, z);
Block targetedBlock = BlockUtil.getBlock(event.world, event.target.getBlockPos());
if (targetedBlock instanceof BlockForestryFluid) {
Item filledBucket = ItemLiquidContainer.getExistingBucket(targetedBlock);
if (filledBucket != null) {
event.result = new ItemStack(filledBucket);
event.setResult(Event.Result.ALLOW);
if (!event.world.isRemote) {
event.world.setBlockToAir(x, y, z);
event.world.setBlockToAir(event.target.getBlockPos());
}
}
}
@@ -15,12 +15,15 @@ import java.util.EnumSet;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.RecipeSorter;
import cpw.mods.fml.common.SidedProxy;
import forestry.Forestry;
import forestry.api.arboriculture.TreeManager;
import forestry.api.genetics.AlleleManager;
@@ -43,6 +46,7 @@ import forestry.lepidopterology.genetics.ButterflyDefinition;
import forestry.lepidopterology.genetics.ButterflyFactory;
import forestry.lepidopterology.genetics.ButterflyHelper;
import forestry.lepidopterology.genetics.MothDefinition;
import forestry.lepidopterology.items.ItemButterflyGE;
import forestry.lepidopterology.items.ItemRegistryLepidopterology;
import forestry.lepidopterology.proxy.ProxyLepidopterology;
import forestry.lepidopterology.recipes.MatingRecipe;
@@ -78,6 +82,8 @@ public class PluginLepidopterology extends ForestryPlugin {
@Override
public void preInit() {
MinecraftForge.EVENT_BUS.register(this);
ButterflyBranchDefinition.createAlleles();
AlleleButterflyEffect.createAlleles();
@@ -144,4 +150,10 @@ public class PluginLepidopterology extends ForestryPlugin {
public static boolean isPollinationAllowed() {
return allowPollination;
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Pre event) {
ItemButterflyGE.registerSprites();
}
}
@@ -12,9 +12,7 @@ package forestry.plugins;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
import forestry.api.mail.EnumAddressee;
import forestry.api.mail.PostManager;
import forestry.api.recipes.RecipeManagers;
@@ -31,36 +31,22 @@ import net.minecraft.world.chunk.IChunkProvider;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import cpw.mods.fml.common.IFuelHandler;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.common.IFuelHandler;
import net.minecraftforge.fml.common.event.FMLInterModComms;
import net.minecraftforge.fml.common.registry.GameRegistry;
import forestry.Forestry;
import forestry.api.core.ForestryAPI;
import forestry.core.IPickupHandler;
import forestry.core.IResupplyHandler;
import forestry.core.ISaveEventHandler;
import forestry.core.utils.Log;
import forestry.plugins.compat.PluginAgriCraft;
import forestry.plugins.compat.PluginBiomesOPlenty;
import forestry.plugins.compat.PluginBuildCraftFuels;
import forestry.plugins.compat.PluginBuildCraftRecipes;
import forestry.plugins.compat.PluginBuildCraftStatements;
import forestry.plugins.compat.PluginBuildCraftTransport;
import forestry.plugins.compat.PluginChisel;
import forestry.plugins.compat.PluginEnderIO;
import forestry.plugins.compat.PluginErebus;
import forestry.plugins.compat.PluginExtraUtilities;
import forestry.plugins.compat.PluginGrowthCraft;
import forestry.plugins.compat.PluginHarvestCraft;
import forestry.plugins.compat.PluginIC2;
import forestry.plugins.compat.PluginImmersiveEngineering;
import forestry.plugins.compat.PluginMagicalCrops;
import forestry.plugins.compat.PluginNatura;
import forestry.plugins.compat.PluginPlantMegaPack;
import forestry.plugins.compat.PluginRotaryCraft;
import forestry.plugins.compat.PluginWitchery;
public class PluginManager {
@@ -104,21 +90,21 @@ public class PluginManager {
BUILDCRAFT_STATEMENTS(new PluginBuildCraftStatements()),
BUILDCRAFT_TRANSPORT(new PluginBuildCraftTransport()),
AGRICRAFT(new PluginAgriCraft()),
//AGRICRAFT(new PluginAgriCraft()),
BIOMESOPLENTY(new PluginBiomesOPlenty()),
CHISEL(new PluginChisel()),
ENDERIO(new PluginEnderIO()),
/*ENDERIO(new PluginEnderIO()),
EREBUS(new PluginErebus()),
EXTRAUTILITIES(new PluginExtraUtilities()),
GROWTHCRAFT(new PluginGrowthCraft()),
HARVESTCRAFT(new PluginHarvestCraft()),
IMMERSIVEENGINEERING(new PluginImmersiveEngineering()),
INDUSTRIALCRAFT(new PluginIC2()),
MAGICALCROPS(new PluginMagicalCrops()),
MAGICALCROPS(new PluginMagicalCrops()),*/
NATURA(new PluginNatura()),
PLANTMEGAPACK(new PluginPlantMegaPack()),
/*PLANTMEGAPACK(new PluginPlantMegaPack()),
ROTARYCRAFT(new PluginRotaryCraft()),
WITCHERY(new PluginWitchery());
WITCHERY(new PluginWitchery())*/;
static {
ForestryAPI.enabledPlugins = new HashSet<>();
@@ -40,16 +40,14 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemDoor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.IShearable;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import forestry.Forestry;
import forestry.api.recipes.RecipeManagers;
import forestry.api.storage.BackpackManager;
@@ -83,7 +81,7 @@ public class PluginStorage extends ForestryPlugin {
private static final List<ItemCrated> crates = new ArrayList<>();
private static final String CONFIG_CATEGORY = "backpacks";
@SidedProxy(clientSide = "forestry.storage.proxy.ProxyStorageClient", serverSide = "forestry.storage.proxy.ProxyStorage")
public static ProxyStorage proxy;
private final ArrayList<ItemStack> minerItems = new ArrayList<>();
@@ -142,6 +140,8 @@ public class PluginStorage extends ForestryPlugin {
definition = new BackpackDefinition("builder", new Color(0xdd3a3a).getRGB());
BackpackManager.definitions.put(definition.getKey(), definition);
proxy.registerCrateModelLoader();
}
@Override
@@ -347,7 +347,7 @@ public class PluginStorage extends ForestryPlugin {
new ItemStack(Items.magma_cream),
new ItemStack(Items.speckled_melon),
new ItemStack(Items.fish),
new ItemStack(Items.cooked_fished),
new ItemStack(Items.cooked_fish),
new ItemStack(Items.lead),
new ItemStack(Items.fishing_rod),
new ItemStack(Items.name_tag),
@@ -435,7 +435,6 @@ public class PluginStorage extends ForestryPlugin {
}
public static void registerCrate(ItemCrated crate) {
proxy.registerCrateForRendering(crate);
crates.add(crate);
}
@@ -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));
}
}