From cda516a3e3b65f3ed36b7a70a307d5ed8594b44b Mon Sep 17 00:00:00 2001 From: Shawn Buckley Date: Wed, 21 Oct 2015 21:30:33 -0400 Subject: [PATCH] Update to Forestry 4 --- build.properties | 2 +- src/main/java/gregtech/GT_Mod.java | 41 ++++++++----------- .../java/gregtech/common/items/ItemComb.java | 1 - .../loaders/misc/GT_BeeDefinition.java | 1 - .../GT_Loader_Item_Block_And_Fluid.java | 1 - 5 files changed, 19 insertions(+), 27 deletions(-) diff --git a/build.properties b/build.properties index 1a6e24f1..8f49f5af 100644 --- a/build.properties +++ b/build.properties @@ -14,7 +14,7 @@ cofhlib.version=[1.7.10]1.0.0RC7-127 enderio.cf=2219/296 enderio.version=1.7.10-2.3.0.417_beta enderiocore.version=1.7.10-0.1.0.25_beta -forestry.version=3.6.9.28 +forestry.version=4.0.10.39 ic2.version=2.2.780-experimental nei.version=1.0.3.57 railcraft.cf=2219/321 diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index ae7cf434..ec7a6e22 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -15,9 +15,9 @@ import cpw.mods.fml.common.event.FMLServerStartedEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.event.FMLServerStoppingEvent; import cpw.mods.fml.common.registry.EntityRegistry; -import forestry.factory.gadgets.MachineCentrifuge; -import forestry.factory.gadgets.MachineCentrifuge.RecipeManager; -import forestry.factory.gadgets.MachineSqueezer; +import forestry.factory.recipes.ISqueezerRecipe; +import forestry.factory.tiles.TileCentrifuge; +import forestry.factory.tiles.TileSqueezer; import gregtech.api.GregTech_API; import gregtech.api.enchants.Enchantment_EnderDamage; import gregtech.api.enchants.Enchantment_Radioactivity; @@ -54,7 +54,8 @@ import gregtech.loaders.load.GT_FuelLoader; import gregtech.loaders.load.GT_ItemIterator; import gregtech.loaders.load.GT_SonictronLoader; import gregtech.loaders.misc.GT_Achievements; -import gregtech.loaders.misc.GT_BeeDefinition; +//import gregtech.loaders.misc.GT_BeeDefinition; +//import gregtech.loaders.misc.GT_Bees; import gregtech.loaders.misc.GT_Bees; import gregtech.loaders.misc.GT_CoverLoader; import gregtech.loaders.postload.GT_BlockResistanceLoader; @@ -568,24 +569,18 @@ public class GT_Mod } try { - for (Object tRecipe : MachineCentrifuge.RecipeManager.recipes) - { - - - Map outputs = ((MachineCentrifuge.CentrifugeRecipe)tRecipe).getAllProducts(); + for (Object tRecipe : TileCentrifuge.RecipeManager.recipes) + { + Map outputs = ((TileCentrifuge.CentrifugeRecipe)tRecipe).getAllProducts(); ItemStack[] tOutputs = new ItemStack[outputs.size()]; int[] tChances = new int[outputs.size()]; -int i =0; -for (Map.Entry entry : outputs.entrySet()) { - tChances[i] = (int) (entry.getValue()*10000); - tOutputs[i] = entry.getKey().copy(); - i++; -} -// for (int i = 0; i < outputs.size(); i++) { -// tOutputs[i] = outputs.entrySet(). -// tChances[i] = (tOriginalChances[i].intValue() * 100); -// } - GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[] { ((MachineCentrifuge.CentrifugeRecipe)tRecipe).getInput() }, tOutputs, null, tChances, null, null, 128, 5, 0); + int i =0; + for (Map.Entry entry : outputs.entrySet()) { + tChances[i] = (int) (entry.getValue()*10000); + tOutputs[i] = entry.getKey().copy(); + i++; + } + GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.addRecipe(true, new ItemStack[] { ((TileCentrifuge.CentrifugeRecipe)tRecipe).getInput() }, tOutputs, null, tChances, null, null, 128, 5, 0); } } catch (Throwable e) @@ -596,9 +591,9 @@ for (Map.Entry entry : outputs.entrySet()) { } try { - for (Object tRecipe : MachineSqueezer.RecipeManager.recipes) { - if ((((MachineSqueezer.Recipe)tRecipe).resources.length == 1) && (GT_Utility.getFluidForFilledItem(((MachineSqueezer.Recipe)tRecipe).resources[0], true) == null)) { - GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[] { ((MachineSqueezer.Recipe)tRecipe).resources[0] }, new ItemStack[] { ((MachineSqueezer.Recipe)tRecipe).remnants }, null, new int[] { ((MachineSqueezer.Recipe)tRecipe).chance * 100 }, null, new FluidStack[] { ((MachineSqueezer.Recipe)tRecipe).liquid }, 400, 2, 0); + for (Object tRecipe : TileSqueezer.RecipeManager.recipes) { + if ((((ISqueezerRecipe)tRecipe).getResources().length == 1) && (((ISqueezerRecipe)tRecipe).getFluidOutput() != null)) { + GT_Recipe.GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(true, new ItemStack[] { ((ISqueezerRecipe)tRecipe).getResources()[0] }, new ItemStack[] { ((ISqueezerRecipe)tRecipe).getRemnants() }, null, new int[] { (int) (((ISqueezerRecipe)tRecipe).getRemnantsChance() * 10000) }, null, new FluidStack[] { ((ISqueezerRecipe)tRecipe).getFluidOutput() }, 400, 2, 0); } } } diff --git a/src/main/java/gregtech/common/items/ItemComb.java b/src/main/java/gregtech/common/items/ItemComb.java index a36ff7c7..87d9260e 100644 --- a/src/main/java/gregtech/common/items/ItemComb.java +++ b/src/main/java/gregtech/common/items/ItemComb.java @@ -15,7 +15,6 @@ import net.minecraft.util.IIcon; import forestry.api.core.ForestryAPI; import forestry.api.core.Tabs; import forestry.api.recipes.RecipeManagers; -import forestry.factory.gadgets.MachineCentrifuge.RecipeManager; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; diff --git a/src/main/java/gregtech/loaders/misc/GT_BeeDefinition.java b/src/main/java/gregtech/loaders/misc/GT_BeeDefinition.java index f7a6e23f..ce609519 100644 --- a/src/main/java/gregtech/loaders/misc/GT_BeeDefinition.java +++ b/src/main/java/gregtech/loaders/misc/GT_BeeDefinition.java @@ -5,7 +5,6 @@ import java.util.Locale; import org.apache.commons.lang3.text.WordUtils; -import crazypants.util.OreDictionaryHelper; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import forestry.api.apiculture.BeeManager; diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java b/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java index fbe56321..a4a0f909 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_Item_Block_And_Fluid.java @@ -4,7 +4,6 @@ import codechicken.nei.api.API; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameRegistry; -import crazypants.util.OreDictionaryHelper; import gregtech.GT_Mod; import gregtech.api.GregTech_API; import gregtech.api.enums.ConfigCategories;