diff options
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java | 14 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java | 56 |
2 files changed, 54 insertions, 16 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java index 45a24657c6..86ce88311e 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechComponentAssembler.java @@ -10,6 +10,7 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachin import gregtech.api.util.Recipe_GT; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.item.ItemUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.init.Items; @@ -19,6 +20,12 @@ import net.minecraftforge.oredict.OreDictionary; public class GregtechComponentAssembler { public static void run() { + + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){ + Utils.LOG_INFO("Component Assemblers cannot be created in 5.08.33 during the pre-release. Please wait for 1.7.0 release."); + return; + } + GregtechItemList.Machine_LV_Component_Maker.set(new GT_MetaTileEntity_BasicMachine_GT_Recipe(985, "basicmachine.componentmaker.tier.01", "Basic Component Maker", 1, "Components, Unite!", Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes, 6, 1, 16000, 0, 1, "Assembler.png", "", false, @@ -341,17 +348,20 @@ public class GregtechComponentAssembler { mWT = "16"; else mWT = "01"; + + ItemStack eyeQuantum = ItemList.valueOf("QuantumEye").get(1); + ItemStack starQuantum = ItemList.valueOf("QuantumStar").get(1); if (tier == 1) gem = ItemUtils.getSimpleStack(Items.ender_pearl); else if (tier == 2) gem = ItemUtils.getSimpleStack(Items.ender_eye); else if (tier == 3) - gem = ItemList.QuantumEye.get(1); + gem = eyeQuantum; else if (tier == 4) gem = ItemUtils.getSimpleStack(Items.nether_star); else if (tier == 5) - gem = ItemList.QuantumStar.get(1); + gem = starQuantum; else gem = ItemUtils.getSimpleStack(Items.ender_pearl); diff --git a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java index c502ffabd0..320d9980c4 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechNitroDieselFix.java @@ -7,6 +7,8 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; +import org.apache.commons.lang3.reflect.FieldUtils; + import gregtech.GT_Mod; import gregtech.api.enums.Dyes; import gregtech.api.enums.GT_Values; @@ -17,8 +19,11 @@ import gregtech.api.enums.TextureSet; import gregtech.api.objects.MaterialStack; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.item.ItemUtils; +import gtPlusPlus.core.util.materials.MaterialUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -66,12 +71,22 @@ public class GregtechNitroDieselFix { /** + * Reflectively get all the values to maintain 5.08.xx compat + */ + + + GT_Recipe_Map recipeMapMultiblockChemReactor; + recipeMapMultiblockChemReactor = (GT_Recipe_Map) FieldUtils.getDeclaredField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes", true).get(null); + + + + /** * Do Recipe Stuff */ //Set up some Variables final Collection<GT_Recipe> xSingle = GT_Recipe.GT_Recipe_Map.sChemicalRecipes.mRecipeList; - final Collection<GT_Recipe> xMulti = GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.mRecipeList; + final Collection<GT_Recipe> xMulti = recipeMapMultiblockChemReactor.mRecipeList; final FluidStack mNitroStack = Materials.NitroFuel.getFluid(1000); GT_Recipe toRemoveSingle[] = new GT_Recipe[99]; GT_Recipe toRemoveMulti[] = new GT_Recipe[99]; @@ -107,37 +122,40 @@ public class GregtechNitroDieselFix { } } Utils.LOG_INFO("[Nitro] Removed "+mRemovedSingle+" single block Chemical Reactor recipes."); - + //Remove Multi Block recipes found. for (GT_Recipe multi : toRemoveMulti){ - if (GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.mRecipeList.remove(multi)){ + if (recipeMapMultiblockChemReactor.mRecipeList.remove(multi)){ mRemovedMulti++; } } Utils.LOG_INFO("[Nitro] Removed "+mRemovedMulti+" multi block Chemical Reactor recipes."); + + Materials mGlycerol = Materials.valueOf("Glycerol"); + Materials mLightFuel = Materials.valueOf("LightFuel"); //Build a New Recipe set - Materials mFuels[] = {Materials.LightFuel, Materials.Fuel, Materials.Diesel}; + Materials mFuels[] = {mLightFuel, Materials.Fuel}; for (Materials fuel : mFuels){ boolean didAdd[] = new boolean[3]; Utils.LOG_INFO("[Nitro] Getting ready to add back in the old nitro-diesel recipe to the mixer, using "+fuel.mDefaultLocalName+" as the fuel input."); - didAdd[0] = GT_Values.RA.addMixerRecipe(fuel.getCells(4), Materials.Glycerol.getCells(1), GT_Values.NI, GT_Values.NI, GT_Values.NF, GT_Values.NF, mNitroFix.getCells(5), 20, 30); - didAdd[1] = GT_Values.RA.addMixerRecipe(fuel.getCells(4), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Glycerol.getFluid(1000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(4L), 20, 30); - didAdd[2] = GT_Values.RA.addMixerRecipe(Materials.Glycerol.getCells(1), GT_Values.NI,GT_Values.NI,GT_Values.NI, fuel.getFluid(4000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20, 30); + didAdd[0] = GT_Values.RA.addMixerRecipe(getCells(fuel, 4), getCells(mGlycerol, 1), GT_Values.NI, GT_Values.NI, GT_Values.NF, GT_Values.NF, getCells(mNitroFix, 5), 20, 30); + didAdd[1] = GT_Values.RA.addMixerRecipe(getCells(fuel, 4), GT_Values.NI, GT_Values.NI, GT_Values.NI, mGlycerol.getFluid(1000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(4L), 20, 30); + didAdd[2] = GT_Values.RA.addMixerRecipe(getCells(mGlycerol, 1), GT_Values.NI,GT_Values.NI,GT_Values.NI, fuel.getFluid(4000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20, 30); Utils.LOG_INFO("[Nitro] Did the recipes add? 1: "+didAdd[0]+" | 2: "+didAdd[1]+" | 3: "+didAdd[2]); } for (Materials fuel : mFuels){ boolean didAdd[] = new boolean[3]; Utils.LOG_INFO("[Nitro] Getting ready to add back in the old nitro-diesel recipe to the chemical reactors, using "+fuel.mDefaultLocalName+" as the fuel input."); - didAdd[0] = GT_Values.RA.addChemicalRecipe(fuel.getCells(4), Materials.Glycerol.getCells(1), GT_Values.NF, GT_Values.NF, mNitroFix.getCells(5), 20, 30); - didAdd[1] = GT_Values.RA.addChemicalRecipe(fuel.getCells(4), GT_Values.NI, Materials.Glycerol.getFluid(1000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(4L), 20, 30); - didAdd[2] = GT_Values.RA.addChemicalRecipe(Materials.Glycerol.getCells(1), GT_Values.NI, fuel.getFluid(4000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20, 30); + didAdd[0] = GT_Values.RA.addChemicalRecipe(getCells(fuel, 4), getCells(mGlycerol, 1), GT_Values.NF, GT_Values.NF, getCells(mNitroFix, 5), 20); + didAdd[1] = GT_Values.RA.addChemicalRecipe(getCells(fuel, 4), GT_Values.NI, mGlycerol.getFluid(1000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(4L), 20); + didAdd[2] = GT_Values.RA.addChemicalRecipe(getCells(mGlycerol, 1), GT_Values.NI, fuel.getFluid(4000L),mNitroFix.getFluid(5000L), ItemList.Cell_Empty.get(1L), 20); Utils.LOG_INFO("[Nitro] Did the recipes add? 1: "+didAdd[0]+" | 2: "+didAdd[1]+" | 3: "+didAdd[2]); } Utils.LOG_INFO("[Nitro] Getting ready to add back in the old glycerol recipe!"); - GT_Values.RA.addChemicalRecipe(Materials.Nitrogen.getCells(1), Materials.Carbon.getDust(1), Materials.Water.getFluid(2000L), Materials.Glycerol.getFluid(3000L), ItemList.Cell_Empty.get(1), 3000, 30); + GT_Values.RA.addChemicalRecipe(getCells(Materials.Nitrogen, 1), getDust(Materials.Carbon, 1), Materials.Water.getFluid(2000L), mGlycerol.getFluid(3000L), ItemList.Cell_Empty.get(1), 3000); Utils.LOG_INFO("[Nitro] Added recipes."); } @@ -151,7 +169,17 @@ public class GregtechNitroDieselFix { } } } - - - + + + public static ItemStack getCells(Materials mat, int amount){ + String mName = MaterialUtils.getMaterialName(mat); + return ItemUtils.getItemStackOfAmountFromOreDict("cell"+mName, amount); + } + + public static ItemStack getDust(Materials mat, int amount){ + String mName = MaterialUtils.getMaterialName(mat); + return ItemUtils.getItemStackOfAmountFromOreDict("dust"+mName, amount); + } + + } |