diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-10-24 00:58:51 +0100 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-10-24 00:58:51 +0100 |
commit | 68e266e0a227aaf90294d2a8ffd5081dc3bb640e (patch) | |
tree | 87322c949165f2a12f4dda7be8b781344371fc49 /src/Java/gtPlusPlus/core/item/chemistry | |
parent | 82445f39bb9d1f257d0850a0535f5058aa2e867c (diff) | |
download | GT5-Unofficial-68e266e0a227aaf90294d2a8ffd5081dc3bb640e.tar.gz GT5-Unofficial-68e266e0a227aaf90294d2a8ffd5081dc3bb640e.tar.bz2 GT5-Unofficial-68e266e0a227aaf90294d2a8ffd5081dc3bb640e.zip |
+ Added Chemical Plant.
+ Added more Bio Recipes.
$ Fixed Strontium Hydroxide generating before it's components.
$ Fixed existing Bio Recipes not working.
Diffstat (limited to 'src/Java/gtPlusPlus/core/item/chemistry')
-rw-r--r-- | src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java | 183 |
1 files changed, 168 insertions, 15 deletions
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index fd0d044c05..324a3aa9ee 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.item.chemistry; import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.List; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -15,6 +16,11 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.plugin.agrichem.BioRecipes; +import gtPlusPlus.plugin.agrichem.item.algae.ItemAgrichemBase; +import gtPlusPlus.plugin.agrichem.item.algae.ItemAlgaeBase; +import gtPlusPlus.plugin.agrichem.item.algae.ItemBioChip; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -71,6 +77,60 @@ public class AgriculturalChem extends ItemPackage { // Fertilizer + + public static Item mAlgae; + public static Item mBioCircuit; + public static Item mAgrichemItem1; + + /* + * 0 - Algae Biomass + * 1 - Green Algae Biomass + * 2 - Brown Algae Biomass + * 3 - Golden-Brown Algae Biomass + * 4 - Red Algae Biomass + * 5 - Cellulose Fiber + * 6 - Golden-Brown Cellulose Fiber + * 7 - Red Cellulose Fiber + * 8 - Compost + * 9 - Wood Pellet + * 10 - Wood Brick + * 11 - Cellulose Pulp + * 12 - Raw Bio Resin + * 13 - Catalyst Carrier + * 14 - Green Metal Catalyst + * 15 - Alginic Acid + * 16 - Alumina + * 17 - Aluminium Pellet + * 18 - Sodium Aluminate + * 19 - Sodium Hydroxide // Exists in Newer GT + * 20 - Sodium Carbonate + * 21 - Lithium Chloride + */ + + public static ItemStack mAlgaeBiosmass; + public static ItemStack mGreenAlgaeBiosmass; + public static ItemStack mBrownAlgaeBiosmass; + public static ItemStack mGoldenBrownAlgaeBiosmass; + public static ItemStack mRedAlgaeBiosmass; + public static ItemStack mCelluloseFiber; + public static ItemStack mGoldenBrownCelluloseFiber; + public static ItemStack mRedCelluloseFiber; + public static ItemStack mCompost; + public static ItemStack mWoodPellet; + public static ItemStack mWoodBrick; + public static ItemStack mCellulosePulp; + public static ItemStack mRawBioResin; + public static ItemStack mCatalystCarrier; + public static ItemStack mGreenCatalyst; + public static ItemStack mAlginicAcid; + public static ItemStack mAlumina; + public static ItemStack mAluminiumPellet; + public static ItemStack mSodiumAluminate; + public static ItemStack mSodiumHydroxide; + public static ItemStack mSodiumCarbonate; + public static ItemStack mLithiumChloride; + + @Override public void items() { // Nitrogen, Ammonium Nitrate, Phosphates, Calcium, Copper, Carbon @@ -82,7 +142,91 @@ public class AgriculturalChem extends ItemPackage { "Ca5(PO4)3(OH)", Utils.rgbtoHexValue(240, 240, 240))[0]; // Dirt Dust :) - dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0]; + dustDirt = ItemUtils.generateSpecialUseDusts("Dirt", "Dried Earth", Utils.rgbtoHexValue(65, 50, 15))[0]; + + mAlgae = new ItemAlgaeBase(); + mAgrichemItem1 = new ItemAgrichemBase(); + mBioCircuit = new ItemBioChip(); + GregtechItemList.Circuit_BioRecipeSelector.set(mBioCircuit); + + + + mAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 0, 1); + mGreenAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 1, 1); + mBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 2, 1); + mGoldenBrownAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 3, 1); + mRedAlgaeBiosmass = ItemUtils.simpleMetaStack(mAgrichemItem1, 4, 1); + mCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 5, 1); + mGoldenBrownCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 6, 1); + mRedCelluloseFiber = ItemUtils.simpleMetaStack(mAgrichemItem1, 7, 1); + mCompost = ItemUtils.simpleMetaStack(mAgrichemItem1, 8, 1); + mWoodPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 9, 1); + mWoodBrick = ItemUtils.simpleMetaStack(mAgrichemItem1, 10, 1); + mCellulosePulp = ItemUtils.simpleMetaStack(mAgrichemItem1, 11, 1); + mRawBioResin = ItemUtils.simpleMetaStack(mAgrichemItem1, 12, 1); + mCatalystCarrier = ItemUtils.simpleMetaStack(mAgrichemItem1, 13, 1); + mGreenCatalyst = ItemUtils.simpleMetaStack(mAgrichemItem1, 14, 1); + mAlginicAcid = ItemUtils.simpleMetaStack(mAgrichemItem1, 15, 1); + mAlumina = ItemUtils.simpleMetaStack(mAgrichemItem1, 16, 1); + mAluminiumPellet = ItemUtils.simpleMetaStack(mAgrichemItem1, 17, 1); + mSodiumAluminate = ItemUtils.simpleMetaStack(mAgrichemItem1, 18, 1); + + /** + * If It exists, don't add a new one. + */ + if (OreDictionary.doesOreNameExist("dustSodiumHydroxide_GT5U") || OreDictionary.doesOreNameExist("dustSodiumHydroxide")) { + List<ItemStack> aTest = OreDictionary.getOres("dustSodiumHydroxide", false); + ItemStack aTestStack; + if (aTest.isEmpty()) { + aTest = OreDictionary.getOres("dustSodiumHydroxide_GT5U", false); + if (aTest.isEmpty()) { + aTestStack = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1); + } + else { + aTestStack = aTest.get(0); + } + } + else { + aTestStack = aTest.get(0); + } + mSodiumHydroxide = aTestStack; + } + else { + mSodiumHydroxide = ItemUtils.simpleMetaStack(mAgrichemItem1, 19, 1); + } + mSodiumCarbonate = ItemUtils.simpleMetaStack(mAgrichemItem1, 20, 1); + mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1); + + ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae"); + ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae"); + ItemUtils.addItemToOreDictionary(mGoldenBrownAlgaeBiosmass, "biomassGoldenBrownAlgae"); + ItemUtils.addItemToOreDictionary(mRedAlgaeBiosmass, "biomassRedAlgae"); + + ItemUtils.addItemToOreDictionary(mCelluloseFiber, "fiberCellulose"); + ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberCellulose"); + ItemUtils.addItemToOreDictionary(mGoldenBrownCelluloseFiber, "fiberGoldenBrownCellulose"); + ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberCellulose"); + ItemUtils.addItemToOreDictionary(mRedCelluloseFiber, "fiberRedCellulose"); + + ItemUtils.addItemToOreDictionary(mWoodPellet, "pelletWood"); + ItemUtils.addItemToOreDictionary(mWoodBrick, "brickWood"); + ItemUtils.addItemToOreDictionary(mCellulosePulp, "pulpCellulose"); + + ItemUtils.addItemToOreDictionary(mCatalystCarrier, "catalystEmpty"); + ItemUtils.addItemToOreDictionary(mGreenCatalyst, "catalystAluminiumSilver"); + ItemUtils.addItemToOreDictionary(mAlginicAcid, "dustAlginicAcid"); + ItemUtils.addItemToOreDictionary(mAlumina, "dustAlumina"); + ItemUtils.addItemToOreDictionary(mAluminiumPellet, "pelletAluminium"); + + ItemUtils.addItemToOreDictionary(mSodiumAluminate, "dustSodiumAluminate"); + if (mSodiumHydroxide.getItem() instanceof ItemAgrichemBase) { + ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide"); + } + ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate"); + ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride"); + + + } @Override @@ -156,20 +300,20 @@ public class AgriculturalChem extends ItemPackage { } - private static AutoMap<ItemStack> mMeats = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mFish = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mFruits = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mVege = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mNuts = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mSeeds = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mPeat = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mBones = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mBoneMeal = new AutoMap<ItemStack>(); - - private static AutoMap<ItemStack> mList_Master_Meats = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mList_Master_Bones = new AutoMap<ItemStack>(); - private static AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>(); + public final static AutoMap<ItemStack> mMeats = new AutoMap<ItemStack>(); + public final static AutoMap<ItemStack> mFish = new AutoMap<ItemStack>(); + public final static AutoMap<ItemStack> mFruits = new AutoMap<ItemStack>(); + public final static AutoMap<ItemStack> mVege = new AutoMap<ItemStack>(); + public final static AutoMap<ItemStack> mNuts = new AutoMap<ItemStack>(); + public final static AutoMap<ItemStack> mSeeds = new AutoMap<ItemStack>(); + private final static AutoMap<ItemStack> mPeat = new AutoMap<ItemStack>(); + private final static AutoMap<ItemStack> mBones = new AutoMap<ItemStack>(); + private final static AutoMap<ItemStack> mBoneMeal = new AutoMap<ItemStack>(); + + public final static AutoMap<ItemStack> mList_Master_Meats = new AutoMap<ItemStack>(); + public final static AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<ItemStack>(); + public final static AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<ItemStack>(); + private final static AutoMap<ItemStack> mList_Master_Bones = new AutoMap<ItemStack>(); private static void processAllOreDict() { processOreDict("listAllmeatraw", mMeats); @@ -323,6 +467,10 @@ public class AgriculturalChem extends ItemPackage { } } } + + public static ItemStack aFertForestry; + public static ItemStack aFertIC2; + private static void addMiscRecipes() { @@ -342,6 +490,7 @@ public class AgriculturalChem extends ItemPackage { Field aFertField = ReflectionUtils.getField(aItemRegInstance.getClass(), "fertilizerCompound"); Object aItemInstance = aFertField.get(aItemRegInstance); if (aItemInstance instanceof Item) { + aFertForestry = ItemUtils.getSimpleStack((Item) aItemInstance); Item aForestryFert = (Item) aItemInstance; CORE.RA.addDehydratorRecipe( new ItemStack[] { CI.getNumberedCircuit(11), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null, @@ -359,6 +508,7 @@ public class AgriculturalChem extends ItemPackage { * IC2 Support */ if (LoadedMods.IndustrialCraft2) { + aFertIC2 = ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 1); CORE.RA.addDehydratorRecipe( new ItemStack[] { CI.getNumberedCircuit(12), ItemUtils.getSimpleStack(aDustOrganicFert, 4) }, null, null, new ItemStack[] { ItemUtils.getItemStackFromFQRN("IC2:itemFertilizer", 3), aManureByprod, @@ -414,6 +564,9 @@ public class AgriculturalChem extends ItemPackage { addAdvancedOrganiseFertRecipes(); addMiscRecipes(); + + BioRecipes.init(); + return true; } } |