aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/forestry/bees/items
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-23 20:07:04 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-23 20:07:04 +0000
commit3d46d957637c60aeecb59065da2328401f27949d (patch)
tree2c1089e9e829812d14388d9710c190da24a772ca /src/main/java/gtPlusPlus/xmod/forestry/bees/items
parent43be31d2ac5c8d390579edd4faa5817e91fc4b1a (diff)
downloadGT5-Unofficial-3d46d957637c60aeecb59065da2328401f27949d.tar.gz
GT5-Unofficial-3d46d957637c60aeecb59065da2328401f27949d.tar.bz2
GT5-Unofficial-3d46d957637c60aeecb59065da2328401f27949d.zip
Added some bees and shit.
Added Force. Updated how GT++ material components get localized.
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/forestry/bees/items')
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java233
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java34
3 files changed, 58 insertions, 245 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java
index f191cc4ae1..138ffe3cb4 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java
@@ -25,6 +25,8 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.api.util.GT_OreDictUnificator;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_CombType;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType;
@@ -108,220 +110,29 @@ public class GTPP_Comb extends Item {
return GTPP_CombType.get(stack.getItemDamage()).getName();
}
- public void initCombsRecipes() {
- addCentrifugeToItemStack(GTPP_CombType.DRAGONBLOOD, new ItemStack[]{GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.DRAGONBLOOD), GTPP_Bees.drop.getStackForType(GTPP_DropType.DRAGONBLOOD)}, new int[]{30
- * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV);
- }
-
- /**
- * Currently use for STEEL, GOLD, MOLYBDENUM, PLUTONIUM
- **/
- public void addChemicalProcess(GTPP_CombType comb, Materials aInMaterial, Materials aOutMaterial, Voltage volt) {
- if (GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4) == NI)
- return;
- RA.addChemicalRecipe(GT_Utility.copyAmount(9, getStackForType(comb)), GT_OreDictUnificator.get(OrePrefixes.crushed, aInMaterial, 1), volt.getComplexChemical(), aInMaterial.mOreByProducts.isEmpty() ? null : aInMaterial.mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aOutMaterial, 4), NI, volt.getComplexTime(), volt.getChemicalEnergy(), volt.compareTo(Voltage.IV) > 0);
- }
-
- /**
- * Currently only used for GTPP_CombType.MOLYBDENUM
- *
- * @param circuitNumber
- * should not conflict with addProcessGT
- *
- **/
- public void addAutoclaveProcess(GTPP_CombType comb, Materials aMaterial, Voltage volt, int circuitNumber) {
- if (GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4) == NI)
- return;
- RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, getStackForType(comb)), GT_Utility.getIntegratedCircuit(circuitNumber), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial.getMass()
- + volt.getUUAmplifier())
- / 10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial, 4), 10000, (int) (aMaterial.getMass() * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0);
- }
-
- /**
- * this only adds Chemical and AutoClave process. If you need Centrifuge
- * recipe. use addCentrifugeToMaterial or addCentrifugeToItemStack
- *
- * @param volt
- * This determine the required Tier of process for this recipes.
- * This decide the required aEU/t, progress time, required
- * additional UU-Matter, requirement of cleanRoom, needed fluid
- * stack for Chemical.
- * @param aMaterial
- * result of Material that should be generated by this process.
- **/
- public void addProcessGT(GTPP_CombType comb, Materials[] aMaterial, Voltage volt) {
- ItemStack tComb = getStackForType(comb);
- for (int i = 0; i < aMaterial.length; i++) {
- if (GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4) != NI) {
- RA.addChemicalRecipe(GT_Utility.copyAmount(9, tComb), GT_OreDictUnificator.get(OrePrefixes.crushed, aMaterial[i], 1), volt.getComplexChemical(), aMaterial[i].mOreByProducts.isEmpty() ? null : aMaterial[i].mOreByProducts.get(0).getMolten(144), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), NI, volt.getComplexTime(), volt.getChemicalEnergy(), volt.compareTo(Voltage.IV) > 0);
- RA.addAutoclaveRecipe(GT_Utility.copyAmount(9, tComb), GT_Utility.getIntegratedCircuit(i + 1), Materials.UUMatter.getFluid(Math.max(1, ((aMaterial[i].getMass() + volt.getUUAmplifier())
- / 10))), GT_OreDictUnificator.get(OrePrefixes.crushedPurified, aMaterial[i], 4), 10000, (int) (aMaterial[i].getMass()
- * 128), volt.getAutoClaveEnergy(), volt.compareTo(Voltage.HV) > 0);
- }
- }
- }
-
- /**
- * this method only adds Centrifuge based on Material. If volt is lower than
- * MV than it will also adds forestry centrifuge recipe.
- *
- * @param comb
- * BeeComb
- * @param aMaterial
- * resulting Material of processing. can be more than 6. but over
- * 6 will be ignored in Gregtech Centrifuge.
- * @param chance
- * chance to get result, 10000 == 100%
- * @param volt
- * required Voltage Tier for this recipe, this also affect the
- * duration, amount of UU-Matter, and needed liquid type and
- * amount for chemical reactor
- * @param stackSize
- * This parameter can be null, in that case stack size will be
- * just 1. This handle the stackSize of the resulting Item, and
- * Also the Type of Item. if this value is multiple of 9, than
- * related Material output will be dust, if this value is
- * multiple of 4 than output will be Small dust, else the output
- * will be Tiny dust
- * @param beeWax
- * if this is null, than the comb will product default Bee wax.
- * But if aMaterial is more than 5, beeWax will be ignored in
- * Gregtech Centrifuge.
- * @param waxChance
- * have same format like "chance"
- **/
- public void addCentrifugeToMaterial(GTPP_CombType comb, Materials[] aMaterial, int[] chance, int[] stackSize, Voltage volt, ItemStack beeWax, int waxChance) {
- addCentrifugeToMaterial(comb, aMaterial, chance, stackSize, volt, volt.getSimpleTime(), beeWax, waxChance);
- }
- public void addCentrifugeToMaterial(GTPP_CombType comb, Materials[] aMaterial, int[] chance, int[] stackSize, Voltage volt, int duration, ItemStack beeWax, int waxChance) {
- ItemStack[] aOutPut = new ItemStack[aMaterial.length + 1];
- stackSize = Arrays.copyOf(stackSize, aMaterial.length);
- chance = Arrays.copyOf(chance, aOutPut.length);
- chance[chance.length - 1] = waxChance;
- for (int i = 0; i < (aMaterial.length); i++) {
- if (chance[i] == 0) {
- continue;
- }
- if (Math.max(1, stackSize[i]) % 9 == 0) {
- aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dust, aMaterial[i], (Math.max(1, stackSize[i]) / 9));
- }
- else if (Math.max(1, stackSize[i]) % 4 == 0) {
- aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial[i], (Math.max(1, stackSize[i]) / 4));
- }
- else {
- aOutPut[i] = GT_OreDictUnificator.get(OrePrefixes.dustTiny, aMaterial[i], Math.max(1, stackSize[i]));
- }
- }
- if (beeWax != NI) {
- aOutPut[aOutPut.length - 1] = beeWax;
- }
- else {
- aOutPut[aOutPut.length - 1] = ItemList.FR_Wax.get(1);
- }
-
- addCentrifugeToItemStack(comb, aOutPut, chance, volt, duration);
- }
-
- /**
- * @param volt
- * required Tier of system. If it's lower than MV, it will also
- * add forestry centrifuge.
- * @param aItem
- * can be more than 6. but Over 6 will be ignored in Gregtech
- * Centrifuge.
- **/
- public void addCentrifugeToItemStack(GTPP_CombType comb, ItemStack[] aItem, int[] chance, Voltage volt) {
- addCentrifugeToItemStack(comb, aItem, chance, volt, volt.getSimpleTime());
- }
- public void addCentrifugeToItemStack(GTPP_CombType comb, ItemStack[] aItem, int[] chance, Voltage volt, int duration) {
- ItemStack tComb = getStackForType(comb);
- Builder<ItemStack, Float> Product = new ImmutableMap.Builder<ItemStack, Float>();
- for (int i = 0; i < aItem.length; i++) {
- if (aItem[i] == NI) {
- continue;
- }
- Product.put(aItem[i], chance[i] / 10000.0f);
- }
-
- if (volt.compareTo(Voltage.MV) < 0 || !GT_Mod.gregtechproxy.mNerfedCombs) {
- RecipeManagers.centrifugeManager.addRecipe(40, tComb, Product.build());
- }
+ public static void initCombsRecipes() {
- aItem = Arrays.copyOf(aItem, 6);
- if (aItem.length > 6) {
- chance = Arrays.copyOf(chance, 6);
- }
+ addChemicalRecipe(GTPP_CombType.DRAGONBLOOD, new ItemStack[]{GT_ModHandler.getModItem("Forestry", "refractoryWax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.DRAGONBLOOD), GTPP_Bees.drop.getStackForType(GTPP_DropType.DRAGONBLOOD)}, new int[]{3000, 1500, 500});
+ addChemicalRecipe(GTPP_CombType.FORCE, new ItemStack[]{GT_ModHandler.getModItem("Forestry", "refractoryWax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.FORCE), GTPP_Bees.drop.getStackForType(GTPP_DropType.FORCE)}, new int[]{5000, 3000, 1000});
- RA.addCentrifugeRecipe(tComb, NI, NF, NF, aItem[0], aItem[1], aItem[2], aItem[3], aItem[4], aItem[5], chance, duration, volt.getSimpleEnergy());
}
- enum Voltage {
- ULV, LV, MV, HV, EV, IV, LUV, ZPM, UV, UHV, UEV, UIV, UMV, UXV, OpV, MAX;
- public int getVoltage() {
- return (int) V[this.ordinal()];
- }
- /**
- * @return aEU/t needed for chemical and autoclave process related to
- * the Tier
- **/
- public int getChemicalEnergy() {
- return this.getVoltage() * 3 / 4;
- }
- public int getAutoClaveEnergy() {
- return (int) ((this.getVoltage() * 3 / 4) * (Math.max(1, Math.pow(2, 5 - this.ordinal()))));
- }
- /**
- * @return FluidStack needed for chemical process related to the Tier
- **/
- public FluidStack getComplexChemical() {
- if (this.compareTo(Voltage.MV) < 0) {
- return Materials.Water.getFluid((this.compareTo(Voltage.ULV) > 0) ? 1000 : 500);
- }
- else if (this.compareTo(Voltage.HV) < 0) {
- return GT_ModHandler.getDistilledWater(1000L);
- }
- else if (this.compareTo(Voltage.LUV) < 0) {
- return Materials.Mercury.getFluid((long) (Math.pow(2, this.compareTo(Voltage.HV)) * L));
- }
- else if (this.compareTo(Voltage.UHV) < 0) {
- return FluidRegistry.getFluidStack("mutagen", (int) (Math.pow(2, this.compareTo(Voltage.LUV)) * L));
- }
- else {
- return NF;
- }
- }
- /**
- * @return additional required UU-Matter amount for Autoclave process
- * related to the Tier
- **/
- public int getUUAmplifier() {
- return 9 * ((this.compareTo(Voltage.MV) < 0) ? 1 : this.compareTo(Voltage.MV));
- }
- /** @return duration needed for Chemical process related to the Tier **/
- public int getComplexTime() {
- return 64 + this.ordinal() * 32;
- }
- /**
- * @return duration needed for Centrifuge process related to the Tier
- **/
- public int getSimpleTime() {
- if (!GT_Mod.gregtechproxy.mNerfedCombs) {
- return 96 + this.ordinal() * 32;
- }
- else {
- // ULV, LV needs 128ticks, MV need 256 ticks, HV need 384 ticks,
- // EV need 512 ticks, IV need 640 ticks
- return 128 * (Math.max(1, this.ordinal()));
- }
- }
- /** @return aEU/t needed for Centrifuge process related to the Tier **/
- public int getSimpleEnergy() {
- if (this == Voltage.ULV) {
- return 5;
- }
- else {
- return (int) (this.getVoltage() / 16) * 15;
- }
- }
+ public static void addChemicalRecipe(GTPP_CombType aInputStack, ItemStack[] aOutputs, int[] aChances) {
+ Material aMat = aInputStack.mMaterial;
+ long aEU = aMat.vVoltageMultiplier;
+ int aTier = Math.max(aMat.vTier/2, 1);
+ CORE.RA.addChemicalPlantRecipe(
+ new ItemStack[] {
+ aInputStack.getStackForType(aTier),
+ },
+ new FluidStack[] {},
+ aOutputs,
+ new FluidStack[] {},
+ aChances,
+ aTier * 20 * 60,
+ aEU,
+ aTier);
+
}
+
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java
index 3450c49570..922adad277 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java
@@ -7,9 +7,10 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs;
import gregtech.api.enums.GT_Values;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
-import gtPlusPlus.core.material.ELEMENT.STANDALONE;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType;
+import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@@ -87,23 +88,26 @@ public class GTPP_Drop extends Item {
public String getItemStackDisplayName(ItemStack stack) {
return GTPP_DropType.get(stack.getItemDamage()).getName();
}
- public void initDropsRecipes() {
+
+ private static final int[] sFluidOutputs = new int[] {
+ 144, 136, 128, 120, 112, 104, 96, 88, 80, 72, 64, 48, 32, 16, 8, 4
+ };
+
+ public static void initDropsRecipes() {
ItemStack tDrop;
-
- tDrop = getStackForType(GTPP_DropType.DRAGONBLOOD);
- addProcessHV(tDrop, new FluidStack(STANDALONE.DRAGON_METAL.getFluid(), 4), GT_Values.NI, 1000);
+ Logger.BEES("Processing recipes for "+GTPP_Bees.sDropMappings.size()+" Drops.");
+ for (GTPP_DropType aDrop : GTPP_Bees.sDropMappings.values()) {
+ tDrop = aDrop.getStackForType(1);
+ if (addProcess(tDrop, new FluidStack(aDrop.mMaterial.getFluid(), sFluidOutputs[aDrop.mMaterial.vTier]), aDrop.mMaterial.vTier * 20 * 30, aDrop.mMaterial.vVoltageMultiplier)) {
+ Logger.BEES("Added Drop extraction recipe for: "+aDrop.getName());
+ }
+ else {
+ Logger.BEES("Failed to add Drop extraction recipe for: "+aDrop.getName());
+ }
+ }
}
- public void addProcessLV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aEUt) {
- GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 32, aEUt);
- }
- public void addProcessLV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aDuration, int aEUt) {
- GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, aDuration, aEUt);
- }
- public void addProcessMV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aEUt) {
- GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 128, aEUt);
- }
- public void addProcessHV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance) {
- GT_Values.RA.addFluidExtractionRecipe(tDrop, aOutput2, aOutput, aChance, 480, 480);
+ public static boolean addProcess(ItemStack tDrop, FluidStack aOutput, int aDuration, int aEUt) {
+ return GT_Values.RA.addFluidExtractionRecipe(tDrop, null, aOutput, 10000, aDuration, aEUt);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java
index 8d61801d20..d1cf088d39 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java
@@ -7,15 +7,15 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs;
import gregtech.api.enums.GT_Values;
-import gregtech.api.util.GT_ModHandler;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType;
+import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
-import net.minecraftforge.fluids.FluidRegistry;
public class GTPP_Propolis extends Item {
@@ -70,24 +70,22 @@ public class GTPP_Propolis extends Item {
public String getItemStackDisplayName(ItemStack stack) {
return GTPP_PropolisType.get(stack.getItemDamage()).getName();
}
-
- public void initPropolisRecipes() {
- ItemStack tPropolis;
-
-
- tPropolis = getStackForType(GTPP_PropolisType.DRAGONBLOOD);
- addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 0));
- //addRecipe(tDrop, aOutput, aOutput2, aChance, aDuration, aEUt);
+ public static void initPropolisRecipes() {
+ ItemStack tDrop;
+ Logger.BEES("Processing recipes for "+GTPP_Bees.sPropolisMappings.size()+" Propolis.");
+ for (GTPP_PropolisType aProp : GTPP_Bees.sPropolisMappings.values()) {
+ tDrop = aProp.getStackForType(1);
+ if (addProcess(tDrop, aProp.mMaterial.getDust(1), (int) Math.min(Math.max(10000-(aProp.mMaterial.vTier*625), 100) / 10, 10000), aProp.mMaterial.vTier * 20 * 15, aProp.mMaterial.vVoltageMultiplier)) {
+ Logger.BEES("Added Propolis extraction recipe for: "+aProp.getName());
+ }
+ else {
+ Logger.BEES("Failed to add Propolis extraction recipe for: "+aProp.getName());
+ }
+ }
}
- public void addProcessHV(ItemStack tPropolis, ItemStack aOutput2) {
- GT_Values.RA.addFluidExtractionRecipe(tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo",100), 5000, 50, 480);
- }
- public void addProcessEV(ItemStack tPropolis, ItemStack aOutput2) {
- GT_Values.RA.addFluidExtractionRecipe(tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo",200), 2500, 100, 1920);
- }
- public void addProcessIV(ItemStack tPropolis, ItemStack aOutput2) {
- GT_Values.RA.addFluidExtractionRecipe(tPropolis, aOutput2, FluidRegistry.getFluidStack("endergoo",300), 1500, 150, 7680);
+ public static boolean addProcess(ItemStack tDrop, ItemStack aOutput, int aChance, int aDuration, int aEUt) {
+ return CORE.RA.addExtractorRecipe(tDrop, aOutput, aChance, aDuration, aEUt);
}
}