diff options
author | Alkalus <draknyte1@hotmail.com> | 2020-04-13 23:50:26 +0000 |
---|---|---|
committer | Alkalus <draknyte1@hotmail.com> | 2020-04-13 23:50:26 +0000 |
commit | e724a728061ec4a78cff73a4a2dd46eea4af4521 (patch) | |
tree | fee3354917be32870ec349b605990a091ace9e62 /src/Java/gtPlusPlus/core/item | |
parent | 24b1356471191a10fde6e4f1baf58ae74e87cfba (diff) | |
parent | 87ab3c0ab5f1b682295e2a010cc88cf4ae7db51c (diff) | |
download | GT5-Unofficial-e724a728061ec4a78cff73a4a2dd46eea4af4521.tar.gz GT5-Unofficial-e724a728061ec4a78cff73a4a2dd46eea4af4521.tar.bz2 GT5-Unofficial-e724a728061ec4a78cff73a4a2dd46eea4af4521.zip |
Merged in MillingRecipes (pull request #7)
Milling Recipes & many other misc fixes
Diffstat (limited to 'src/Java/gtPlusPlus/core/item')
7 files changed, 1323 insertions, 76 deletions
diff --git a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index 3f02ca898d..e11b163753 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -110,6 +110,7 @@ public class AgriculturalChem extends ItemPackage { * 21 - Lithium Chloride * 22 - Pellet Mold * 23 - Clean Aluminium Mix + * 24 - Pinecone */ public static ItemStack mAlgaeBiosmass; @@ -136,6 +137,8 @@ public class AgriculturalChem extends ItemPackage { public static ItemStack mLithiumChloride; public static ItemStack mPelletMold; public static ItemStack mCleanAluminiumMix; + public static ItemStack mPinecone; + public static ItemStack mCrushedPine; @Override @@ -205,6 +208,8 @@ public class AgriculturalChem extends ItemPackage { mLithiumChloride = ItemUtils.simpleMetaStack(mAgrichemItem1, 21, 1); mPelletMold = ItemUtils.simpleMetaStack(mAgrichemItem1, 22, 1); mCleanAluminiumMix = ItemUtils.simpleMetaStack(mAgrichemItem1, 23, 1); + mPinecone = ItemUtils.simpleMetaStack(mAgrichemItem1, 24, 1); + mCrushedPine = ItemUtils.simpleMetaStack(mAgrichemItem1, 25, 1); ItemUtils.addItemToOreDictionary(mGreenAlgaeBiosmass, "biomassGreenAlgae"); ItemUtils.addItemToOreDictionary(mBrownAlgaeBiosmass, "biomassBrownAlgae"); @@ -231,6 +236,8 @@ public class AgriculturalChem extends ItemPackage { ItemUtils.addItemToOreDictionary(mSodiumHydroxide, "dustSodiumHydroxide"); ItemUtils.addItemToOreDictionary(mSodiumCarbonate, "dustSodiumCarbonate"); ItemUtils.addItemToOreDictionary(mLithiumChloride, "dustLithiumChloride"); + ItemUtils.addItemToOreDictionary(mPinecone, "pinecone"); + ItemUtils.addItemToOreDictionary(mCrushedPine, "crushedPineMaterial"); //Handle GT NaOH dusts List<ItemStack> NaOHSmall = OreDictionary.getOres("dustSmallSodiumHydroxide_GT5U", false); diff --git a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java index ff55326031..80a51d80cc 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/GenericChem.java @@ -1,33 +1,26 @@ package gtPlusPlus.core.item.chemistry; -import static gtPlusPlus.core.lib.CORE.GTNH; - -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.TextureSet; +import gregtech.api.enums.*; +import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; +import gtPlusPlus.core.item.circuit.ItemAdvancedChip; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.material.ELEMENT; -import gtPlusPlus.core.material.MISC_MATERIALS; -import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.MaterialGenerator; -import gtPlusPlus.core.material.MaterialStack; -import gtPlusPlus.core.material.NONMATERIAL; +import gtPlusPlus.core.material.*; import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.plugin.agrichem.BioRecipes; import gtPlusPlus.plugin.agrichem.block.AgrichemFluids; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.*; public class GenericChem extends ItemPackage { @@ -37,6 +30,7 @@ public class GenericChem extends ItemPackage { private static boolean usingGregtechNitricOxide = false; private static boolean usingGregtechNitrogenDioxide = false; + private static boolean usingGregtechHydricSulfur = false; /** * Materials @@ -94,6 +88,8 @@ public class GenericChem extends ItemPackage { public static Fluid Lithium_Peroxide; public static Fluid Nitric_Oxide; public static Fluid Nitrogen_Dioxide; + public static Fluid Carbon_Disulfide; + public static Fluid Hydrogen_Sulfide; /** * Items @@ -102,6 +98,7 @@ public class GenericChem extends ItemPackage { // Phenol Byproducts public Item PhenolicResins; //https://en.wikipedia.org/wiki/Phenol_formaldehyde_resin public static ItemGenericChemBase mGenericChemItem1; + public static Item mAdvancedCircuit; private ItemStack mCatalystCarrier; @@ -115,6 +112,11 @@ public class GenericChem extends ItemPackage { public static ItemStack mMillingBallAlumina; public static ItemStack mMillingBallSoapstone; + + public static ItemStack mSodiumEthoxide; + public static ItemStack mSodiumEthylXanthate; + public static ItemStack mPotassiumEthylXanthate; + public static ItemStack mPotassiumHydroxide; @@ -125,7 +127,9 @@ public class GenericChem extends ItemPackage { MaterialGenerator.generate(NYLON, false); MaterialGenerator.generate(TEFLON, false); - mGenericChemItem1 = new ItemGenericChemBase(); + mGenericChemItem1 = new ItemGenericChemBase(); + mAdvancedCircuit = new ItemAdvancedChip(); + GregtechItemList.Circuit_T3RecipeSelector.set(mAdvancedCircuit); registerItemStacks(); registerOreDict(); @@ -149,6 +153,10 @@ public class GenericChem extends ItemPackage { mPinkCatalyst = ItemUtils.simpleMetaStack(mGenericChemItem1, 6, 1); mMillingBallAlumina = ItemUtils.simpleMetaStack(mGenericChemItem1, 7, 1); mMillingBallSoapstone = ItemUtils.simpleMetaStack(mGenericChemItem1, 8, 1); + mSodiumEthoxide = ItemUtils.simpleMetaStack(mGenericChemItem1, 9, 1); + mSodiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 10, 1); + mPotassiumEthylXanthate = ItemUtils.simpleMetaStack(mGenericChemItem1, 11, 1); + mPotassiumHydroxide = ItemUtils.simpleMetaStack(mGenericChemItem1, 12, 1); } @@ -163,6 +171,10 @@ public class GenericChem extends ItemPackage { ItemUtils.addItemToOreDictionary(mPinkCatalyst, "catalystPlatinumRhodium"); ItemUtils.addItemToOreDictionary(mMillingBallAlumina, "millingballAlumina"); ItemUtils.addItemToOreDictionary(mMillingBallSoapstone, "millingballSoapstone"); + ItemUtils.addItemToOreDictionary(mSodiumEthoxide, "dustSodiumEthoxide"); + ItemUtils.addItemToOreDictionary(mSodiumEthylXanthate, "dustSodiumEthylXanthate"); + ItemUtils.addItemToOreDictionary(mPotassiumEthylXanthate, "dustPotassiumEthylXanthate"); + ItemUtils.addItemToOreDictionary(mPotassiumHydroxide, "dustPotassiumHydroxide"); } @@ -241,8 +253,30 @@ public class GenericChem extends ItemPackage { //Lithium Peroxide - 2 LiOOH → Li2O2 + H2O2 + 2 H2O Lithium_Peroxide = FluidUtils.generateFluidNonMolten("LithiumPeroxide", "Lithium Peroxide", 446, new short[]{135, 135, 135, 100}, null, null); - - + Carbon_Disulfide = FluidUtils.generateFluidNoPrefix("CarbonDisulfide", "Carbon Disulfide", 350, new short[]{175, 175, 175, 100}); + + if (FluidRegistry.isFluidRegistered("fluid.liquid_hydricsulfur") || MaterialUtils.doesMaterialExist("HydricSulfide")) { + usingGregtechHydricSulfur = true; + Fluid aFluid = null; + if (ItemUtils.doesItemListEntryExist("sHydricSulfur")) { + ItemStack aListItem = ItemUtils.getValueOfItemList("sHydricSulfur", 1, (ItemList) null); + if (aListItem != null) { + FluidStack aFluidStack = FluidContainerRegistry.getFluidForFilledItem(aListItem); + if (aFluidStack != null) { + aFluid = aFluidStack.getFluid(); + } + + } + } + if (aFluid == null) { + aFluid = FluidUtils.getWildcardFluidStack("liquid_hydricsulfur", 1000).getFluid(); + } + Hydrogen_Sulfide = aFluid; + } + else { + Hydrogen_Sulfide = FluidUtils.generateFluidNoPrefix("HydrogenSulfide", "Hydrogen Sulfide", 446, new short[]{240, 130, 30, 100}); + } + } @Override @@ -253,6 +287,7 @@ public class GenericChem extends ItemPackage { @Override public boolean generateRecipes() { + recipeAdvancedChip(); recipeCatalystRed(); recipeCatalystYellow(); recipeCatalystBlue(); @@ -281,17 +316,173 @@ public class GenericChem extends ItemPackage { if (!usingGregtechNitrogenDioxide) { recipeNitrogenDioxide(); } + if (!usingGregtechHydricSulfur) { + recipeHydricSulfur(); + } // Add recipes if we are not using GT's fluid. if (!FluidRegistry.isFluidRegistered("hydrochloricacid_gt5u")) { recipeHydrochloricAcid(); } + + recipeSodiumEthoxide(); + recipeCarbonDisulfide(); + recipeEthylXanthates(); + recipePotassiumHydroxide(); + registerFuels(); return true; } + private void recipeSodiumEthoxide() { + //2 C2H5OH + 2 Na → 2 C2H5ONa + H2 + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedCircuit(16), + ELEMENT.getInstance().SODIUM.getDust(2) + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mEthanol, 1000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(mSodiumEthoxide, 2) + + }, + new FluidStack[] { + ELEMENT.getInstance().HYDROGEN.getFluid(2000) + }, + 20 *20, + 120, + 2); + } + + + private void recipePotassiumHydroxide() { + //Ca(OH)2 + K2CO3 → CaCO3 + 2 KOH + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedCircuit(18), + ELEMENT.getInstance().POTASSIUM.getDust(4), + ELEMENT.getInstance().CARBON.getDust(2), + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 2), + }, + new FluidStack[] { + FluidUtils.getFluidStack("oxygen", 6000), + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumCarbonate", 2), + ItemUtils.getSimpleStack(mPotassiumHydroxide, 4) + + }, + new FluidStack[] { + + }, + 20 *30, + 120, + 2); + + } + + + private void recipeEthylXanthates() { + + //Potassium ethyl xanthate - CH3CH2OH + CS2 + KOH → CH3CH2OCS2K + H2O + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedCircuit(17), + ItemUtils.getItemStackOfAmountFromOreDict("dustCalciumHydroxide", 2), + }, + new FluidStack[] { + FluidUtils.getFluidStack(BioRecipes.mEthanol, 1000), + FluidUtils.getFluidStack(Carbon_Disulfide, 1000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(mPotassiumEthylXanthate, 1) + }, + new FluidStack[] { + FluidUtils.getWater(1000) + }, + 20 *60, + 120, + 2); + + //Sodium ethyl xanthate - CH3CH2ONa + CS2 → CH3CH2OCS2Na + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedCircuit(17), + ItemUtils.getSimpleStack(mSodiumEthoxide, 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(Carbon_Disulfide, 1000), + }, + new ItemStack[] { + ItemUtils.getSimpleStack(mSodiumEthylXanthate, 1) + }, + new FluidStack[] { + + }, + 20 *60, + 120, + 2); + + } + + + private void recipeHydricSulfur() { + + ItemStack aCellHydricSulfide = ItemUtils.getItemStackOfAmountFromOreDict("cellHydrogenSulfide", 1); + GT_Values.RA.addChemicalRecipe( ELEMENT.getInstance().SULFUR.getDust(1), GT_Utility.getIntegratedCircuit(1), ELEMENT.getInstance().HYDROGEN.getFluid(2000), FluidUtils.getFluidStack(Hydrogen_Sulfide, 3000), GT_Values.NI, 60, 8); + GT_Values.RA.addChemicalRecipeForBasicMachineOnly(ELEMENT.getInstance().SULFUR.getDust(1), CI.emptyCells(3), ELEMENT.getInstance().HYDROGEN.getFluid(2000), GT_Values.NF, ItemUtils.getSimpleStack(aCellHydricSulfide, 3), GT_Values.NI, 60, 8); + + } + + + private void recipeCarbonDisulfide() { + + CORE.RA.addBlastRecipe( + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("fuelCoke", 8), + ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 16) + }, + new FluidStack[] { + + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustDarkAsh", 1) + }, + new FluidStack[] { + FluidUtils.getFluidStack(Carbon_Disulfide, 4000) + }, + 20 *60 * 10, + 30, + 1500); + + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedCircuit(20), + ItemUtils.getSimpleStack(mBrownCatalyst, 0), + ItemUtils.getItemStackOfAmountFromOreDict("dustSulfur", 4) + }, + new FluidStack[] { + FluidUtils.getFluidStack(CoalTar.Coal_Gas, 1000), + }, + new ItemStack[] { + + }, + new FluidStack[] { + FluidUtils.getFluidStack(Carbon_Disulfide, 2000), + FluidUtils.getFluidStack(Hydrogen_Sulfide, 4000) + }, + 20 *60 * 5, + 30, + 2); + + + } + + private static void registerFuels() { // Burnables @@ -859,18 +1050,72 @@ public class GenericChem extends ItemPackage { private static final ItemStack getTierOneChip() { - return CI.getNumberedBioCircuit(4); + return CI.getNumberedAdvancedCircuit(4); } private static final ItemStack getTierTwoChip() { - return CI.getNumberedBioCircuit(8); + return CI.getNumberedAdvancedCircuit(8); } private static final ItemStack getTierThreeChip() { - return CI.getNumberedBioCircuit(12); + return CI.getNumberedAdvancedCircuit(12); } private static final ItemStack getTierFourChip() { - return CI.getNumberedBioCircuit(16); + return CI.getNumberedAdvancedCircuit(16); } + private static void recipeAdvancedChip() { + GT_ModHandler.addShapelessCraftingRecipe( + GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 0L), 0, new Object[]{OrePrefixes.circuit.get(Materials.Advanced)}); + + long bits = 0; + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 1L, new Object[0]), bits, + new Object[]{"d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 2L, new Object[0]), bits, + new Object[]{" d ", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 3L, new Object[0]), bits, + new Object[]{" d", " P ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 4L, new Object[0]), bits, + new Object[]{" ", " Pd", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 5L, new Object[0]), bits, + new Object[]{" ", " P ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 6L, new Object[0]), bits, + new Object[]{" ", " P ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 7L, new Object[0]), bits, + new Object[]{" ", " P ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 8L, new Object[0]), bits, + new Object[]{" ", "dP ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 9L, new Object[0]), bits, + new Object[]{"P d", " ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 10L, new Object[0]), bits, + new Object[]{"P ", " d", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 11L, new Object[0]), bits, + new Object[]{"P ", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 12L, new Object[0]), bits, + new Object[]{"P ", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 13L, new Object[0]), bits, + new Object[]{" P", " ", " d", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 14L, new Object[0]), bits, + new Object[]{" P", " ", " d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 15L, new Object[0]), bits, + new Object[]{" P", " ", "d ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 16L, new Object[0]), bits, + new Object[]{" P", "d ", " ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 17L, new Object[0]), bits, + new Object[]{" ", " ", "d P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 18L, new Object[0]), bits, + new Object[]{" ", "d ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 19L, new Object[0]), bits, + new Object[]{"d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 20L, new Object[0]), bits, + new Object[]{" d ", " ", " P", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 21L, new Object[0]), bits, + new Object[]{"d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 22L, new Object[0]), bits, + new Object[]{" d ", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 23L, new Object[0]), bits, + new Object[]{" d", " ", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + BioRecipes.addCraftingRecipe(GregtechItemList.Circuit_T3RecipeSelector.getWithDamage(1L, 24L, new Object[0]), bits, + new Object[]{" ", " d", "P ", 'P', GregtechItemList.Circuit_T3RecipeSelector.getWildcard(1L, new Object[0])}); + } } diff --git a/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java b/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java index 426f48ecf9..71bf2f3e6f 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java @@ -1,56 +1,104 @@ package gtPlusPlus.core.item.chemistry; +import java.util.HashMap; + import gregtech.api.enums.Materials; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; +import gtPlusPlus.api.objects.data.Pair; +import gtPlusPlus.api.objects.data.Quad; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.base.ore.BaseItemMilledOre; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.MaterialUtils; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.NONMATERIAL; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.*; +import gtPlusPlus.xmod.bop.HANDLER_BiomesOPlenty; +import gtPlusPlus.xmod.bop.blocks.BOP_Block_Registrator; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; public class MilledOreProcessing extends ItemPackage { /** * Fluids */ - - public static Fluid ZincFlotationFroth; - public static Fluid CopperFlotationFroth; + + public static Fluid SphaleriteFlotationFroth; + public static Fluid ChalcopyriteFlotationFroth; public static Fluid NickelFlotationFroth; public static Fluid PlatinumFlotationFroth; public static Fluid PentlanditeFlotationFroth; - - + + public static Fluid RedstoneFlotationFroth; + public static Fluid SpessartineFlotationFroth; + public static Fluid GrossularFlotationFroth; + public static Fluid AlmandineFlotationFroth; + public static Fluid PyropeFlotationFroth; + + public static Fluid PineOil; + + /** * Items */ // Zinc, Iron, Indium, Germanium public static Item milledSphalerite; - + // Copper, Iron, Cadmium, Indium public static Item milledChalcopyrite; - + // Nickel, Cobalt, Rhodium, Ruthenium public static Item milledNickel; - + // Platinum, Rhodium, Selenium, Tellurium public static Item milledPlatinum; // Iron, Nickel, Promethium, Hafnium public static Item milledPentlandite; - + + + + + // Redstone, Chrome, Firestone, Dysprosium + public static Item milledRedstone; + + // Manganese, Aluminium, Osmium, Strontium + public static Item milledSpessartine; + + // Calcium, Aluminium, Tungsten, Thallium + public static Item milledGrossular; + + // Aluminium, Magnesium, Yttrium, Ytterbium + public static Item milledAlmandine; + + // Magnesium, Manganese, Borax, Rhenium + public static Item milledPyrope; + @Override public void items() { - milledSphalerite = BaseItemMilledOre.generate(Materials.Sphalerite, MaterialUtils.getVoltageForTier(5)); - milledChalcopyrite = BaseItemMilledOre.generate(Materials.Chalcopyrite, MaterialUtils.getVoltageForTier(4)); - milledNickel = BaseItemMilledOre.generate(Materials.Nickel, MaterialUtils.getVoltageForTier(4)); - milledPlatinum = BaseItemMilledOre.generate(Materials.Platinum, MaterialUtils.getVoltageForTier(5)); - milledPentlandite = BaseItemMilledOre.generate(Materials.Pentlandite, MaterialUtils.getVoltageForTier(5)); - + milledSphalerite = BaseItemMilledOre.generate(Materials.Sphalerite, MaterialUtils.getVoltageForTier(6)); + milledChalcopyrite = BaseItemMilledOre.generate(Materials.Chalcopyrite, MaterialUtils.getVoltageForTier(5)); + milledNickel = BaseItemMilledOre.generate(Materials.Nickel, MaterialUtils.getVoltageForTier(5)); + milledPlatinum = BaseItemMilledOre.generate(Materials.Platinum, MaterialUtils.getVoltageForTier(6)); + milledPentlandite = BaseItemMilledOre.generate(Materials.Pentlandite, MaterialUtils.getVoltageForTier(6)); + + milledRedstone = BaseItemMilledOre.generate(Materials.Redstone, MaterialUtils.getVoltageForTier(5)); + milledSpessartine = BaseItemMilledOre.generate(Materials.Spessartine, MaterialUtils.getVoltageForTier(6)); + milledGrossular = BaseItemMilledOre.generate(Materials.Grossular, MaterialUtils.getVoltageForTier(6)); + milledAlmandine = BaseItemMilledOre.generate(Materials.Almandine, MaterialUtils.getVoltageForTier(6)); + milledPyrope = BaseItemMilledOre.generate(Materials.Pyrope, MaterialUtils.getVoltageForTier(4)); + } @Override @@ -60,11 +108,11 @@ public class MilledOreProcessing extends ItemPackage { @Override public void fluids() { - + short[] aZincFrothRGB = Materials.Sphalerite.mRGBa; - ZincFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.zincflotation", "Zinc Froth", 32 + 175, new short[] { aZincFrothRGB[0], aZincFrothRGB[1], aZincFrothRGB[2], 100 }, true); + SphaleriteFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.zincflotation", "Sphalerite Froth", 32 + 175, new short[] { aZincFrothRGB[0], aZincFrothRGB[1], aZincFrothRGB[2], 100 }, true); short[] aCopperFrothRGB = Materials.Chalcopyrite.mRGBa; - CopperFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.copperflotation", "Copper Froth", 32 + 175, new short[] { aCopperFrothRGB[0], aCopperFrothRGB[1], aCopperFrothRGB[2], 100 }, true); + ChalcopyriteFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.copperflotation", "Chalcopyrite Froth", 32 + 175, new short[] { aCopperFrothRGB[0], aCopperFrothRGB[1], aCopperFrothRGB[2], 100 }, true); short[] aNickelFrothRGB = Materials.Nickel.mRGBa; NickelFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.nickelflotation", "Nickel Froth", 32 + 175, new short[] { aNickelFrothRGB[0], aNickelFrothRGB[1], aNickelFrothRGB[2], 100 }, true); short[] aPlatinumFrothRGB = Materials.Platinum.mRGBa; @@ -72,9 +120,23 @@ public class MilledOreProcessing extends ItemPackage { short[] aPentlanditeFrothRGB = Materials.Pentlandite.mRGBa; PentlanditeFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.pentlanditeflotation", "Pentlandite Froth", 32 + 175, new short[] { aPentlanditeFrothRGB[0], aPentlanditeFrothRGB[1], aPentlanditeFrothRGB[2], 100 }, true); + short[] aRedstoneFrothRGB = Materials.Redstone.mRGBa; + RedstoneFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.redstoneflotation", "Redstone Froth", 32 + 175, new short[] { aRedstoneFrothRGB[0], aRedstoneFrothRGB[1], aRedstoneFrothRGB[2], 100 }, true); + short[] aSpessartineFrothRGB = Materials.Spessartine.mRGBa; + SpessartineFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.spessartineflotation", "Spessartine Froth", 32 + 175, new short[] { aSpessartineFrothRGB[0], aSpessartineFrothRGB[1], aSpessartineFrothRGB[2], 100 }, true); + short[] aGrossularFrothRGB = Materials.Grossular.mRGBa; + GrossularFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.grossularflotation", "Grossular Froth", 32 + 175, new short[] { aGrossularFrothRGB[0], aGrossularFrothRGB[1], aGrossularFrothRGB[2], 100 }, true); + short[] aAlmandineFrothRGB = Materials.Almandine.mRGBa; + AlmandineFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.almandineflotation", "Almandine Froth", 32 + 175, new short[] { aAlmandineFrothRGB[0], aAlmandineFrothRGB[1], aAlmandineFrothRGB[2], 100 }, true); + short[] aPyropeFrothRGB = Materials.Pyrope.mRGBa; + PyropeFlotationFroth = FluidUtils.generateFluidNoPrefix("froth.pyropeflotation", "Pyrope Froth", 32 + 175, new short[] { aPyropeFrothRGB[0], aPyropeFrothRGB[1], aPyropeFrothRGB[2], 100 }, true); + + + PineOil = FluidUtils.generateFluidNoPrefix("pineoil", "Pine Oil", 32 + 175, new short[] { 250, 200, 60, 100 }, true); + } - - + + public MilledOreProcessing() { super(); @@ -83,20 +145,95 @@ public class MilledOreProcessing extends ItemPackage { private static void addMiscRecipes() { - /*GT_Values.RA.addCentrifugeRecipe( - CI.getNumberedBioCircuit(10), - GT_Values.NI, - FluidUtils.getFluidStack(MilledOreProcessing.ZincFlotationFroth, 1000), - FluidUtils.getWater(500), - ELEMENT.getInstance().IRON.getSmallDust(1), - ELEMENT.getInstance().COPPER.getSmallDust(1), - ELEMENT.getInstance().TIN.getSmallDust(1), - ELEMENT.getInstance().SULFUR.getSmallDust(1), - ELEMENT.getInstance().NICKEL.getTinyDust(1), - ELEMENT.getInstance().LEAD.getTinyDust(1), - new int[] { 3000, 3000, 2000, 2000, 1000, 1000 }, - 30 * 20, - 30);*/ + /* + * First 5 + */ + + //milledSphalerite + registerOreDataForMilledType( + SphaleriteFlotationFroth, + ELEMENT.getInstance().ZINC, 180, + ELEMENT.getInstance().IRON, 120, + ELEMENT.getInstance().INDIUM, 40, + ELEMENT.getInstance().GERMANIUM, 15 + ); + //milledChalcopyrite + registerOreDataForMilledType( + ChalcopyriteFlotationFroth, + ELEMENT.getInstance().COPPER, 180, + ELEMENT.getInstance().IRON, 120, + ELEMENT.getInstance().CADMIUM, 50, + ELEMENT.getInstance().INDIUM, 10 + ); + //milledNickel + registerOreDataForMilledType( + NickelFlotationFroth, + ELEMENT.getInstance().NICKEL, 150, + ELEMENT.getInstance().COBALT, 120, + ELEMENT.getInstance().RHODIUM, 32, + ELEMENT.getInstance().RUTHENIUM, 16 + ); + //milledPlatinum + registerOreDataForMilledType( + PlatinumFlotationFroth, + ELEMENT.getInstance().PLATINUM, 120, + ELEMENT.getInstance().RHODIUM, 60, + ELEMENT.getInstance().SELENIUM, 40, + ELEMENT.getInstance().TELLURIUM, 10 + ); + //milledPentlandite + registerOreDataForMilledType( + PentlanditeFlotationFroth, + ELEMENT.getInstance().IRON, 150, + ELEMENT.getInstance().NICKEL, 100, + ELEMENT.getInstance().PROMETHIUM, 20, + ELEMENT.getInstance().HAFNIUM, 10 + ); + + /* + * Second 5 + */ + //milledRedstone + registerOreDataForMilledType( + RedstoneFlotationFroth, + NONMATERIAL.REDSTONE, 300, + ELEMENT.getInstance().CHROMIUM, 60, + MaterialUtils.generateMaterialFromGtENUM(Materials.Firestone), 45, + ELEMENT.getInstance().DYSPROSIUM, 16 + ); + //milledSpessartine + registerOreDataForMilledType( + SpessartineFlotationFroth, + ELEMENT.getInstance().MANGANESE, 150, + ELEMENT.getInstance().ALUMINIUM, 90, + ELEMENT.getInstance().OSMIUM, 30, + ELEMENT.getInstance().STRONTIUM, 20 + ); + //milledGrossular + registerOreDataForMilledType( + GrossularFlotationFroth, + ELEMENT.getInstance().CALCIUM, 180, + ELEMENT.getInstance().ALUMINIUM, 110, + ELEMENT.getInstance().TUNGSTEN, 60, + ELEMENT.getInstance().THALLIUM, 15 + ); + //milledAlmandine + registerOreDataForMilledType( + AlmandineFlotationFroth, + ELEMENT.getInstance().ALUMINIUM, 150, + ELEMENT.getInstance().MAGNESIUM, 75, + ELEMENT.getInstance().YTTRIUM, 25, + ELEMENT.getInstance().YTTERBIUM, 15 + ); + //milledPyrope + registerOreDataForMilledType( + PyropeFlotationFroth, + ELEMENT.getInstance().MAGNESIUM, 110, + ELEMENT.getInstance().MANGANESE, 70, + MaterialUtils.generateMaterialFromGtENUM(Materials.Borax), 60, + ELEMENT.getInstance().RHENIUM, 20 + ); + } @@ -108,6 +245,532 @@ public class MilledOreProcessing extends ItemPackage { @Override public boolean generateRecipes() { addMiscRecipes(); + addPineOilExtraction(); + addFlotationRecipes1(); + addFlotationRecipes2(); + addVacuumFurnaceRecipes(); return true; } + + private void addVacuumFurnaceRecipes() { + int aCircuitID = 1; + + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(SphaleriteFlotationFroth, 4000) + }, + getOutputsFromMap(SphaleriteFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(6), + 5500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(ChalcopyriteFlotationFroth, 4000) + }, + getOutputsFromMap(ChalcopyriteFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(5), + 4500); + + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(NickelFlotationFroth, 4000) + }, + getOutputsFromMap(NickelFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(5), + 4500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(PlatinumFlotationFroth, 4000) + }, + getOutputsFromMap(PlatinumFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(6), + 5500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(PentlanditeFlotationFroth, 4000) + }, + getOutputsFromMap(PentlanditeFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(6), + 5500); + + + + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(RedstoneFlotationFroth, 4000) + }, + getOutputsFromMap(RedstoneFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(5), + 4500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(SpessartineFlotationFroth, 4000) + }, + getOutputsFromMap(SpessartineFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(6), + 5500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(GrossularFlotationFroth, 4000) + }, + getOutputsFromMap(GrossularFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(6), + 5500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(AlmandineFlotationFroth, 4000) + }, + getOutputsFromMap(AlmandineFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(6), + 5500); + CORE.RA.addVacuumFurnaceRecipe( + new ItemStack[] { + CI.getNumberedCircuit(aCircuitID++) + }, + new FluidStack[] { + FluidUtils.getFluidStack(PyropeFlotationFroth, 4000) + }, + getOutputsFromMap(PyropeFlotationFroth), + new FluidStack[] { + FluidUtils.getFluidStack(AgriculturalChem.RedMud, 2000), + FluidUtils.getWater(2000) + }, + 20 * 120, + MaterialUtils.getVoltageForTier(4), + 3500); + + } + + private void addFlotationRecipes1() { + + // Sphalerite + CORE.RA.addFlotationRecipe( + Materials.Sphalerite, + ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 14000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(SphaleriteFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(6) + ); + + // Chalcopyrite + CORE.RA.addFlotationRecipe( + Materials.Chalcopyrite, + ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 12000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(ChalcopyriteFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(5) + ); + + // Nickel + CORE.RA.addFlotationRecipe( + Materials.Nickel, + ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 25000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(NickelFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(5) + ); + + // Platinum + CORE.RA.addFlotationRecipe( + Materials.Platinum, + ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 35000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(PlatinumFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(6) + ); + + + // Pentlandite + CORE.RA.addFlotationRecipe( + Materials.Pentlandite, + ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 14000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(PentlanditeFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(6) + ); + + } + + private void addFlotationRecipes2() { + + // Redstone + CORE.RA.addFlotationRecipe( + Materials.Redstone, + ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 13000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(RedstoneFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(5) + ); + + // Spessartine + CORE.RA.addFlotationRecipe( + Materials.Spessartine, + ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 35000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(SpessartineFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(6) + ); + + // Grossular + CORE.RA.addFlotationRecipe( + Materials.Grossular, + ItemUtils.getSimpleStack(GenericChem.mPotassiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 28000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(GrossularFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(6) + ); + + // Almandine + CORE.RA.addFlotationRecipe( + Materials.Almandine, + ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 18000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(AlmandineFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(5) + ); + + // Pyrope + CORE.RA.addFlotationRecipe( + Materials.Pyrope, + ItemUtils.getSimpleStack(GenericChem.mSodiumEthylXanthate, 1), + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 8000), + }, + new FluidStack[] { + FluidUtils.getFluidStack(PyropeFlotationFroth, 1000) + }, + 20 * 1200, + MaterialUtils.getVoltageForTier(4) + ); + + } + + private void addPineOilExtraction() { + AutoMap<ItemStack> aLogs = new AutoMap<ItemStack>(); + AutoMap<ItemStack> aLeaves = new AutoMap<ItemStack>(); + AutoMap<ItemStack> aSaplings = new AutoMap<ItemStack>(); + AutoMap<ItemStack> aPinecones = new AutoMap<ItemStack>(); + + ItemStack aCrushedPine = ItemUtils.getSimpleStack(AgriculturalChem.mCrushedPine, 1); + + aLogs.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.log_Pine)); + aLeaves.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.leaves_Pine)); + aSaplings.add(ItemUtils.getSimpleStack(BOP_Block_Registrator.sapling_Pine)); + aPinecones.add(ItemUtils.getSimpleStack(AgriculturalChem.mPinecone, 1)); + + if (LoadedMods.BiomesOPlenty) { + aLogs.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.logs4, 0, 1)); + aLeaves.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.colorizedLeaves2, 1, 1)); + aSaplings.add(HANDLER_BiomesOPlenty.getStack(HANDLER_BiomesOPlenty.colorizedSaplings, 5, 1)); + aPinecones.add(ItemUtils.simpleMetaStack(HANDLER_BiomesOPlenty.mPineCone, 13, 1)); + } + if (LoadedMods.Forestry) { + ItemStack aForestryLog = ItemUtils.getItemStackFromFQRN("Forestry:logs", 1); + if (aForestryLog != null) { + aForestryLog.setItemDamage(20); // Set to Pine + aLogs.add(aForestryLog); + } + ItemStack aForestryLeaves = ItemUtils.getItemStackFromFQRN("Forestry:leaves", 1); + if (aForestryLeaves != null) { + NBTUtils.setString(aForestryLeaves, "species", "forestry.treePine"); // Set to Pine + aLeaves.add(aForestryLeaves); + } + } + + for (ItemStack aLog : aLogs) { + addRecipe(aLog, ItemUtils.getSimpleStack(aCrushedPine, 16), new int[] {10000, 7500, 5000, 2500}, 10, 120); + } + for (ItemStack aLeaf : aLeaves) { + addRecipe(aLeaf, ItemUtils.getSimpleStack(aCrushedPine, 2), new int[] {5000, 5000, 2500, 2500}, 10, 30); + } + for (ItemStack aSapling : aSaplings) { + addRecipe(aSapling, ItemUtils.getSimpleStack(aCrushedPine, 4), new int[] {7500, 7500, 2500, 2500}, 10, 60); + } + for (ItemStack aCone : aPinecones) { + addRecipe(aCone, ItemUtils.getSimpleStack(aCrushedPine, 1), new int[] {7500, 7500, 5000, 2500}, 10, 60); + } + + + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(16), + ItemUtils.getSimpleStack(aCrushedPine, 64) + }, + new FluidStack[] { + FluidUtils.getSteam(5000), + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5) + }, + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 500) + }, + new int[] { + 2000, 2000, 2000, 2000 + }, + 20 * 60, + 120, + 2); + + CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemUtils.getSimpleStack(aCrushedPine, 64) + }, + new FluidStack[] { + FluidUtils.getSuperHeatedSteam(5000), + }, + new ItemStack[] { + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5), + ItemUtils.getItemStackOfAmountFromOreDict("dustTinyDarkAsh", 5) + }, + new FluidStack[] { + FluidUtils.getFluidStack(PineOil, 1500) + }, + new int[] { + 3000, 3000, 3000, 3000 + }, + 20 * 45, + 120, + 3); + + } + + public boolean addRecipe(ItemStack aInput, ItemStack aOutput1, int[] aChances, int aTime, int aEU) { + aOutput1 = GT_OreDictUnificator.get(true, aOutput1); + ItemStack aOutputs[] = new ItemStack[4]; + for (int i=0;i<aChances.length;i++) { + aOutputs[i] = aOutput1; + } + aOutputs = cleanArray(aOutputs); + if ((GT_Utility.isStackInvalid(aInput)) || (GT_Utility.isStackInvalid(aOutput1) || (GT_Utility.getContainerItem(aInput, false) != null))) { + return false; + } + + return CORE.RA.addChemicalPlantRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(14), + aInput + }, + new FluidStack[] { + + }, + aOutputs, + new FluidStack[] { + + }, + aChances, + aTime * 20, + aEU, + 1); + } + + public static ItemStack[] cleanArray(ItemStack[] input) { + int aArraySize = input.length; + AutoMap<ItemStack> aCleanedItems = new AutoMap<ItemStack>(); + for (ItemStack checkStack : input) { + if (ItemUtils.checkForInvalidItems(checkStack)) { + aCleanedItems.put(checkStack); + } + } + ItemStack[] aOutput = new ItemStack[aCleanedItems.size()]; + for (int i=0;i<aArraySize;i++) { + ItemStack aMappedStack = aCleanedItems.get(i); + if (aMappedStack != null){ + aOutput[i] = aMappedStack; + } + } + return aOutput; + } + + private static final HashMap<String, Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>>> aMilledFluidMap = new HashMap<String, Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>>>(); + + public static void registerOreDataForMilledType(Fluid aMilledFluid, Materials aOutput1, int aPerc1, Materials aOutput2, int aPerc2, Materials aOutput3, int aPerc3, Materials aOutput4, int aPerc4) { + registerOreDataForMilledType(aMilledFluid, MaterialUtils.generateMaterialFromGtENUM(aOutput1), aPerc1, MaterialUtils.generateMaterialFromGtENUM(aOutput2), aPerc2, MaterialUtils.generateMaterialFromGtENUM(aOutput3), aPerc3, MaterialUtils.generateMaterialFromGtENUM(aOutput4), aPerc4); + } + + public static void registerOreDataForMilledType(Fluid aMilledFluid, Material aOutput1, int aPerc1, Material aOutput2, int aPerc2, Material aOutput3, int aPerc3, Material aOutput4, int aPerc4) { + + Pair<Material, Integer> aFluidOutput1 = new Pair<Material, Integer>(aOutput1, aPerc1); + Pair<Material, Integer> aFluidOutput2 = new Pair<Material, Integer>(aOutput2, aPerc2); + Pair<Material, Integer> aFluidOutput3 = new Pair<Material, Integer>(aOutput3, aPerc3); + Pair<Material, Integer> aFluidOutput4 = new Pair<Material, Integer>(aOutput4, aPerc4); + Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>> aDataQuad = new Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>>(aFluidOutput1, aFluidOutput2, aFluidOutput3, aFluidOutput4); + aMilledFluidMap.put(aMilledFluid.getUnlocalizedName(), aDataQuad); + + } + + private static ItemStack[] getOutputsFromMap(Fluid aFluid) { + String aKey = aFluid.getUnlocalizedName(); + return getArrayFromQuad(aMilledFluidMap.get(aKey)); + } + + private static ItemStack[] getArrayFromQuad(Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>> aData) { + AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>(); + for (Object aPair : aData.values()) { + if (aPair != null && Pair.class.isInstance(aPair)) { + Pair aObj = (Pair) aPair; + Material aMat = (Material) aObj.getKey(); + int aCount = (int) aObj.getValue(); + aOutputs.addAll(getItemStackFromPair(aMat, aCount)); + } + } + ItemStack[] aRealOutputArray = new ItemStack[aOutputs.size()]; + int aIndex = 0; + for (ItemStack aStack : aOutputs) { + aRealOutputArray[aIndex++] = aStack; + } + return aRealOutputArray; + } + + private static AutoMap<ItemStack> getItemStackFromPair(Material aMat, Integer aCount) { + AutoMap<ItemStack> aOutputs = new AutoMap<ItemStack>(); + if (aCount > 64) { + AutoMap<Integer> sizes = getStackSizes(aCount); + for (int aSplitSize : sizes) { + ItemStack aDustStack = aMat.getDust(aSplitSize); + aOutputs.put(aDustStack); + } + } + else { + ItemStack aDustStack = aMat.getDust(aCount); + aOutputs.put(aDustStack); + } + return aOutputs; + } + + private static AutoMap<Integer> getStackSizes(int aBigSize){ + AutoMap<Integer> aSizes = new AutoMap<Integer>(); + if (aBigSize <= 64) { + aSizes.add(aBigSize); + } + else { + for (int i = aBigSize; i > 0; i -= 64) { + aSizes.add(i); + } + } + return aSizes; + } + } diff --git a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 459acb31b9..7745f50010 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -185,7 +185,7 @@ public class RocketFuels extends ItemPackage { CORE.RA.addChemicalPlantRecipe( new ItemStack[] { - CI.getNumberedBioCircuit(21), + CI.getNumberedAdvancedCircuit(21), }, new FluidStack[] { FluidUtils.getFluidStack("ammonia", 4000), @@ -220,7 +220,7 @@ public class RocketFuels extends ItemPackage { CORE.RA.addChemicalPlantRecipe( new ItemStack[] { - CI.getNumberedBioCircuit(21), + CI.getNumberedAdvancedCircuit(21), ItemUtils.getSimpleStack(Formaldehyde_Catalyst, 0), }, new FluidStack[] { @@ -258,7 +258,7 @@ public class RocketFuels extends ItemPackage { CORE.RA.addChemicalPlantRecipe( new ItemStack[] { - CI.getNumberedBioCircuit(21), + CI.getNumberedAdvancedCircuit(21), ItemUtils.getSimpleStack(Formaldehyde_Catalyst, 0), }, new FluidStack[] { diff --git a/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java index 7fb5f207f6..ed17f8547a 100644 --- a/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java +++ b/src/Java/gtPlusPlus/core/item/chemistry/general/ItemGenericChemBase.java @@ -3,6 +3,8 @@ package gtPlusPlus.core.item.chemistry.general; import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.item.chemistry.GenericChem; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.client.renderer.texture.IIconRegister; @@ -12,6 +14,8 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.world.World; @@ -19,7 +23,7 @@ public class ItemGenericChemBase extends Item { final protected IIcon base[]; - final private int aMetaSize = 9; + final private int aMetaSize = 13; /* * 0 - Red Metal Catalyst //FeCu @@ -31,6 +35,10 @@ public class ItemGenericChemBase extends Item { * 6 - Pink Metal Catalyst //PtRh * 7 - Alumina Grinding Ball * 8 - Soapstone Grinding Ball + * 9 - Sodium Ethoxide // 2 Sodium + 1 Ethanol | 2 C2H5OH + 2 Na → 2 C2H5ONa + H2 + * 10 - Sodium Ethyl Xanthate //CH3CH2ONa + CS2 → CH3CH2OCS2Na + * 11 - Potassium Ethyl Xanthate //CH3CH2OH + CS2 + KOH → CH3CH2OCS2K + H2O + * 12 - Potassium Hydroxide // KOH */ public ItemGenericChemBase() { @@ -44,6 +52,14 @@ public class ItemGenericChemBase extends Item { } @Override + public int getItemStackLimit(ItemStack stack) { + if (ItemUtils.isMillingBall(stack)) { + return 16; + } + return super.getItemStackLimit(stack); + } + + @Override public boolean isDamageable() { return false; } @@ -64,17 +80,6 @@ public class ItemGenericChemBase extends Item { } @Override - public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { - try { - - } - catch (Throwable t) { - t.printStackTrace(); - } - super.addInformation(aStack, p_77624_2_, aList, p_77624_4_); - } - - @Override public EnumRarity getRarity(ItemStack p_77613_1_) { return EnumRarity.common; } @@ -112,11 +117,6 @@ public class ItemGenericChemBase extends Item { } @Override - public boolean showDurabilityBar(ItemStack stack) { - return false; - } - - @Override public int getItemEnchantability() { return 0; } @@ -161,4 +161,167 @@ public class ItemGenericChemBase extends Item { } + + @Override + public double getDurabilityForDisplay(ItemStack aStack) { + if (ItemUtils.isMillingBall(aStack)) { + if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()){ + createMillingBallNBT(aStack); + } + double currentDamage = getMillingBallDamage(aStack); + double durabilitypercent = currentDamage / 100; + return durabilitypercent; + } + else if (ItemUtils.isCatalyst(aStack)) { + if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()){ + createCatalystNBT(aStack); + } + double currentDamage = getCatalystDamage(aStack); + double durabilitypercent = currentDamage / 100; + return durabilitypercent; + } + else { + return 1D; + } + } + + @SuppressWarnings("unchecked") + @Override + public void addInformation(ItemStack aStack, EntityPlayer player, List list, boolean bool) { + boolean aHasSpecialTooltips = false; + int aMaxDamage = 0; + int aDamageSegment = 0; + int aDam = 0; + EnumChatFormatting durability = EnumChatFormatting.GRAY; + if (ItemUtils.isMillingBall(aStack)) { + list.add(EnumChatFormatting.GRAY+"Tumble Tumble Tumble"); + aMaxDamage = getMillingBallMaxDamage(aStack); + aDamageSegment = aMaxDamage / 5; + aDam = aMaxDamage-getMillingBallDamage(aStack); + aHasSpecialTooltips = true; + } + if (ItemUtils.isCatalyst(aStack)) { + list.add(EnumChatFormatting.GRAY+"Active Reaction Agent"); + aMaxDamage = getCatalystMaxDamage(aStack); + aDamageSegment = aMaxDamage / 5; + aDam = aMaxDamage-getCatalystDamage(aStack); + aHasSpecialTooltips = true; + } + if (aHasSpecialTooltips) { + if (aDam > aDamageSegment * 4){ + durability = EnumChatFormatting.GRAY; + } + else if (aDam > aDamageSegment * 3){ + durability = EnumChatFormatting.GREEN; + } + else if (aDam > aDamageSegment * 2){ + durability = EnumChatFormatting.YELLOW; + } + else if (aDam > aDamageSegment){ + durability = EnumChatFormatting.GOLD; + } + else if (aDam > 0){ + durability = EnumChatFormatting.RED; + } + list.add(durability+""+(aDam)+EnumChatFormatting.GRAY+" / "+aMaxDamage); + } + super.addInformation(aStack, player, list, bool); + } + + @Override + public boolean showDurabilityBar(ItemStack aStack) { + if (ItemUtils.isMillingBall(aStack)) { + int aDam = getMillingBallDamage(aStack); + if (aDam > 0) { + return true; + } + } + else if (ItemUtils.isCatalyst(aStack)) { + int aDam = getCatalystDamage(aStack); + if (aDam > 0) { + return true; + } + } + return false; + } + + public static boolean createMillingBallNBT(ItemStack rStack){ + final NBTTagCompound tagMain = new NBTTagCompound(); + final NBTTagCompound tagNBT = new NBTTagCompound(); + tagNBT.setLong("Damage", 0); + tagNBT.setLong("MaxDamage", getMaxBallDurability(rStack)); + tagMain.setTag("MillingBall", tagNBT); + rStack.setTagCompound(tagMain); + return true; + } + + public static int getMillingBallDamage(ItemStack aStack) { + if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) { + createMillingBallNBT(aStack); + } + NBTTagCompound aNBT = aStack.getTagCompound(); + return aNBT.getCompoundTag("MillingBall").getInteger("Damage"); + } + + public static int getMillingBallMaxDamage(ItemStack aStack) { + if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) { + createMillingBallNBT(aStack); + } + NBTTagCompound aNBT = aStack.getTagCompound(); + return aNBT.getCompoundTag("MillingBall").getInteger("MaxDamage"); + } + + public static void setMillingBallDamage(ItemStack aStack,int aAmount) { + NBTTagCompound aNBT = aStack.getTagCompound(); + aNBT = aNBT.getCompoundTag("MillingBall"); + aNBT.setInteger("Damage", aAmount); + } + + public static int getMaxBallDurability(ItemStack aStack) { + if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallAlumina, true)) { + return 100; + } + if (GT_Utility.areStacksEqual(aStack, GenericChem.mMillingBallSoapstone, true)) { + return 50; + } + return 0; + } + + public static boolean createCatalystNBT(ItemStack rStack){ + final NBTTagCompound tagMain = new NBTTagCompound(); + final NBTTagCompound tagNBT = new NBTTagCompound(); + tagNBT.setLong("Damage", 0); + tagNBT.setLong("MaxDamage", getMaxCatalystDurability(rStack)); + tagMain.setTag("catalyst", tagNBT); + rStack.setTagCompound(tagMain); + return true; + } + + public static int getCatalystDamage(ItemStack aStack) { + if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) { + createCatalystNBT(aStack); + } + NBTTagCompound aNBT = aStack.getTagCompound(); + return aNBT.getCompoundTag("catalyst").getInteger("Damage"); + } + + public static int getCatalystMaxDamage(ItemStack aStack) { + if (aStack.getTagCompound() == null || aStack.getTagCompound().hasNoTags()) { + createCatalystNBT(aStack); + } + NBTTagCompound aNBT = aStack.getTagCompound(); + return aNBT.getCompoundTag("catalyst").getInteger("MaxDamage"); + } + + public static void setCatalystDamage(ItemStack aStack,int aAmount) { + NBTTagCompound aNBT = aStack.getTagCompound(); + aNBT = aNBT.getCompoundTag("catalyst"); + aNBT.setInteger("Damage", aAmount); + } + + public static int getMaxCatalystDurability(ItemStack aStack) { + return 50; + } + + } diff --git a/src/Java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java b/src/Java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java new file mode 100644 index 0000000000..c375c32952 --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/circuit/ItemAdvancedChip.java @@ -0,0 +1,138 @@ +package gtPlusPlus.core.item.circuit; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + +public class ItemAdvancedChip extends Item { + + protected IIcon base; + + public ItemAdvancedChip() { + this.setHasSubtypes(true); + this.setNoRepair(); + this.setMaxStackSize(64); + this.setMaxDamage(0); + this.setUnlocalizedName("T3RecipeSelector"); + GameRegistry.registerItem(this, this.getUnlocalizedName()); + } + + @Override + public boolean isDamageable() { + return false; + } + + @Override + public boolean shouldRotateAroundWhenRendering() { + return super.shouldRotateAroundWhenRendering(); + } + + @Override + public void onUpdate(ItemStack p_77663_1_, World p_77663_2_, Entity p_77663_3_, int p_77663_4_, boolean p_77663_5_) { + super.onUpdate(p_77663_1_, p_77663_2_, p_77663_3_, p_77663_4_, p_77663_5_); + } + + @Override + public String getItemStackDisplayName(ItemStack aStack) { + return super.getItemStackDisplayName(aStack); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer p_77624_2_, List aList, boolean p_77624_4_) { + try { + aList.add("Configuration == "+aStack.getItemDamage()); + } + catch (Throwable t) { + t.printStackTrace(); + } + super.addInformation(aStack, p_77624_2_, aList, p_77624_4_); + } + + @Override + public EnumRarity getRarity(ItemStack p_77613_1_) { + return EnumRarity.common; + } + + @Override + public void getSubItems(Item aItem, CreativeTabs p_150895_2_, List aList) { + aList.add(ItemUtils.simpleMetaStack(aItem, 0, 1)); + } + + @Override + public boolean getIsRepairable(ItemStack p_82789_1_, ItemStack p_82789_2_) { + return false; + } + + @Override + public boolean isRepairable() { + return false; + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; + } + + @Override + public int getDisplayDamage(ItemStack stack) { + return stack.getItemDamage(); + } + + @Override + public boolean showDurabilityBar(ItemStack stack) { + return false; + } + + @Override + public int getItemEnchantability() { + return 0; + } + + @Override + public int getItemEnchantability(ItemStack stack) { + return 0; + } + + @Override + public void registerIcons(final IIconRegister u) { + this.base = u.registerIcon(CORE.MODID + ":" + "science/general/AdvancedCircuit"); + } + + @Override + public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) { + return this.base; + } + + @Override + public IIcon getIconFromDamage(int damage) { + return this.base; + } + + @Override + public IIcon getIcon(ItemStack stack, int renderPass, EntityPlayer player, ItemStack usingItem, int useRemaining) { + return this.base; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return this.base; + } + + @Override + public String getUnlocalizedName(ItemStack stack) { + return super.getUnlocalizedName(); + } + + +} diff --git a/src/Java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java b/src/Java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java new file mode 100644 index 0000000000..1f8009e54a --- /dev/null +++ b/src/Java/gtPlusPlus/core/item/wearable/hazmat/ItemArmorHazmatEx.java @@ -0,0 +1,31 @@ +package gtPlusPlus.core.item.wearable.hazmat; + +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.ic2.CustomInternalName; +import ic2.core.IC2; +import ic2.core.init.InternalName; +import ic2.core.item.armor.ItemArmorHazmat; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; + +public class ItemArmorHazmatEx extends ItemArmorHazmat { + + public static void init() { + GregtechItemList.Armour_Hazmat_Advanced_Helmet.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatHelmetEx, 0))); + GregtechItemList.Armour_Hazmat_Advanced_Chest.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatChestEx, 1))); + GregtechItemList.Armour_Hazmat_Advanced_Legs.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatLegsEx, 2))); + GregtechItemList.Armour_Hazmat_Advanced_Boots.set(new ItemStack(new ItemArmorHazmatEx(CustomInternalName.aHazmatBootsEx, 3))); + } + + private ItemArmorHazmatEx(InternalName internalName, int type) { + super(internalName, type); + this.setMaxDamage(256); + } + + @Override + public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { + int suffix = this.armorType == 2 ? 2 : 1; + return IC2.textureDomain + ":textures/armor/" + "hazmatEx_" + suffix + ".png"; + } + +} |