aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/forestry
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
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')
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java17
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java10
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java13
-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
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java419
-rw-r--r--src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java31
10 files changed, 333 insertions, 475 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
index 7f372837a5..694613c3ab 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java
@@ -28,7 +28,7 @@ public class HANDLER_FR {
public static void postInit(){
if (LoadedMods.Forestry){
FR_Gregtech_Recipes.registerItems();
- new GTPP_Bees();
+ new GTPP_Bees();
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java
index b3f12bc9d5..488ef2ea0b 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java
@@ -1,17 +1,18 @@
package gtPlusPlus.xmod.forestry.bees.handler;
-import gregtech.api.enums.Materials;
import gregtech.api.util.GT_LanguageManager;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
+import net.minecraft.item.ItemStack;
public enum GTPP_CombType {
- DRAGONBLOOD(0, "Dragon Blood", true, Materials._NULL, 30, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)),
- FORCE(1, "Force", true, Materials.Force, 30, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5));
+ DRAGONBLOOD(0, "Dragon Blood", true, 30, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)),
+ FORCE(1, "Force", true, 30, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5));
public boolean mShowInList;
- public Materials mMaterial;
+ public Material mMaterial;
public int mChance;
public int mID;
@@ -27,15 +28,15 @@ public enum GTPP_CombType {
return GTPP_Bees.sCombMappings.get(aID);
}
- GTPP_CombType(int aID, String aName, boolean aShow, Materials aMaterial, int aChance, int... aColour) {
+ GTPP_CombType(int aID, String aName, boolean aShow, int aChance, int... aColour) {
this.mID = aID;
this.mName = aName;
this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", "");
- this.mMaterial = aMaterial;
this.mChance = aChance;
this.mShowInList = aShow;
this.mColour = aColour;
map(aID, this);
+ this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
}
public void setHidden() {
@@ -49,4 +50,8 @@ public enum GTPP_CombType {
public int[] getColours() {
return mColour == null || mColour.length != 2 ? new int[]{0, 0} : mColour;
}
+
+ public ItemStack getStackForType(int count) {
+ return new ItemStack(GTPP_Bees.combs, count, mID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java
index 70333fdf2d..60b8a18e48 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java
@@ -1,16 +1,18 @@
package gtPlusPlus.xmod.forestry.bees.handler;
-import gregtech.api.enums.Materials;
import gregtech.api.util.GT_LanguageManager;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
+import net.minecraft.item.ItemStack;
public enum GTPP_DropType {
- DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20));
+ DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)),
+ FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5));
public boolean mShowInList;
- public Materials mMaterial;
+ public Material mMaterial;
public int mChance;
public int mID;
@@ -33,6 +35,7 @@ public enum GTPP_DropType {
this.mShowInList = aShow;
this.mColour = aColour;
map(aID, this);
+ this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
}
public void setHidden() {
@@ -46,4 +49,8 @@ public enum GTPP_DropType {
public int[] getColours() {
return mColour;
}
+
+ public ItemStack getStackForType(int count) {
+ return new ItemStack(GTPP_Bees.drop, count, mID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java
index cf0543ebf1..70dae45d06 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java
@@ -1,16 +1,17 @@
package gtPlusPlus.xmod.forestry.bees.handler;
-import gregtech.api.enums.Materials;
import gregtech.api.util.GT_LanguageManager;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
+import net.minecraft.item.ItemStack;
public enum GTPP_PollenType {
DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20));
public boolean mShowInList;
- public Materials mMaterial;
+ public Material mMaterial;
public int mChance;
public int mID;
@@ -33,6 +34,7 @@ public enum GTPP_PollenType {
this.mShowInList = aShow;
this.mColour = aColour;
map(aID, this);
+ this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
}
public void setHidden() {
@@ -46,4 +48,8 @@ public enum GTPP_PollenType {
public int[] getColours() {
return mColour;
}
+
+ public ItemStack getStackForType(int count) {
+ return new ItemStack(GTPP_Bees.pollen, count, mID);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java
index a989b4d9cb..20e4f31008 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java
@@ -1,16 +1,18 @@
package gtPlusPlus.xmod.forestry.bees.handler;
-import gregtech.api.enums.Materials;
import gregtech.api.util.GT_LanguageManager;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees;
+import net.minecraft.item.ItemStack;
public enum GTPP_PropolisType {
- DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20));
+ DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20)),
+ FORCE(1, "Force", true, Utils.rgbtoHexValue(250, 250, 20));
public boolean mShowInList;
- public Materials mMaterial;
+ public Material mMaterial;
public int mChance;
public int mID;
@@ -33,6 +35,7 @@ public enum GTPP_PropolisType {
this.mShowInList = aShow;
this.mColour = aColour;
map(aID, this);
+ this.mMaterial = GTPP_Bees.sMaterialMappings.get(aName.toLowerCase().replaceAll(" ", ""));
}
public void setHidden() {
@@ -46,4 +49,8 @@ public enum GTPP_PropolisType {
public int getColours() {
return mColour;
}
+
+ public ItemStack getStackForType(int count) {
+ return new ItemStack(GTPP_Bees.propolis, count, mID);
+ }
}
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);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
index 7fcf4bf98f..f94a178007 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java
@@ -20,22 +20,23 @@ import forestry.core.genetics.alleles.AlleleHelper;
import forestry.core.genetics.alleles.EnumAllele.Lifespan;
import forestry.core.genetics.alleles.EnumAllele.Tolerance;
import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_ModHandler;
import gregtech.common.items.CombType;
import gregtech.loaders.misc.GT_Bees;
import gtPlusPlus.core.material.ELEMENT.STANDALONE;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.minecraft.MaterialUtils;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.forestry.bees.handler.GTPP_CombType;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.BiomeDictionary.Type;
-
-
public enum GTPP_BeeDefinition implements IBeeDefinition {
- DRAGONBLOOD(GTPP_BranchDefinition.LEGENDARY, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20),
+ DRAGONBLOOD(GTPP_BranchDefinition.LEGENDARY, "Dragon Blood", STANDALONE.DRAGON_METAL, true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20),
beeSpecies -> {
beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f);
beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(GTPP_CombType.DRAGONBLOOD), 0.10f);
@@ -56,7 +57,7 @@ public enum GTPP_BeeDefinition implements IBeeDefinition {
tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim
}
),
- FORCE(GTPP_BranchDefinition.LEGENDARY, "Force", true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5),
+ FORCE(GTPP_BranchDefinition.LEGENDARY, "Force", STANDALONE.FORCE, true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5),
beeSpecies -> {
beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f);
beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALT), 0.15f);
@@ -79,223 +80,215 @@ public enum GTPP_BeeDefinition implements IBeeDefinition {
),
;
- private final GTPP_BranchDefinition branch;
- private final GTPP_AlleleBeeSpecies species;
- private final Consumer<GTPP_AlleleBeeSpecies> mSpeciesProperties;
- private final Consumer<IAllele[]> mAlleles;
- private final Consumer<GTPP_BeeDefinition> mMutations;
- private IAllele[] template;
- private IBeeGenome genome;
-
- GTPP_BeeDefinition(GTPP_BranchDefinition branch,
- String binomial,
- boolean dominant,
- int primary,
- int secondary,
- Consumer<GTPP_AlleleBeeSpecies> aSpeciesProperties,
- Consumer<IAllele[]> aAlleles,
- Consumer<GTPP_BeeDefinition> aMutations
- ) {
- this.mAlleles = aAlleles;
- this.mMutations = aMutations;
- this.mSpeciesProperties = aSpeciesProperties;
- String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH);
- String species = WordUtils.capitalize(binomial);
-
- String uid = "gtpp.bee.species" + species;
- String description = "for.description." + species;
- String name = "for.bees.species." + lowercaseName;
- GT_LanguageManager.addStringLocalization("for.bees.species." + lowercaseName, species, true);
-
- this.branch = branch;
- this.species = new GTPP_AlleleBeeSpecies(uid, dominant, name, "GT++", description, branch.getBranch(), binomial, primary, secondary);
- }
-
- public static void initBees() {
- for (GTPP_BeeDefinition bee : values()) {
- bee.init();
- }
- for (GTPP_BeeDefinition bee : values()) {
- bee.registerMutations();
- }
- }
-
- protected static IAlleleBeeEffect getEffect(byte modid, String name) {
- String s;
- switch (modid) {
- case GTPP_Bees.EXTRABEES:
- s = "extrabees.effect." + name;
- break;
- case GTPP_Bees.GENDUSTRY:
- s = "gendustry.effect." + name;
- break;
- case GTPP_Bees.MAGICBEES:
- s = "magicbees.effect" + name;
- break;
- case GTPP_Bees.GREGTECH:
- s = "gregtech.effect" + name;
- break;
- default:
- s = "forestry.effect" + name;
- break;
-
- }
- return (IAlleleBeeEffect) AlleleManager.alleleRegistry.getAllele(s);
- }
-
- protected static IAlleleFlowers getFlowers(byte modid, String name) {
- String s;
- switch (modid) {
- case GTPP_Bees.EXTRABEES:
- s = "extrabees.flower." + name;
- break;
- case GTPP_Bees.GENDUSTRY:
- s = "gendustry.flower." + name;
- break;
- case GTPP_Bees.MAGICBEES:
- s = "magicbees.flower" + name;
- break;
- case GTPP_Bees.GREGTECH:
- s = "gregtech.flower" + name;
- break;
- default:
- s = "forestry.flowers" + name;
- break;
-
- }
- return (IAlleleFlowers) AlleleManager.alleleRegistry.getAllele(s);
- }
-
- protected static IAlleleBeeSpecies getSpecies(byte modid, String name) {
- String s;
- switch (modid) {
- case GTPP_Bees.EXTRABEES:
- s = "extrabees.species." + name;
- break;
- case GTPP_Bees.GENDUSTRY:
- s = "gendustry.bee." + name;
- break;
- case GTPP_Bees.MAGICBEES:
- s = "magicbees.species" + name;
- break;
- case GTPP_Bees.GREGTECH:
- s = "gregtech.species" + name;
- break;
- default:
- s = "forestry.species" + name;
- break;
-
- }
- IAlleleBeeSpecies ret = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s);
- return ret;
- }
-
-
- protected final void setSpeciesProperties(GTPP_AlleleBeeSpecies species2) {
- this.mSpeciesProperties.accept(species2);
- }
-
- protected final void setAlleles(IAllele[] template) {
- this.mAlleles.accept(template);
- }
-
- protected final void registerMutations() {
- this.mMutations.accept(this);
- }
-
- private void init() {
- setSpeciesProperties(species);
-
- template = branch.getTemplate();
- AlleleHelper.instance.set(template, SPECIES, species);
- setAlleles(template);
-
- genome = BeeManager.beeRoot.templateAsGenome(template);
-
- BeeManager.beeRoot.registerTemplate(template);
- }
-
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) {
- return registerMutation(parent1, parent2, chance, 1f);
- }
-
- protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance) {
- return registerMutation(parent1, parent2, chance, 1f);
- }
-
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance) {
- return registerMutation(parent1, parent2, chance, 1f);
- }
-
- protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance) {
- return registerMutation(parent1, parent2, chance, 1f);
- }
-
- protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance) {
- return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, 1f);
- }
-
- /**
- * Diese neue Funtion erlaubt Mutationsraten unter 1%. Setze dazu die Mutationsrate als Bruch mit chance / chancedivider
- * This new function allows Mutation percentages under 1%. Set them as a fraction with chance / chancedivider
- */
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) {
- return new GTPP_Bee_Mutation(parent1, parent2, this.getTemplate(), chance, chancedivider);
- }
-
- protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) {
- return registerMutation(parent1.species, parent2, chance, chancedivider);
- }
-
- protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) {
- return registerMutation(parent1, parent2.species, chance, chancedivider);
- }
-
- protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) {
- return registerMutation(parent1.species, parent2, chance, chancedivider);
- }
-
- protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance, float chancedivider) {
- return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, chancedivider);
- }
-
- @Override
- public final IAllele[] getTemplate() {
- return Arrays.copyOf(template, template.length);
- }
-
- @Override
- public final IBeeGenome getGenome() {
- return genome;
- }
-
- @Override
- public final IBee getIndividual() {
- return new Bee(genome);
- }
-
- @Override
- public final ItemStack getMemberStack(EnumBeeType beeType) {
- return BeeManager.beeRoot.getMemberStack(getIndividual(), beeType.ordinal());
- }
-
- public final IBeeDefinition getRainResist() {
- return new BeeVariation.RainResist(this);
- }
-
- private static final Class sGtBees = ReflectionUtils.getClass("gregtech.loaders.misc.GT_BeeDefinition");
-
- public static IAlleleBeeSpecies getGregtechBeeType(String name){
+ private final GTPP_BranchDefinition branch;
+ private final GTPP_AlleleBeeSpecies species;
+ private final Consumer<GTPP_AlleleBeeSpecies> mSpeciesProperties;
+ private final Consumer<IAllele[]> mAlleles;
+ private final Consumer<GTPP_BeeDefinition> mMutations;
+ private IAllele[] template;
+ private IBeeGenome genome;
+
+ GTPP_BeeDefinition(GTPP_BranchDefinition branch, String binomial, Materials aMat, boolean dominant, int primary, int secondary, Consumer<GTPP_AlleleBeeSpecies> aSpeciesProperties, Consumer<IAllele[]> aAlleles, Consumer<GTPP_BeeDefinition> aMutations) {
+ this(branch, binomial, MaterialUtils.generateMaterialFromGtENUM(aMat), dominant, primary, secondary, aSpeciesProperties, aAlleles, aMutations);
+ }
+
+ GTPP_BeeDefinition(GTPP_BranchDefinition branch, String binomial, Material aMat, boolean dominant, int primary, int secondary, Consumer<GTPP_AlleleBeeSpecies> aSpeciesProperties, Consumer<IAllele[]> aAlleles, Consumer<GTPP_BeeDefinition> aMutations) {
+ this.mAlleles = aAlleles;
+ this.mMutations = aMutations;
+ this.mSpeciesProperties = aSpeciesProperties;
+ String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH);
+ String species = WordUtils.capitalize(binomial);
+ String uid = "gtpp.bee.species" + species;
+ String description = "for.description." + species;
+ String name = "for.bees.species." + lowercaseName;
+ GT_LanguageManager.addStringLocalization("for.bees.species." + lowercaseName, species, true);
+ GTPP_Bees.sMaterialMappings.put(binomial.toLowerCase().replaceAll(" ", ""), aMat);
+ this.branch = branch;
+ this.species = new GTPP_AlleleBeeSpecies(uid, dominant, name, "GT++", description, branch.getBranch(), binomial, primary, secondary);
+ }
+
+ public static void initBees() {
+ for (GTPP_BeeDefinition bee : values()) { bee.init(); }
+ for (GTPP_BeeDefinition bee : values()) { bee.registerMutations(); }
+ }
+
+ protected static IAlleleBeeEffect getEffect(byte modid, String name) {
+ String s;
+ switch (modid) {
+ case GTPP_Bees.EXTRABEES :
+ s = "extrabees.effect." + name;
+ break;
+ case GTPP_Bees.GENDUSTRY :
+ s = "gendustry.effect." + name;
+ break;
+ case GTPP_Bees.MAGICBEES :
+ s = "magicbees.effect" + name;
+ break;
+ case GTPP_Bees.GREGTECH :
+ s = "gregtech.effect" + name;
+ break;
+ default :
+ s = "forestry.effect" + name;
+ break;
+
+ }
+ return (IAlleleBeeEffect) AlleleManager.alleleRegistry.getAllele(s);
+ }
+
+ protected static IAlleleFlowers getFlowers(byte modid, String name) {
+ String s;
+ switch (modid) {
+ case GTPP_Bees.EXTRABEES :
+ s = "extrabees.flower." + name;
+ break;
+ case GTPP_Bees.GENDUSTRY :
+ s = "gendustry.flower." + name;
+ break;
+ case GTPP_Bees.MAGICBEES :
+ s = "magicbees.flower" + name;
+ break;
+ case GTPP_Bees.GREGTECH :
+ s = "gregtech.flower" + name;
+ break;
+ default :
+ s = "forestry.flowers" + name;
+ break;
+
+ }
+ return (IAlleleFlowers) AlleleManager.alleleRegistry.getAllele(s);
+ }
+
+ protected static IAlleleBeeSpecies getSpecies(byte modid, String name) {
+ String s;
+ switch (modid) {
+ case GTPP_Bees.EXTRABEES :
+ s = "extrabees.species." + name;
+ break;
+ case GTPP_Bees.GENDUSTRY :
+ s = "gendustry.bee." + name;
+ break;
+ case GTPP_Bees.MAGICBEES :
+ s = "magicbees.species" + name;
+ break;
+ case GTPP_Bees.GREGTECH :
+ s = "gregtech.species" + name;
+ break;
+ default :
+ s = "forestry.species" + name;
+ break;
+
+ }
+ IAlleleBeeSpecies ret = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele(s);
+ return ret;
+ }
+
+ protected final void setSpeciesProperties(GTPP_AlleleBeeSpecies species2) {
+ this.mSpeciesProperties.accept(species2);
+ }
+
+ protected final void setAlleles(IAllele[] template) {
+ this.mAlleles.accept(template);
+ }
+
+ protected final void registerMutations() {
+ this.mMutations.accept(this);
+ }
+
+ private void init() {
+ setSpeciesProperties(species);
+
+ template = branch.getTemplate();
+ AlleleHelper.instance.set(template, SPECIES, species);
+ setAlleles(template);
+
+ genome = BeeManager.beeRoot.templateAsGenome(template);
+
+ BeeManager.beeRoot.registerTemplate(template);
+ }
+
+ protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance) {
+ return registerMutation(parent1, parent2, chance, 1f);
+ }
+
+ protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance) {
+ return registerMutation(parent1, parent2, chance, 1f);
+ }
+
+ protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance) {
+ return registerMutation(parent1, parent2, chance, 1f);
+ }
+
+ protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance) {
+ return registerMutation(parent1, parent2, chance, 1f);
+ }
+
+ protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance) {
+ return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, 1f);
+ }
+
+ /**
+ * Diese neue Funtion erlaubt Mutationsraten unter 1%. Setze dazu die
+ * Mutationsrate als Bruch mit chance / chancedivider This new function
+ * allows Mutation percentages under 1%. Set them as a fraction with chance
+ * / chancedivider
+ */
+ protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) {
+ return new GTPP_Bee_Mutation(parent1, parent2, this.getTemplate(), chance, chancedivider);
+ }
+
+ protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, IAlleleBeeSpecies parent2, int chance, float chancedivider) {
+ return registerMutation(parent1.species, parent2, chance, chancedivider);
+ }
+
+ protected final IBeeMutationCustom registerMutation(IAlleleBeeSpecies parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) {
+ return registerMutation(parent1, parent2.species, chance, chancedivider);
+ }
+
+ protected final IBeeMutationCustom registerMutation(GTPP_BeeDefinition parent1, GTPP_BeeDefinition parent2, int chance, float chancedivider) {
+ return registerMutation(parent1.species, parent2, chance, chancedivider);
+ }
+
+ protected final IBeeMutationCustom registerMutation(String parent1, String parent2, int chance, float chancedivider) {
+ return registerMutation(getGregtechBeeType(parent1), getGregtechBeeType(parent2), chance, chancedivider);
+ }
+
+ @Override
+ public final IAllele[] getTemplate() {
+ return Arrays.copyOf(template, template.length);
+ }
+
+ @Override
+ public final IBeeGenome getGenome() {
+ return genome;
+ }
+
+ @Override
+ public final IBee getIndividual() {
+ return new Bee(genome);
+ }
+
+ @Override
+ public final ItemStack getMemberStack(EnumBeeType beeType) {
+ return BeeManager.beeRoot.getMemberStack(getIndividual(), beeType.ordinal());
+ }
+
+ public final IBeeDefinition getRainResist() {
+ return new BeeVariation.RainResist(this);
+ }
+
+ private static final Class sGtBees = ReflectionUtils.getClass("gregtech.loaders.misc.GT_BeeDefinition");
+
+ public static IAlleleBeeSpecies getGregtechBeeType(String name) {
try {
Enum aBeeObject = ReflectionUtils.getEnum(sGtBees, name);
Field gtBeesField = ReflectionUtils.getField(sGtBees, "species");
- IAlleleBeeSpecies beeType = ReflectionUtils.getFieldValue(gtBeesField, aBeeObject);
+ IAlleleBeeSpecies beeType = ReflectionUtils.getFieldValue(gtBeesField, aBeeObject);
return beeType != null ? beeType : null;
}
catch (Throwable t) {
t.printStackTrace();
return null;
}
-
+
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java
index 68da927a1c..14b5a7e8ea 100644
--- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java
+++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java
@@ -6,7 +6,9 @@ import java.util.HashMap;
import cpw.mods.fml.common.Loader;
import gregtech.GT_Mod;
+import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.material.Material;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
import gtPlusPlus.xmod.forestry.bees.handler.*;
import gtPlusPlus.xmod.forestry.bees.items.output.*;
@@ -24,6 +26,8 @@ public class GTPP_Bees {
public static GTPP_Drop drop;
public static GTPP_Comb combs;
+
+ public static HashMap<String, Material> sMaterialMappings = new HashMap<String, Material>();
public static HashMap<Integer, GTPP_PropolisType> sPropolisMappings = new HashMap<Integer, GTPP_PropolisType>();
public static HashMap<Integer, GTPP_PollenType> sPollenMappings = new HashMap<Integer, GTPP_PollenType>();
public static HashMap<Integer, GTPP_DropType> sDropMappings = new HashMap<Integer, GTPP_DropType>();
@@ -35,13 +39,36 @@ public class GTPP_Bees {
if (!ReflectionUtils.doesClassExist("gregtech.loaders.misc.GT_BeeDefinition")) {
CORE.crash("Missing gregtech.loaders.misc.GT_BeeDefinition.");
}
+ else {
+ Logger.BEES("Loading GT++ Bees!");
+ }
+
+ Logger.BEES("Creating required items.");
propolis = new GTPP_Propolis();
pollen = new GTPP_Pollen();
drop = new GTPP_Drop();
- drop.initDropsRecipes();
combs = new GTPP_Comb();
- combs.initCombsRecipes();
+
+ Logger.BEES("Loading types.");
+ initTypes();
+
+ Logger.BEES("Adding recipes.");
+ GTPP_Drop.initDropsRecipes();
+ GTPP_Propolis.initPropolisRecipes();
+ GTPP_Comb.initCombsRecipes();
+
+ Logger.BEES("Initialising bees.");
GTPP_BeeDefinition.initBees();
+
+ Logger.BEES("Done!");
}
}
+
+ private static void initTypes() {
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.registry.GTPP_BeeDefinition");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_CombType");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_PollenType");
+ ReflectionUtils.loadClass("gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType");
+ }
}