From 0af6401544c94989f3913c9ea6638a304f7596ef Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 23 Jan 2022 14:59:04 +0000 Subject: Bee basework. --- .../java/gtPlusPlus/xmod/forestry/HANDLER_FR.java | 9 +- .../xmod/forestry/bees/handler/GTPP_CombType.java | 194 +++++++ .../xmod/forestry/bees/handler/GTPP_DropType.java | 51 ++ .../forestry/bees/handler/GTPP_PollenType.java | 34 ++ .../forestry/bees/handler/GTPP_PropolisType.java | 52 ++ .../xmod/forestry/bees/items/output/GTPP_Comb.java | 569 +++++++++++++++++++++ .../xmod/forestry/bees/items/output/GTPP_Drop.java | 136 +++++ .../forestry/bees/items/output/GTPP_Pollen.java | 90 ++++ .../forestry/bees/items/output/GTPP_Propolis.java | 111 ++++ .../forestry/bees/registry/GTPP_BeeDefinition.java | 392 ++++++++++++++ .../xmod/forestry/bees/registry/GTPP_Bees.java | 33 ++ .../bees/registry/GTPP_BranchDefinition.java | 87 ++++ 12 files changed, 1753 insertions(+), 5 deletions(-) create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java index 05d00b06d9..c395825b33 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java @@ -4,14 +4,13 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import cpw.mods.fml.common.Optional; - -import net.minecraft.block.Block; -import net.minecraft.world.World; - import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.forestry.bees.items.FR_ItemRegistry; import gtPlusPlus.xmod.forestry.bees.recipe.FR_Gregtech_Recipes; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; +import net.minecraft.block.Block; +import net.minecraft.world.World; public class HANDLER_FR { @@ -23,7 +22,7 @@ public class HANDLER_FR { public static void Init(){ if (LoadedMods.Forestry){ - //new GTPP_Bees(); TODO- Will Investigate this properly later. + 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 new file mode 100644 index 0000000000..bc9fb7bcdc --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_CombType.java @@ -0,0 +1,194 @@ +package gtPlusPlus.xmod.forestry.bees.handler; + +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_LanguageManager; + +public enum GTPP_CombType { + //Organic Line + LIGNIE("lignite", true, Materials.Lignite, 100,0x58300B, 0x906237), + COAL("coal", true, Materials.Coal, 100,0x525252, 0x666666), + STICKY("stickyresin", true, Materials._NULL, 50,0x2E8F5B, 0xDCC289), + OIL("oil", true, Materials._NULL, 100,0x333333, 0x4C4C4C), + APATITE("apatite", true, Materials.Apatite, 100,0xc1c1f6, 0x676784), + ASH("ash", true, Materials.Ash, 100,0x1e1a18, 0xc6c6c6), + + //IC2 Line + COOLANT("coolant", true, Materials._NULL, 100,0x144F5A, 0x2494A2), + ENERGY("energy", true, Materials._NULL, 80,0xC11F1F, 0xEBB9B9), + LAPOTRON("lapotron", true, Materials._NULL, 60,0x1414FF, 0x6478FF), + PYROTHEUM("pyrotheum", true, Materials.Pyrotheum, 50,0xffebc4, 0xe36400), + CRYOTHEUM("cryotheum", true, Materials.Pyrotheum, 50,0x2660ff, 0x5af7ff), + + //Alloy Line + REDALLOY("redalloy", true, Materials.RedAlloy, 100,0xE60000, 0xB80000), + REDSTONEALLOY("redstonealloy", true, Materials.RedstoneAlloy, 90,0xB80000, 0xA50808), + CONDUCTIVEIRON("conductiveiron", true, Materials.ConductiveIron, 80,0x817671, 0xCEADA3), + VIBRANTALLOY("vibrantalloy", true, Materials.VibrantAlloy, 50,0x86A12D, 0xC4F2AE), + ENERGETICALLOY("energeticalloy", true, Materials.EnergeticAlloy, 70,0xFF9933, 0xFFAD5C), + ELECTRICALSTEEL("electricalsteel", true, Materials.ElectricalSteel, 90,0x787878, 0xD8D8D8), + DARKSTEEL("darksteel", true, Materials.DarkSteel, 80,0x252525, 0x443B44), + PULSATINGIRON("pulsatingiron", true, Materials.PulsatingIron, 80,0x006600, 0x6DD284), + STAINLESSSTEEL("stainlesssteel", true, Materials.StainlessSteel, 75,0x778899, 0xC8C8DC), + ENDERIUM("enderium", true, Materials.Enderium, 40,0x2E8B57, 0x599087), + + //Thaumcraft Line + THAUMIUMDUST("thaumiumdust", true, Materials.Thaumium, 100,0x7A007A, 0x5C005C), + THAUMIUMSHARD("thaumiumshard", true, Materials._NULL, 85,0x9966FF, 0xAD85FF), + AMBER("amber", true, Materials.Amber, 90,0x774B15, 0xEE7700), + QUICKSILVER("quicksilver", true, Materials.Mercury, 90,0xc7c7ea, 0xb5b3df), + SALISMUNDUS("salismundus", true, Materials._NULL, 75,0xF7ADDE, 0x592582), + TAINTED("tainted", true, Materials._NULL, 80,0x904BB8, 0xE800FF), + MITHRIL("mithril", true, Materials.Mithril, 70,0xF0E68C, 0xFFFFD2), + ASTRALSILVER("astralsilver", true, Materials.AstralSilver, 70,0xAFEEEE, 0xE6E6FF), + THAUMINITE("thauminite", true, Materials._NULL, 50,0x2E2D79, 0x7581E0), + SHADOWMETAL("shadowmetal", true, Materials.Shadow, 50,0x100322, 0x100342), + DIVIDED("divided", true, Materials.Unstable, 40,0xF0F0F0, 0xDCDCDC), + SPARKELING("sparkling", true, Materials.NetherStar, 40,0x7A007A, 0xFFFFFF), + + //Gem Line + STONE("stone", true, Materials._NULL, 70,0x808080, 0x999999), + CERTUS("certus", true, Materials.CertusQuartz, 100,0x57CFFB, 0xBBEEFF), + FLUIX("fluix", true, Materials.Fluix, 100,0xA375FF, 0xB591FF), + REDSTONE("redstone", true, Materials.Redstone, 100,0x7D0F0F, 0xD11919), + RAREEARTH("rareearth", true, Materials.RareEarth, 100,0x555643, 0x343428), + LAPIS("lapis", true, Materials.Lapis, 100,0x1947D1, 0x476CDA), + RUBY("ruby", true, Materials.Ruby, 100,0xE6005C, 0xCC0052), + REDGARNET("redgarnet", true, Materials.GarnetRed,100,0xBD4C4C, 0xECCECE), + YELLOWGARNET("yellowgarnet", true, Materials.GarnetYellow,100,0xA3A341, 0xEDEDCE), + SAPPHIRE("sapphire", true, Materials.Sapphire, 100,0x0033CC, 0x00248F), + DIAMOND("diamond", true, Materials.Diamond, 100,0xCCFFFF, 0xA3CCCC), + OLIVINE("olivine", true, Materials.Olivine, 100,0x248F24, 0xCCFFCC), + EMERALD("emerald", true, Materials.Emerald, 100,0x248F24, 0x2EB82E), + PYROPE("pyrope", true, Materials.Pyrope, 100,0x763162, 0x8B8B8B), + GROSSULAR("grossular", true, Materials.Grossular, 100,0x9B4E00, 0x8B8B8B), + FIRESTONE("firestone", true, Materials.Firestone, 100,0xC00000, 0xFF0000), + + //Metals Line + SLAG("slag", true, Materials._NULL, 50,0xD4D4D4, 0x58300B), + COPPER("copper", true, Materials.Copper, 100,0xFF6600, 0xE65C00), + TIN("tin", true, Materials.Tin, 100,0xD4D4D4, 0xDDDDDD), + LEAD("lead", true, Materials.Lead, 100,0x666699, 0xA3A3CC), + IRON("iron", true, Materials.Iron, 100,0xDA9147, 0xDE9C59), + STEEL("steel", true, Materials.Steel, 95,0x808080, 0x999999), + NICKEL("nickel", true, Materials.Nickel, 100,0x8585AD, 0x9D9DBD), + ZINC("zinc", true, Materials.Zinc, 100,0xF0DEF0, 0xF2E1F2), + SILVER("silver", true, Materials.Silver, 100,0xC2C2D6, 0xCECEDE), + GOLD("gold", true, Materials.Gold, 100,0xE6B800, 0xCFA600), + SULFUR("sulfur", true, Materials.Sulfur, 100,0x6F6F01, 0x8B8B8B), + GALLIUM ("gallium", true, Materials.Gallium, 75,0x8B8B8B, 0xC5C5E4), + ARSENIC ("arsenic", true, Materials.Arsenic, 75,0x736C52, 0x292412), + + //Rare Metals Line + BAUXITE("bauxite", true, Materials.Bauxite, 85,0x6B3600, 0x8B8B8B), + ALUMINIUM("aluminium", true, Materials.Aluminium, 60,0x008AB8, 0xD6D6FF), + MANGANESE("manganese", true, Materials.Manganese, 30,0xD5D5D5, 0xAAAAAA), + MAGNESIUM("magnesium", true, Materials.Magnesium, 75,0xF1D9D9, 0x8B8B8B), + TITANIUM("titanium", true, Materials.Ilmenite, 100,0xCC99FF, 0xDBB8FF), + CHROME("chromium", true, Materials.Chrome, 50,0xEBA1EB, 0xF2C3F2), + TUNGSTEN("tungsten", true, Materials.Tungstate, 100,0x62626D, 0x161620), + PLATINUM("platinum", true, Materials.Platinum, 40,0xE6E6E6, 0xFFFFCC), + IRIDIUM("iridium", true, Materials.Iridium, 20,0xDADADA, 0xD1D1E0), + MOLYBDENUM("molybdenum", true, Materials.Molybdenum, 20,0xAEAED4, 0x8B8B8B), + OSMIUM("osmium", true, Materials.Osmium, 15,0x2B2BDA, 0x8B8B8B), + LITHIUM("lithium", true, Materials.Lithium, 75,0xF0328C, 0xE1DCFF), + SALT("salt", true, Materials.Salt, 90,0xF0C8C8, 0xFAFAFA), + ELECTROTINE("electrotine", true, Materials.Electrotine, 75,0x1E90FF, 0x3CB4C8), + ALMANDINE("almandine", true, Materials.Almandine, 85,0xC60000, 0x8B8B8B), + + //Radioactive Line + URANIUM("uranium", true, Materials.Uranium, 50,0x19AF19, 0x169E16), + PLUTONIUM("plutonium", true, Materials.Plutonium, 10,0x240000, 0x570000), + NAQUADAH("naquadah", true, Materials.Naquadah, 10,0x000000, 0x004400), + NAQUADRIA("naquadria", true, Materials.Naquadria, 5,0x000000, 0x002400), + DOB("d-o-b", true, Materials._NULL, 50,0x007700, 0x002400), + THORIUM("thorium", true, Materials.Thorium, 75,0x001E00, 0x005000), + LUTETIUM("lutetium", true, Materials.Lutetium, 10,0xE6FFE6, 0xFFFFFF), + AMERICIUM("americium", true, Materials.Americium, 5,0xE6E6FF, 0xC8C8C8), + NEUTRONIUM("neutronium", true, Materials.Neutronium, 2,0xFFF0F0, 0xFAFAFA), + + //Twilight + NAGA("naga", true, Materials._NULL, 100,0x0D5A0D, 0x28874B), + LICH("lich", true, Materials._NULL, 90,0x5C605E, 0xC5C5C5), + HYDRA("hydra", true, Materials._NULL, 80,0x872836, 0xB8132C), + URGHAST("urghast", true, Materials._NULL, 70,0x7C0618, 0xA7041C), + SNOWQUEEN("snowqueen", true, Materials._NULL, 60,0x9C0018, 0xD02001), + + //Space + SPACE("space", true, Materials._NULL, 100,0x003366, 0xC0C0C0), + METEORICIRON("meteoriciron",true, Materials.MeteoricIron, 100,0x321928, 0x643250), + DESH("desh",true, Materials.Desh, 90,0x282828, 0x323232), + LEDOX("ledox",true, Materials.Ledox, 75,0x0000CD, 0x0074FF), + CALLISTOICE("callistoice",true, Materials.CallistoIce, 75,0x0074FF, 0x1EB1FF), + MYTRYL("mytryl",true, Materials.Mytryl, 65,0xDAA520, 0xF26404), + QUANTIUM("quantium",true, Materials.Quantium, 50,0x00FF00, 0x00D10B), + ORIHARUKON("oriharukon",true, Materials.Oriharukon, 50,0x228B22, 0x677D68), + MYSTERIOUSCRYSTAL("mysteriouscrystal",true, Materials.MysteriousCrystal, 45,0x3CB371, 0x16856C), + BLACKPLUTONIUM("blackplutonium",true, Materials.Quantium, 25,0x000000, 0x323232), + TRINIUM("trinium",true, Materials.Trinium, 25,0xB0E0E6, 0xC8C8D2), + + //Planet + MERCURY("mercury", true, Materials._NULL, 65,0x4A4033, 0xB5A288), + VENUS("venus",true, Materials._NULL, 65,0x120E07, 0x272010), + MOON("moon",true, Materials._NULL, 90,0x373735, 0x7E7E78), + MARS("mars",true, Materials._NULL, 80,0x220D05, 0x3A1505), + JUPITER("jupiter",true, Materials._NULL, 75,0x734B2E, 0xD0CBC4), + SATURN("saturn",true, Materials._NULL, 55,0xD2A472, 0xF8C37B), + URANUS("uranus",true, Materials._NULL, 45,0x75C0C9, 0x84D8EC), + NEPTUN("neptun",true, Materials._NULL, 35,0x334CFF, 0x576DFF), + PLUTO("pluto",true, Materials._NULL, 25,0x34271E, 0x69503D), + HAUMEA("haumea",true, Materials._NULL, 20,0x1C1413, 0x392B28), + MAKEMAKE("makemake",true, Materials._NULL, 20,0x301811, 0x120A07), + CENTAURI("centauri",true, Materials._NULL, 15,0x2F2A14, 0xB06B32), + TCETI("tceti",true, Materials._NULL, 10,0x46241A, 0x7B412F), + BARNARDA("barnarda",true, Materials._NULL, 10,0x0D5A0D, 0xE6C18D), + VEGA("vega",true, Materials._NULL, 10,0x1A2036, 0xB5C0DE), + + //Infinity + COSMICNEUTRONIUM("cosmicneutronium",true, Materials._NULL, 5,0x484848, 0x323232), + INFINITYCATALYST("infinitycatalyst",true, Materials._NULL, 2,0xFFFFFF, 0xFFFFFF), + INFINITY("infinity",true, Materials._NULL, 1,0xFFFFFF, 0xFFFFFF), + + //HEE + ENDDUST("enddust", true, Materials._NULL, 50,0x003A7D, 0xCC00FA), + ECTOPLASMA("ectoplasma", true, Materials._NULL, 35,0x381C40, 0xDCB0E5), + ARCANESHARD("arcaneshard", true, Materials._NULL, 35,0x333D82, 0x9010AD), + STARDUST("stardust", true, Materials._NULL, 60,0xDCBE13, 0xffff00), + DRAGONESSENCE("dragonessence", true, Materials._NULL, 30,0x911ECE, 0xFFA12B), + ENDERMAN("enderman", true, Materials._NULL, 25,0x6200e7, 0x161616), + SILVERFISH("silverfish", true, Materials._NULL, 25,0x0000000, 0xEE053D), + ENDIUM("endium", true, Materials.HeeEndium, 50,0x2F5A6C, 0xa0ffff), + RUNEI("rune1", true, Materials._NULL, 10,0x0104D9, 0xE31010), + RUNEII("rune2", true, Materials._NULL, 10,0xE31010, 0x0104D9), + FIREESSENSE("fireessence", true, Materials._NULL, 30,0xFFA157, 0xD41238), + + //New Combs to avoid meta id issues + CRYOLITE("cryolite", true, Materials.Cryolite, 90, 0xBFEFFF, 0x73B9D0); + + public boolean showInList; + public Materials material; + public int chance; + + private String name; + private int[] color; + + GTPP_CombType(String pName, boolean show, Materials material, int chance, int... color) { + this.name = pName; + this.material = material; + this.chance = chance; + this.showInList = show; + this.color=color; + } + + public void setHidden() { + this.showInList = false; + } + + public String getName() { + + return GT_LanguageManager.addStringLocalization("comb." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Comb"); + } + + public int[] getColours() { + return color == null || color.length != 2 ? new int[]{0,0} : color; + } +} 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 new file mode 100644 index 0000000000..8578baa3c3 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_DropType.java @@ -0,0 +1,51 @@ +package gtPlusPlus.xmod.forestry.bees.handler; + +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_LanguageManager; + +public enum GTPP_DropType { + + OIL("oil",true), + MUTAGEN("small mutagen catalyst",true), + COOLANT("coolant",true), + HOT_COOLANT("hot coolant",true), + HYDRA("hydra blood",true), + SNOW_QUEEN("snowqueen blood",true), + OXYGEN("oxygen",true), + LAPIS("lapis coolant",true), + ENDERGOO("ender goo",true); + + private static int[][] colours = new int[][]{ + {0x19191B, 0x303032}, + {0xffc100, 0x00ff11}, + {0x144F5A, 0x2494A2}, + {0xC11F1F, 0xEBB9B9}, + {0x872836, 0xB8132C}, + {0xD02001, 0x9C0018}, + {0x003366, 0x0066BB}, + {0x1727b1, 0x008ce3}, + {0xA005E7, 0x161616}, + }; + public boolean showInList; + public Materials material; + public int chance; + private String name; + + private GTPP_DropType(String pName, boolean show) { + this.name = pName; + this.showInList = show; + } + + public void setHidden() { + this.showInList = false; + } + + public String getName() { + + return GT_LanguageManager.addStringLocalization("drop." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Drop"); + } + + public int[] getColours() { + return colours[this.ordinal()]; + } +} 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 new file mode 100644 index 0000000000..7010c45cd0 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PollenType.java @@ -0,0 +1,34 @@ +package gtPlusPlus.xmod.forestry.bees.handler; + +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_LanguageManager; + +public enum GTPP_PollenType { + + MATRIX("matrix",true); + + private static int[][] colours = new int[][]{ + {0x19191B, 0x303032}, + }; + public boolean showInList; + public Materials material; + public int chance; + private String name; + + private GTPP_PollenType(String pName, boolean show) { + this.name = pName; + this.showInList = show; + } + + public void setHidden() { + this.showInList = false; + } + + public String getName() { + return GT_LanguageManager.addStringLocalization("pollen." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Pollen"); + } + + public int[] getColours() { + return colours[this.ordinal()]; + } +} 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 new file mode 100644 index 0000000000..92ee16571d --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/handler/GTPP_PropolisType.java @@ -0,0 +1,52 @@ +package gtPlusPlus.xmod.forestry.bees.handler; + +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_LanguageManager; + +public enum GTPP_PropolisType { + + End("End",true), + Ectoplasma("Ectoplasma",true), + Arcaneshard("Arcaneshard",true), + Stardust("Stardust",true), + Dragonessence("Dragonessence",true), + Enderman("Enderman",true), + Silverfish("Silverfish", true), + Endium("Endium", true), + Fireessence("Fireessence",true); + + private static int[] colours = new int[]{ + 0xCC00FA, + 0xDCB0E5, + 0x9010AD, + 0xFFFF00, + 0x911ECE, + 0x161616, + 0xEE053D, + 0xa0ffff, + 0xD41238 + }; + + public boolean showInList; + public Materials material; + public int chance; + private String name; + + private GTPP_PropolisType(String pName, boolean show) { + this.name = pName; + this.showInList = show; + } + + public void setHidden() { + this.showInList = false; + } + + public String getName() { +// return "gt.comb."+this.name; + return GT_LanguageManager.addStringLocalization("propolis." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Propolis"); + } + + public int getColours() { + return colours[this.ordinal()]; + } +} 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 new file mode 100644 index 0000000000..01e7009cb8 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Comb.java @@ -0,0 +1,569 @@ +package gtPlusPlus.xmod.forestry.bees.items.output; + +import static gregtech.api.enums.GT_Values.*; + +import java.util.Arrays; +import java.util.List; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import forestry.api.recipes.RecipeManagers; +import gregtech.GT_Mod; +import gregtech.api.enums.*; +import gregtech.api.util.*; +import gregtech.loaders.materialprocessing.ProcessingModSupport; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.forestry.bees.handler.*; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +public class GTPP_Comb extends Item { + + @SideOnly(Side.CLIENT) + private IIcon secondIcon; + + public GTPP_Comb() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gtpp.comb"); + GameRegistry.registerItem(this, "gtpp.comb", CORE.MODID); + } + + public ItemStack getStackForType(GTPP_CombType type) { + return new ItemStack(this, 1, type.ordinal()); + } + + public ItemStack getStackForType(GTPP_CombType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (GTPP_CombType type : GTPP_CombType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + + @Override + public int getRenderPasses(int meta) { + return 2; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon("forestry:beeCombs.0"); + this.secondIcon = par1IconRegister.registerIcon("forestry:beeCombs.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? itemIcon : secondIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(GTPP_CombType.values().length - 1, stack.getItemDamage())); + int colour = GTPP_CombType.values()[meta].getColours()[0]; + + if (pass >= 1) { + colour = GTPP_CombType.values()[meta].getColours()[1]; + } + + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return GTPP_CombType.values()[stack.getItemDamage()].getName(); + } + public void initCombsRecipes() { + + //Organic + addProcessGT(GTPP_CombType.LIGNIE, new Materials[] {Materials.Lignite}, Voltage.LV); + addProcessGT(GTPP_CombType.COAL, new Materials[] {Materials.Coal}, Voltage.LV); + addCentrifugeToItemStack(GTPP_CombType.STICKY, new ItemStack[] { ItemList.IC2_Resin.get(1), ItemList.IC2_Plantball.get(1), ItemList.FR_Wax.get(1) }, new int[] {50 * 100, 15 * 100, 50 * 100}, Voltage.ULV); + addProcessGT(GTPP_CombType.OIL, new Materials[] {Materials.Oilsands}, Voltage.LV); + addProcessGT(GTPP_CombType.APATITE, new Materials[] {Materials.Apatite, Materials.Phosphate}, Voltage.LV); + addCentrifugeToMaterial(GTPP_CombType.ASH, new Materials[] {Materials.DarkAsh, Materials.Ash}, new int[] { 50*100, 50*100}, new int[] {}, Voltage.ULV, NI, 50 * 100); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToItemStack(GTPP_CombType.LIGNIE, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), ItemList.FR_Wax.get(1) }, new int[] {90 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToItemStack(GTPP_CombType.COAL, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), ItemList.FR_Wax.get(1) }, new int[] {5 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToItemStack(GTPP_CombType.OIL, new ItemStack[] { ItemList.Crop_Drop_OilBerry.get(1), GTPP_Bees.drop.getStackForType(GTPP_DropType.OIL), ItemList.FR_Wax.get(1) }, new int[] {70 * 100, 100 * 100, 50 * 100}, Voltage.ULV); + }else { + addCentrifugeToItemStack(GTPP_CombType.LIGNIE, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lignite, 1), ItemList.FR_Wax.get(1) }, new int[] {90 * 100, 100 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToItemStack(GTPP_CombType.COAL, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Coal, 1), ItemList.FR_Wax.get(1) }, new int[] {5 * 100, 100 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToItemStack(GTPP_CombType.OIL, new ItemStack[] { ItemList.Crop_Drop_OilBerry.get(1), GTPP_Bees.drop.getStackForType(GTPP_DropType.OIL), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Oilsands, 1), ItemList.FR_Wax.get(1) }, new int[] {70 * 100, 100 * 100, 100 * 100, 50 * 100}, Voltage.ULV); + addCentrifugeToMaterial(GTPP_CombType.APATITE, new Materials[] { Materials.Apatite, Materials.Phosphate }, new int[] {100 * 100, 80 * 100 }, new int[] {}, Voltage.ULV, NI, 30 * 100); + } + + //ic2 + addCentrifugeToItemStack(GTPP_CombType.COOLANT, new ItemStack[] { GTPP_Bees.drop.getStackForType(GTPP_DropType.COOLANT), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 100 * 100}, Voltage.HV, 196); + addCentrifugeToItemStack(GTPP_CombType.ENERGY, new ItemStack[] {GTPP_Bees.drop.getStackForType(GTPP_DropType.HOT_COOLANT), ItemList.IC2_Energium_Dust.get(1L), ItemList.FR_RefractoryWax.get(1)}, new int[] {20 * 100, 20 * 100, 50 * 100}, Voltage.HV, 196); + addCentrifugeToItemStack(GTPP_CombType.LAPOTRON, new ItemStack[] {GTPP_Bees.drop.getStackForType(GTPP_DropType.LAPIS), GT_ModHandler.getModItem(MOD_ID_DC, "item.LapotronDust", 1, 0), GT_ModHandler.getModItem("MagicBees", "wax", 1, 2) }, new int[] {20 * 100, 15 * 100, 40 * 100}, Voltage.HV, 196); + addCentrifugeToMaterial(GTPP_CombType.PYROTHEUM, new Materials[] {Materials.Blaze, Materials.Pyrotheum}, new int[] { 25 * 100, 20 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.CRYOTHEUM, new Materials[] {Materials.Blizz, Materials.Cryotheum}, new int[] { 25 * 100, 20 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + + //Alloy + addProcessGT(GTPP_CombType.REDALLOY, new Materials[] {Materials.RedAlloy, Materials.Redstone, Materials.Copper}, Voltage.LV); + addProcessGT(GTPP_CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy, Materials.Redstone, Materials.Silicon, Materials.Coal}, Voltage.LV); + addProcessGT(GTPP_CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron, Materials.Silver, Materials.Iron }, Voltage.MV); + addProcessGT(GTPP_CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy, Materials.Chrome }, Voltage.HV); + addProcessGT(GTPP_CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy, Materials.Gold }, Voltage.HV); + addProcessGT(GTPP_CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel, Materials.Silicon, Materials.Coal }, Voltage.LV); + addProcessGT(GTPP_CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel, Materials.Coal }, Voltage.MV); + addProcessGT(GTPP_CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron, Materials.Iron }, Voltage.HV); + addProcessGT(GTPP_CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel, Materials.Iron, Materials.Chrome, Materials.Manganese, Materials.Nickel }, Voltage.HV); + addCentrifugeToItemStack(GTPP_CombType.ENDERIUM, new ItemStack[] {ItemList.FR_RefractoryWax.get(1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.EnderiumBase, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Enderium, 1) }, new int[] {50 * 100, 30 * 100, 50 * 100 }, Voltage.HV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(GTPP_CombType.REDALLOY, new Materials[] {Materials.RedAlloy}, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy}, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron }, new int[] {90 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy }, new int[] {70 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy }, new int[] {80 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel }, new int[] {100 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel }, new int[] {100 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron }, new int[] {80 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel }, new int[] {50 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + }else { + addCentrifugeToMaterial(GTPP_CombType.REDALLOY, new Materials[] {Materials.RedAlloy, Materials.Redstone, Materials.Copper}, new int[] {100 * 100, 75 * 100, 90 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy, Materials.Redstone, Materials.Silicon, Materials.Coal}, new int[] {100 * 100, 90 * 100, 75 * 100, 75 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron, Materials.Silver, Materials.Iron }, new int[] {90 * 100, 55 * 100, 65 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy, Materials.Chrome }, new int[] {70 * 100, 50 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy, Materials.Gold }, new int[] {80 * 100, 60 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel, Materials.Silicon, Materials.Coal }, new int[] {100 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel, Materials.Coal }, new int[] {100 * 100, 75 * 100 }, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron, Materials.Iron }, new int[] {80 * 100, 75 * 100 }, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel, Materials.Iron, Materials.Chrome, Materials.Manganese, Materials.Nickel }, new int[] {50 * 100, 75 * 100, 55 * 100, 75 * 100, 75 * 100 }, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); + } + + //Thaumic + addProcessGT(GTPP_CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium, Materials.Iron }, Voltage.MV); + addCentrifugeToItemStack(GTPP_CombType.THAUMIUMSHARD, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "propolis", 1, 1), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 2), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 3), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 4), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 5), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 6), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) }, new int[] {20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 50 * 100 }, Voltage.ULV); + addProcessGT(GTPP_CombType.AMBER, new Materials[] {Materials.Amber}, Voltage.LV); + addProcessGT(GTPP_CombType.QUICKSILVER, new Materials[] {Materials.Cinnabar }, Voltage.LV); + addCentrifugeToItemStack(GTPP_CombType.SALISMUNDUS, new ItemStack[] {GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 14), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {100 * 100, 50 * 100}, Voltage.MV); + addCentrifugeToItemStack(GTPP_CombType.TAINTED, new ItemStack[] {GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 11), GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 12), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 1), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 2), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {15 * 100, 15 * 100, 15 * 100, 15 * 100, 15 * 100, 50 * 100}, Voltage.ULV); + addProcessGT(GTPP_CombType.MITHRIL, new Materials[] {Materials.Mithril, Materials.Platinum }, Voltage.HV); + addProcessGT(GTPP_CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver, Materials.Silver }, Voltage.HV); + addCentrifugeToMaterial(GTPP_CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver, Materials.Silver}, new int[] {20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:75) * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + addCentrifugeToItemStack(GTPP_CombType.THAUMINITE, new ItemStack[] {GT_ModHandler.getModItem("thaumicbases", "resource", 1, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Thaumium, 1), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {20 * 100, 10 * 100, 50 *100}, Voltage.HV); + addProcessGT(GTPP_CombType.SHADOWMETAL, new Materials[] {Materials.Shadow, Materials.ShadowSteel }, Voltage.HV); + addCentrifugeToMaterial(GTPP_CombType.SHADOWMETAL, new Materials[] {Materials.Shadow, Materials.ShadowSteel}, new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 20:75) * 100, 10 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) , 50 * 100); + addProcessGT(GTPP_CombType.DIVIDED, new Materials[] {Materials.Iron, Materials.Diamond }, Voltage.HV); + addCentrifugeToItemStack(GTPP_CombType.DIVIDED, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("ExtraUtilities", "unstableingot", 1, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iron, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Diamond, 1)}, new int[] {50 * 100, 20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:75) * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 5:55) * 100}, Voltage.HV); + addProcessGT(GTPP_CombType.SPARKELING, new Materials[] {Materials.NetherStar}, Voltage.EV); + addCentrifugeToItemStack(GTPP_CombType.SPARKELING, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("MagicBees", "miscResources", 2, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.NetherStar, 1)}, new int[] {50 * 100, 10 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:50) * 100}, Voltage.EV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(GTPP_CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium }, new int[] {100 * 100}, new int[] {}, Voltage.MV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + addCentrifugeToItemStack(GTPP_CombType.QUICKSILVER, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5) }, new int[] {50 * 100, 100 * 100 }, Voltage.ULV); + }else { + addCentrifugeToMaterial(GTPP_CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium, Materials.Iron }, new int[] {100 * 100, 75 * 100 }, new int[] {}, Voltage.MV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.AMBER, new Materials[] {Materials.Amber }, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + addCentrifugeToItemStack(GTPP_CombType.QUICKSILVER, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Cinnabar, 1) }, new int[] {50 * 100, 100 * 100, 85 * 100 }, Voltage.ULV); + addCentrifugeToMaterial(GTPP_CombType.MITHRIL, new Materials[] {Materials.Mithril, Materials.Platinum}, new int[] {75 * 100, 55 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); + } + + //Gem Line + addProcessGT(GTPP_CombType.STONE, new Materials[] {Materials.Soapstone, Materials.Talc, Materials.Apatite, Materials.Phosphate, Materials.TricalciumPhosphate}, Voltage.LV); + addProcessGT(GTPP_CombType.CERTUS, new Materials[] {Materials.CertusQuartz, Materials.Quartzite, Materials.Barite}, Voltage.LV); + addProcessGT(GTPP_CombType.FLUIX, new Materials[] {Materials.Redstone, Materials.CertusQuartz, Materials.NetherQuartz}, Voltage.LV); + addProcessGT(GTPP_CombType.REDSTONE, new Materials[] {Materials.Redstone, Materials.Cinnabar}, Voltage.LV); + addCentrifugeToMaterial(GTPP_CombType.RAREEARTH, new Materials[] {Materials.RareEarth}, new int[] {100 * 100}, new int[] { 1}, Voltage.ULV, NI, 30 * 100); + addProcessGT(GTPP_CombType.LAPIS, new Materials[] {Materials.Lapis, Materials.Sodalite, Materials.Lazurite, Materials.Calcite }, Voltage.LV); + addProcessGT(GTPP_CombType.RUBY, new Materials[] {Materials.Ruby, Materials.Redstone }, Voltage.LV); + addProcessGT(GTPP_CombType.REDGARNET, new Materials[] {Materials.GarnetRed, Materials.GarnetYellow }, Voltage.LV); + addProcessGT(GTPP_CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow, Materials.GarnetRed }, Voltage.LV); + addProcessGT(GTPP_CombType.SAPPHIRE, new Materials[] {Materials.Sapphire, Materials.GreenSapphire, Materials.Almandine, Materials.Pyrope}, Voltage.LV); + addProcessGT(GTPP_CombType.DIAMOND, new Materials[] {Materials.Diamond, Materials.Graphite}, Voltage.LV); + addProcessGT(GTPP_CombType.OLIVINE, new Materials[] {Materials.Olivine, Materials.Bentonite, Materials.Magnesite, Materials.Glauconite}, Voltage.LV); + addProcessGT(GTPP_CombType.EMERALD, new Materials[] {Materials.Emerald, Materials.Beryllium, Materials.Thorium}, Voltage.LV); + addProcessGT(GTPP_CombType.FIRESTONE, new Materials[] {Materials.Firestone}, Voltage.LV); + addProcessGT(GTPP_CombType.PYROPE, new Materials[] {Materials.Pyrope, Materials.Aluminium, Materials.Magnesium, Materials.Silicon}, Voltage.LV); + addProcessGT(GTPP_CombType.GROSSULAR, new Materials[] {Materials.Grossular, Materials.Aluminium, Materials.Silicon}, Voltage.LV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(GTPP_CombType.STONE, new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Basalt, Materials.Marble, Materials.Redrock}, new int[] {70 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100}, new int[] { 9, 9, 9, 9, 9, 9}, Voltage.ULV, NI, 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.FLUIX, new Materials[] {Materials.Fluix}, new int[] {25 * 100}, new int[] { 9}, Voltage.ULV, NI, 30 * 100); + }else { + addCentrifugeToMaterial(GTPP_CombType.STONE, new Materials[] {Materials.Soapstone, Materials.Talc, Materials.Apatite, Materials.Phosphate, Materials.TricalciumPhosphate}, new int[] {95 * 100, 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.CERTUS, new Materials[] {Materials.CertusQuartz, Materials.Quartzite, Materials.Barite}, new int[] {100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.FLUIX, new Materials[] {Materials.Fluix, Materials.Redstone, Materials.CertusQuartz, Materials.NetherQuartz}, new int[] {25 * 100, 90 * 100, 90 * 100, 90 * 100}, new int[] { 9, 1, 1, 1}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.REDSTONE, new Materials[] {Materials.Redstone, Materials.Cinnabar }, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.LAPIS, new Materials[] {Materials.Lapis, Materials.Sodalite, Materials.Lazurite, Materials.Calcite }, new int[] {100 * 100, 90 * 100, 90 * 100, 85 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.RUBY, new Materials[] {Materials.Ruby, Materials.Redstone }, new int[] {100 * 100, 90 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.REDGARNET, new Materials[] {Materials.GarnetRed, Materials.GarnetYellow }, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow, Materials.GarnetRed }, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.SAPPHIRE, new Materials[] {Materials.Sapphire, Materials.GreenSapphire, Materials.Almandine, Materials.Pyrope}, new int[] {100 * 100, 90 * 100, 90 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.DIAMOND, new Materials[] {Materials.Diamond, Materials.Graphite}, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.OLIVINE, new Materials[] {Materials.Olivine, Materials.Bentonite, Materials.Magnesite, Materials.Glauconite}, new int[] {100 * 100, 90 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.EMERALD, new Materials[] {Materials.Emerald, Materials.Beryllium, Materials.Thorium}, new int[] {100 * 100, 85 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.FIRESTONE, new Materials[] {Materials.Firestone}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.PYROPE, new Materials[] {Materials.Pyrope, Materials.Aluminium, Materials.Magnesium, Materials.Silicon}, new int[] {100 * 100, 75 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.GROSSULAR, new Materials[] {Materials.Grossular, Materials.Aluminium, Materials.Silicon}, new int[] {100 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + } + + // Metals Line + addProcessGT(GTPP_CombType.SLAG, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Lepidolite, Materials.Spodumene, Materials.Monazite}, Voltage.LV); + addProcessGT(GTPP_CombType.COPPER, new Materials[] {Materials.Copper, Materials.Tetrahedrite, Materials.Chalcopyrite, Materials.Malachite, Materials.Pyrite, Materials.Stibnite}, Voltage.LV); + addProcessGT(GTPP_CombType.TIN, new Materials[] {Materials.Tin, Materials.Cassiterite, Materials.CassiteriteSand}, Voltage.LV); + addProcessGT(GTPP_CombType.LEAD, new Materials[] {Materials.Lead, Materials.Galena}, Voltage.LV); + addProcessGT(GTPP_CombType.NICKEL, new Materials[] {Materials.Nickel, Materials.Garnierite, Materials.Pentlandite, Materials.Cobaltite, Materials.Wulfenite, Materials.Powellite}, Voltage.LV); + addProcessGT(GTPP_CombType.ZINC, new Materials[] {Materials.Zinc, Materials.Sulfur}, Voltage.LV); + addProcessGT(GTPP_CombType.SILVER, new Materials[] {Materials.Silver, Materials.Galena}, Voltage.LV); + addProcessGT(GTPP_CombType.CRYOLITE, new Materials[] {Materials.Cryolite, Materials.Silver}, Voltage.LV); + addProcessGT(GTPP_CombType.GOLD, new Materials[] {Materials.Gold, Materials.Magnetite}, Voltage.LV); + addChemicalProcess(GTPP_CombType.GOLD, Materials.Magnetite, Materials.Gold, Voltage.LV); + addProcessGT(GTPP_CombType.SULFUR, new Materials[] {Materials.Sulfur, Materials.Pyrite, Materials.Sphalerite}, Voltage.LV); + addProcessGT(GTPP_CombType.GALLIUM, new Materials[] {Materials.Gallium, Materials.Niobium}, Voltage.LV); + addProcessGT(GTPP_CombType.ARSENIC, new Materials[] {Materials.Arsenic, Materials.Bismuth, Materials.Antimony}, Voltage.LV); + if (ProcessingModSupport.aEnableGCMarsMats) { + addProcessGT(GTPP_CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.MeteoricIron}, Voltage.LV); + addProcessGT(GTPP_CombType.STEEL, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.YellowLimonite, Materials.BrownLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.MeteoricIron, Materials.Molybdenite, Materials.Molybdenum}, Voltage.LV); + }else { + addProcessGT(GTPP_CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite}, Voltage.LV); + addProcessGT(GTPP_CombType.STEEL, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.YellowLimonite, Materials.BrownLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.Molybdenite, Materials.Molybdenum}, Voltage.LV); + } + addChemicalProcess(GTPP_CombType.STEEL, Materials.BrownLimonite, Materials.YellowLimonite, Voltage.LV); + addChemicalProcess(GTPP_CombType.STEEL, Materials.YellowLimonite, Materials.BrownLimonite, Voltage.LV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(GTPP_CombType.SLAG, new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed}, new int[] {50 * 100, 20 * 100, 20 * 100}, new int[] { 9, 9, 9}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.COPPER, new Materials[] {Materials.Copper}, new int[] {70 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.TIN, new Materials[] {Materials.Tin}, new int[] {60 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.LEAD, new Materials[] {Materials.Lead}, new int[] {45 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.IRON, new Materials[] {Materials.Iron}, new int[] {30 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.STEEL, new Materials[] {Materials.Steel}, new int[] {40 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.SILVER, new Materials[] {Materials.Silver}, new int[] {80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.CRYOLITE, new Materials[] {Materials.Cryolite}, new int[] {80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + }else { + addCentrifugeToMaterial(GTPP_CombType.SLAG, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Lepidolite, Materials.Spodumene, Materials.Monazite}, new int[] {100 * 100, 100 * 100, 100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.COPPER, new Materials[] {Materials.Copper, Materials.Tetrahedrite, Materials.Chalcopyrite, Materials.Malachite, Materials.Pyrite, Materials.Stibnite}, new int[] {100 * 100, 85 * 100, 95 * 100, 80 * 100, 75 * 100, 65 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.TIN, new Materials[] {Materials.Tin, Materials.Cassiterite, Materials.CassiteriteSand}, new int[] {100 * 100, 85 * 100, 65 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.LEAD, new Materials[] {Materials.Lead, Materials.Galena}, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + if (ProcessingModSupport.aEnableGCMarsMats) { + addCentrifugeToMaterial(GTPP_CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.MeteoricIron}, new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.LEAD, new Materials[] {Materials.Steel, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.Molybdenite, Materials.Molybdenum, Materials.MeteoricIron }, new int[] {100 * 100, 90 * 100, 80 * 100, 65 * 100, 65 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + }else { + addCentrifugeToMaterial(GTPP_CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron}, new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 85 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.STEEL, new Materials[] {Materials.Steel, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Molybdenite, Materials.Molybdenum }, new int[] {100 * 100, 90 * 100, 80 * 100, 85 * 100, 65 * 100, 65 * 100 }, new int[] {}, Voltage.ULV, NI, 30 * 100); + } + addCentrifugeToMaterial(GTPP_CombType.NICKEL, new Materials[] {Materials.Nickel, Materials.Garnierite, Materials.Pentlandite, Materials.Cobaltite, Materials.Wulfenite, Materials.Powellite}, new int[] {100 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.ZINC, new Materials[] {Materials.Zinc, Materials.Sphalerite, Materials.Sulfur}, new int[] {100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.SILVER, new Materials[] {Materials.Silver, Materials.Galena}, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.CRYOLITE, new Materials[] {Materials.Cryolite, Materials.Silver}, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.GOLD, new Materials[] {Materials.Gold}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.SULFUR, new Materials[] {Materials.Sulfur, Materials.Pyrite, Materials.Sphalerite}, new int[] {100 * 100, 90 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.GALLIUM, new Materials[] {Materials.Gallium, Materials.Niobium}, new int[] { 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.ARSENIC, new Materials[] {Materials.Arsenic, Materials.Bismuth, Materials.Antimony}, new int[] {80 * 100, 70 * 100, 70 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); + } + + // Rare Metals Line + addProcessGT(GTPP_CombType.BAUXITE, new Materials[] {Materials.Bauxite, Materials.Aluminium}, Voltage.LV); + addProcessGT(GTPP_CombType.ALUMINIUM, new Materials[] {Materials.Aluminium, Materials.Bauxite}, Voltage.LV); + addProcessGT(GTPP_CombType.MANGANESE, new Materials[] {Materials.Manganese, Materials.Grossular, Materials.Spessartine, Materials.Pyrolusite, Materials.Tantalite}, Voltage.LV); + addProcessGT(GTPP_CombType.TITANIUM, new Materials[] {Materials.Titanium, Materials.Ilmenite, Materials.Bauxite, Materials.Rutile}, Voltage.EV); + addProcessGT(GTPP_CombType.MAGNESIUM, new Materials[] {Materials.Magnesium, Materials.Magnesite}, Voltage.LV); + addProcessGT(GTPP_CombType.CHROME, new Materials[] {Materials.Chrome, Materials.Ruby, Materials.Chromite, Materials.Redstone, Materials.Neodymium, Materials.Bastnasite}, Voltage.HV); + addProcessGT(GTPP_CombType.TUNGSTEN, new Materials[] {Materials.Tungsten, Materials.Tungstate, Materials.Scheelite, Materials.Lithium}, Voltage.IV); + addProcessGT(GTPP_CombType.PLATINUM, new Materials[] {Materials.Platinum, Materials.Cooperite, Materials.Palladium}, Voltage.HV); + addProcessGT(GTPP_CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum, Materials.Molybdenite, Materials.Powellite, Materials.Wulfenite}, Voltage.LV); + addChemicalProcess(GTPP_CombType.MOLYBDENUM, Materials.Osmium, Materials.Osmium, Voltage.IV); + addAutoclaveProcess(GTPP_CombType.MOLYBDENUM, Materials.Osmium, Voltage.IV, 5); + addProcessGT(GTPP_CombType.IRIDIUM, new Materials[] {Materials.Iridium, Materials.Osmium}, Voltage.IV); + addProcessGT(GTPP_CombType.OSMIUM, new Materials[] {Materials.Osmium, Materials.Iridium}, Voltage.IV); + addProcessGT(GTPP_CombType.LITHIUM, new Materials[] {Materials.Lithium, Materials.Aluminium}, Voltage.MV); + addProcessGT(GTPP_CombType.SALT, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Saltpeter}, Voltage.MV); + addProcessGT(GTPP_CombType.ELECTROTINE, new Materials[] {Materials.Electrotine, Materials.Electrum, Materials.Redstone}, Voltage.MV); + if(GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToItemStack(GTPP_CombType.SALT, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 1), GT_ModHandler.getModItem(MOD_ID_DC, "item.EdibleSalt", 1L, 0), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 50 * 100, 50 * 100}, Voltage.MV, 160); + }else { + addCentrifugeToMaterial(GTPP_CombType.BAUXITE, new Materials[] {Materials.Bauxite, Materials.Aluminium}, new int[] { 75 * 100, 55 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.ALUMINIUM, new Materials[] {Materials.Aluminium, Materials.Bauxite}, new int[] { 60 * 100, 80 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.MANGANESE, new Materials[] {Materials.Manganese, Materials.Grossular, Materials.Spessartine, Materials.Pyrolusite, Materials.Tantalite}, new int[] { 30 * 100, 100 * 100, 100 * 100, 100 * 100, 100 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.TITANIUM, new Materials[] {Materials.Titanium, Materials.Ilmenite, Materials.Bauxite, Materials.Rutile}, new int[] { 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.MAGNESIUM, new Materials[] {Materials.Magnesium, Materials.Magnesite}, new int[] { 100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.CHROME, new Materials[] {Materials.Chrome, Materials.Ruby, Materials.Chromite, Materials.Redstone, Materials.Neodymium, Materials.Bastnasite}, new int[] { 50 * 100, 100 * 100, 50 * 100, 100 * 100, 80 * 100, 80 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.TUNGSTEN, new Materials[] {Materials.Tungsten, Materials.Tungstate, Materials.Scheelite, Materials.Lithium}, new int[] { 50 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.PLATINUM, new Materials[] {Materials.Platinum, Materials.Cooperite, Materials.Palladium}, new int[] { 40 * 100, 40 * 100, 40 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum, Materials.Molybdenite, Materials.Powellite, Materials.Wulfenite}, new int[] { 100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.IRIDIUM, new Materials[] {Materials.Iridium, Materials.Osmium}, new int[] { 20 * 100, 15 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.OSMIUM, new Materials[] {Materials.Osmium, Materials.Iridium}, new int[] { 25 * 100, 15 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.LITHIUM, new Materials[] {Materials.Lithium, Materials.Aluminium}, new int[] { 85 * 100, 75 * 100}, new int[] {}, Voltage.MV, NI, 30 * 100); + addCentrifugeToItemStack(GTPP_CombType.SALT, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 1), GT_ModHandler.getModItem(MOD_ID_DC, "item.EdibleSalt", 1L, 0),GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.RockSalt, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Saltpeter, 1), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 50 * 100, 75 * 100, 65 * 100, 50 * 100}, Voltage.MV, 160); + addCentrifugeToMaterial(GTPP_CombType.ELECTROTINE, new Materials[] {Materials.Electrotine, Materials.Electrum, Materials.Redstone}, new int[] { 80, 75, 65}, new int[] {}, Voltage.MV, NI, 30 * 100); + } + + //Radioactive Line + addProcessGT(GTPP_CombType.ALMANDINE, new Materials[] {Materials.Almandine, Materials.Pyrope, Materials.Sapphire, Materials.GreenSapphire}, Voltage.LV); + addProcessGT(GTPP_CombType.URANIUM, new Materials[] {Materials.Uranium, Materials.Pitchblende, Materials.Uraninite, Materials.Uranium235}, Voltage.EV); + addProcessGT(GTPP_CombType.PLUTONIUM,new Materials[] {Materials.Plutonium, Materials.Uranium235}, Voltage.EV); + addChemicalProcess(GTPP_CombType.PLUTONIUM, Materials.Uranium235, Materials.Plutonium, Voltage.EV); + addProcessGT(GTPP_CombType.NAQUADAH,new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}, Voltage.IV); + addProcessGT(GTPP_CombType.NAQUADRIA,new Materials[] {Materials.Naquadria, Materials.NaquadahEnriched, Materials.Naquadah}, Voltage.LUV); + addProcessGT(GTPP_CombType.THORIUM,new Materials[] {Materials.Thorium, Materials.Uranium, Materials.Coal}, Voltage.EV); + addProcessGT(GTPP_CombType.LUTETIUM,new Materials[] {Materials.Lutetium, Materials.Thorium}, Voltage.IV); + addProcessGT(GTPP_CombType.AMERICIUM,new Materials[] {Materials.Americium, Materials.Lutetium}, Voltage.LUV); + addProcessGT(GTPP_CombType.NEUTRONIUM,new Materials[] {Materials.Neutronium, Materials.Americium}, Voltage.UV); + if(!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(GTPP_CombType.ALMANDINE, new Materials[] {Materials.Almandine, Materials.Pyrope, Materials.Sapphire, Materials.GreenSapphire}, new int[] { 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.URANIUM, new Materials[] {Materials.Uranium, Materials.Pitchblende, Materials.Uraninite, Materials.Uranium235}, new int[] { 50 * 100, 65 * 100, 75 * 100, 50 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.PLUTONIUM,new Materials[] {Materials.Plutonium, Materials.Uranium235}, new int[] {10, 5}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.NAQUADAH,new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}, new int[] {10 * 100, 5 * 100, 5 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.NAQUADRIA,new Materials[] {Materials.Naquadria, Materials.NaquadahEnriched, Materials.Naquadah}, new int[] {10 * 100, 10 * 100, 15 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.THORIUM,new Materials[] {Materials.Thorium, Materials.Uranium, Materials.Coal}, new int[] {75 * 100, 75 * 100 * 100, 95 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.LUTETIUM,new Materials[] {Materials.Lutetium, Materials.Thorium}, new int[] {35 * 100, 55 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.AMERICIUM,new Materials[] {Materials.Americium, Materials.Lutetium}, new int[] {25 * 100, 45 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.NEUTRONIUM,new Materials[] {Materials.Neutronium, Materials.Americium}, new int[] {15 * 100, 35 * 100}, new int[] {}, Voltage.UV, NI, 30 * 100); + } + + // Twilight + addCentrifugeToItemStack(GTPP_CombType.NAGA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 4), GT_ModHandler.getModItem(MOD_ID_DC, "item.NagaScaleChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.NagaScaleFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.MV); + addCentrifugeToItemStack(GTPP_CombType.LICH, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 5), GT_ModHandler.getModItem(MOD_ID_DC, "item.LichBoneChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.LichBoneFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.HV); + addCentrifugeToItemStack(GTPP_CombType.HYDRA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 1), GT_ModHandler.getModItem(MOD_ID_DC, "item.FieryBloodDrop", 1L, 0), GTPP_Bees.drop.getStackForType(GTPP_DropType.HYDRA), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.HV); + addCentrifugeToItemStack(GTPP_CombType.URGHAST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), GT_ModHandler.getModItem(MOD_ID_DC, "item.CarminiteChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CarminiteFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.EV); + addCentrifugeToItemStack(GTPP_CombType.SNOWQUEEN, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), GT_ModHandler.getModItem(MOD_ID_DC, "item.SnowQueenBloodDrop", 1L, 0), GTPP_Bees.drop.getStackForType(GTPP_DropType.SNOW_QUEEN), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.EV); + + // HEE + addCentrifugeToItemStack(GTPP_CombType.ENDDUST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.End), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO), }, new int[]{20 * 100, 15 * 100, 10 * 100}, Voltage.HV); + addCentrifugeToItemStack(GTPP_CombType.STARDUST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Stardust), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{20 * 100, 15 * 100, 10 * 100}, Voltage.HV); + addCentrifugeToItemStack(GTPP_CombType.ECTOPLASMA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Ectoplasma), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{25 * 100, 10 * 100, 15 * 100}, Voltage.EV); + addCentrifugeToItemStack(GTPP_CombType.ARCANESHARD, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Arcaneshard), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{25 * 100, 10 * 100, 15 * 100}, Voltage.EV); + addCentrifugeToItemStack(GTPP_CombType.DRAGONESSENCE, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Dragonessence), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{30 * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV); + addCentrifugeToItemStack(GTPP_CombType.ENDERMAN, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Enderman), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{3000, 750, 2000}, Voltage.IV); + addCentrifugeToItemStack(GTPP_CombType.SILVERFISH, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Silverfish), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO), new ItemStack(Items.spawn_egg, 1,60) }, new int[]{25 * 100, 10 * 100, 20 * 100, 15 * 100}, Voltage.EV); + addProcessGT(GTPP_CombType.ENDIUM,new Materials[] {Materials.HeeEndium}, Voltage.HV); + if(!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(GTPP_CombType.ENDIUM,new Materials[] {Materials.HeeEndium}, new int[] {50 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), 20 * 100); + } + addCentrifugeToItemStack(GTPP_CombType.RUNEI, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfPowerFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfAgilityFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfVigorFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfDefenseFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfMagicFragment", 1L, 0) }, new int[]{25 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100}, Voltage.IV); + addCentrifugeToItemStack(GTPP_CombType.RUNEII, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfVoidFragment", 1L, 0) }, new int[]{50 * 100, (int) (2.5 * 100)}, Voltage.IV); + addCentrifugeToItemStack(GTPP_CombType.FIREESSENSE, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Fireessence), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{30 * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV); + + //Space Line + addCentrifugeToItemStack(GTPP_CombType.SPACE, new ItemStack[] { ItemList.FR_Wax.get(1L), ItemList.FR_RefractoryWax.get(1L), GTPP_Bees.drop.getStackForType(GTPP_DropType.OXYGEN), GT_ModHandler.getModItem(MOD_ID_DC, "item.CoinSpace", 1L, 0)}, new int[]{50 * 100, 30 * 100, 15 * 100, 5 * 100}, Voltage.HV); + addProcessGT(GTPP_CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron, Materials.Iron}, Voltage.HV); + addProcessGT(GTPP_CombType.DESH, new Materials[] {Materials.Desh, Materials.Titanium}, Voltage.EV); + addProcessGT(GTPP_CombType.LEDOX, new Materials[] {Materials.Ledox, Materials.CallistoIce, Materials.Lead}, Voltage.EV); + addProcessGT(GTPP_CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce, Materials.Ledox, Materials.Lead}, Voltage.IV); + addProcessGT(GTPP_CombType.MYTRYL, new Materials[] {Materials.Mytryl, Materials.Mithril}, Voltage.IV); + addProcessGT(GTPP_CombType.QUANTIUM, new Materials[] {Materials.Quantium, Materials.Osmium}, Voltage.IV); + addProcessGT(GTPP_CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon, Materials.Lead}, Voltage.IV); + addProcessGT(GTPP_CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal, Materials.Emerald}, Voltage.LUV); + addCentrifugeToMaterial(GTPP_CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal, Materials.Emerald}, new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 10 : 40) * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 15 : 50) * 100}, new int[] {}, Voltage.LUV, 512, NI, 50 * 100); + addProcessGT(GTPP_CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium, Materials.Plutonium}, Voltage.LUV); + addProcessGT(GTPP_CombType.TRINIUM, new Materials[] {Materials.Trinium, Materials.Iridium}, Voltage.ZPM); + if(!GT_Mod.gregtechproxy.mNerfedCombs) { + addCentrifugeToMaterial(GTPP_CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron, Materials.Iron}, new int[] {85 * 100, 100 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.DESH, new Materials[] {Materials.Desh, Materials.Titanium}, new int[] {75 * 100, 50 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.LEDOX, new Materials[] {Materials.Ledox, Materials.CallistoIce, Materials.Lead}, new int[] {65 * 100, 55 * 100, 85 *100}, new int[] {}, Voltage.EV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce, Materials.Ledox, Materials.Lead}, new int[] {65 * 100, 75 * 100, 100 *100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.MYTRYL, new Materials[] {Materials.Mytryl, Materials.Mithril}, new int[] {55 * 100, 50 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.QUANTIUM, new Materials[] {Materials.Quantium, Materials.Osmium}, new int[] {50 * 100, 60 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon, Materials.Lead}, new int[] {50 * 100, 75 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium, Materials.Plutonium}, new int[] {25 * 100, 50 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); + addCentrifugeToMaterial(GTPP_CombType.TRINIUM, new Materials[] {Materials.Trinium, Materials.Iridium}, new int[] {35 * 100, 45 * 100}, new int[] {}, Voltage.ZPM, NI, 30 * 100); + } + + //Planet Line + addCentrifugeToItemStack(GTPP_CombType.MOON, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MoonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.MV, 300); + addCentrifugeToItemStack(GTPP_CombType.MARS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MarsStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.HV, 300); + addCentrifugeToItemStack(GTPP_CombType.JUPITER, new ItemStack[] { GT_ModHandler.getModItem(MOD_ID_DC, "item.IoStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.EuropaIceDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.EuropaStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.GanymedeStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CallistoStoneDust", 1L, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.CallistoIce, 1L), ItemList.FR_Wax.get(1L)}, new int[]{30 * 100, 30 * 100, 30 * 100, 30 * 100, 30 * 100, 5 * 100, 50 * 100 }, Voltage.HV, 300); + addCentrifugeToItemStack(GTPP_CombType.MERCURY, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MercuryCoreDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.MercuryStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.EV, 300); + addCentrifugeToItemStack(GTPP_CombType.VENUS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.VenusStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.EV, 300); + addCentrifugeToItemStack(GTPP_CombType.SATURN, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.EnceladusStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.TitanStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); + addCentrifugeToItemStack(GTPP_CombType.URANUS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MirandaStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.OberonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); + addCentrifugeToItemStack(GTPP_CombType.NEPTUN, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.ProteusStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.TritonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); + addCentrifugeToItemStack(GTPP_CombType.PLUTO, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.PlutoStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.PlutoIceDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.LUV, 300); + addCentrifugeToItemStack(GTPP_CombType.HAUMEA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.HaumeaStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.LUV, 300); + addCentrifugeToItemStack(GTPP_CombType.MAKEMAKE, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MakeMakeStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.LUV, 300); + addCentrifugeToItemStack(GTPP_CombType.CENTAURI, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.CentauriASurfaceDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CentauriAStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.ZPM, 300); + addCentrifugeToItemStack(GTPP_CombType.TCETI, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.TCetiEStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.ZPM, 300); + addCentrifugeToItemStack(GTPP_CombType.BARNARDA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.BarnardaEStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.BarnardaFStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.ZPM, 300); + addCentrifugeToItemStack(GTPP_CombType.VEGA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.VegaBStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.ZPM, 300); + + //Infinity Line + addCentrifugeToMaterial(GTPP_CombType.COSMICNEUTRONIUM, new Materials[] {Materials.CosmicNeutronium, Materials.Neutronium}, new int[] {(int) (0.5 * 100), 1 * 100}, new int[] {}, Voltage.UHV, 12000, NI, 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.INFINITYCATALYST, new Materials[] {Materials.InfinityCatalyst, Materials.Neutronium}, new int[] {(int) (0.05 * 100), 1 * 100}, new int[] {}, Voltage.UEV, 48000, NI, 50 * 100); + addCentrifugeToMaterial(GTPP_CombType.INFINITY, new Materials[] {Materials.Infinity, Materials.InfinityCatalyst}, new int[] {(int) (0.01 * 100), (int) (0.05 * 100)}, new int[] {}, Voltage.UIV, 96000, NI, 50 * 100); + } + + /** + * 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 Product = new ImmutableMap.Builder(); + 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()); + } + + aItem = Arrays.copyOf(aItem, 6); + if(aItem.length > 6) { + chance = Arrays.copyOf(chance, 6); + } + + 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; + } + } + } +} 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 new file mode 100644 index 0000000000..3cd65969d8 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Drop.java @@ -0,0 +1,136 @@ +package gtPlusPlus.xmod.forestry.bees.items.output; + +import static gregtech.api.enums.GT_Values.MOD_ID_DC; + +import java.util.List; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import forestry.api.recipes.RecipeManagers; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Materials; +import gregtech.api.util.GT_ModHandler; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType; +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; +import net.minecraftforge.fluids.FluidStack; + +public class GTPP_Drop extends Item { + + @SideOnly(Side.CLIENT) + private IIcon secondIcon; + + public GTPP_Drop() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gtpp.drop"); + GameRegistry.registerItem(this, "gtpp.drop", CORE.MODID); + } + + public ItemStack getStackForType(GTPP_DropType type) { + return new ItemStack(this, 1, type.ordinal()); + } + + public ItemStack getStackForType(GTPP_DropType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (GTPP_DropType type : GTPP_DropType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + + @Override + public int getRenderPasses(int meta) { + return 2; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon("forestry:honeyDrop.0"); + this.secondIcon = par1IconRegister.registerIcon("forestry:honeyDrop.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? itemIcon : secondIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(GTPP_DropType.values().length - 1, stack.getItemDamage())); + int colour = GTPP_DropType.values()[meta].getColours()[0]; + + if (pass >= 1) { + colour = GTPP_DropType.values()[meta].getColours()[1]; + } + + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return GTPP_DropType.values()[stack.getItemDamage()].getName(); + } + public void initDropsRecipes() { + ItemStack tDrop; + + tDrop = getStackForType(GTPP_DropType.OIL); + addProcessLV(tDrop, Materials.OilHeavy.getFluid(100L), GT_ModHandler.getModItem("Forestry", "propolis", 1L, 0), 3000, 8); + RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, Materials.OilHeavy.getFluid(100L), GT_ModHandler.getModItem("Forestry", "propolis", 1L, 0), 30); + tDrop = getStackForType(GTPP_DropType.COOLANT); + addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 0), 3000, 8); + RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 0), 30); + tDrop = getStackForType(GTPP_DropType.HOT_COOLANT); + addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("ic2hotcoolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 3000, 8); + RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2hotcoolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 30); + tDrop = getStackForType(GTPP_DropType.SNOW_QUEEN); + addProcessMV(tDrop, Materials.FierySteel.getFluid(200L), GT_ModHandler.getModItem(MOD_ID_DC, "SnowQueenBloodDrop", 1L, 0), 1500, 48); + tDrop = getStackForType(GTPP_DropType.LAPIS); + addProcessLV(tDrop,new FluidStack(FluidRegistry.getFluid("ic2coolant"), 200), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), 5000, 1200,2); + RecipeManagers.squeezerManager.addRecipe(400, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), 30); + tDrop = getStackForType(GTPP_DropType.HYDRA); + addProcessMV(tDrop, Materials.FierySteel.getFluid(50L), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 3000, 8); + tDrop = getStackForType(GTPP_DropType.OXYGEN); + addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("liquidoxygen"), 100), GT_ModHandler.getModItem("ExtraBees", "propolis", 1L, 2), 250, 1200,8); + RecipeManagers.squeezerManager.addRecipe(400, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("ExtraBees", "propolis", 1L, 2), 30); + tDrop = getStackForType(GTPP_DropType.ENDERGOO); + if ( Loader.isModLoaded("HardcoreEnderExpansion")) + addProcessHV(tDrop, new FluidStack(FluidRegistry.getFluid("endergoo"), 500), GT_Values.NI ,1000); + } + + 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); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java new file mode 100644 index 0000000000..f7766b2aff --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java @@ -0,0 +1,90 @@ +package gtPlusPlus.xmod.forestry.bees.items.output; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.forestry.bees.handler.GTPP_PollenType; +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; + +public class GTPP_Pollen extends Item { + + @SideOnly(Side.CLIENT) + private IIcon secondIcon; + + public GTPP_Pollen() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gtpp.pollen"); + GameRegistry.registerItem(this, "gtpp.pollen", CORE.MODID); + } + + public ItemStack getStackForType(GTPP_PollenType type) { + return new ItemStack(this, 1, type.ordinal()); + } + + public ItemStack getStackForType(GTPP_PollenType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (GTPP_PollenType type : GTPP_PollenType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + @Override + @SideOnly(Side.CLIENT) + public boolean requiresMultipleRenderPasses() { + return true; + } + + @Override + public int getRenderPasses(int meta) { + return 2; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon("forestry:pollen.0"); + this.secondIcon = par1IconRegister.registerIcon("forestry:pollen.1"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return (pass == 0) ? itemIcon : secondIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(GTPP_PollenType.values().length - 1, stack.getItemDamage())); + int colour = GTPP_PollenType.values()[meta].getColours()[0]; + + if (pass >= 1) { + colour = GTPP_PollenType.values()[meta].getColours()[1]; + } + + return colour; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return GTPP_PollenType.values()[stack.getItemDamage()].getName(); + } + + +} 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 new file mode 100644 index 0000000000..279c6b92fc --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Propolis.java @@ -0,0 +1,111 @@ +package gtPlusPlus.xmod.forestry.bees.items.output; + +import static gregtech.api.enums.GT_Values.MOD_ID_DC; + +import java.util.List; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import gregtech.api.enums.*; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType; +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 { + + @SideOnly(Side.CLIENT) + private IIcon secondIcon; + + public GTPP_Propolis() { + super(); + this.setCreativeTab(Tabs.tabApiculture); + this.setHasSubtypes(true); + this.setUnlocalizedName("gtpp.propolis"); + GameRegistry.registerItem(this, "gtpp.propolis", CORE.MODID); + } + + public ItemStack getStackForType(GTPP_PropolisType type) { + return new ItemStack(this, 1, type.ordinal()); + } + + public ItemStack getStackForType(GTPP_PropolisType type, int count) { + return new ItemStack(this, count, type.ordinal()); + } + + @Override + @SideOnly(Side.CLIENT) + public void getSubItems(Item item, CreativeTabs tabs, List list) { + for (GTPP_PropolisType type : GTPP_PropolisType.values()) { + if (type.showInList) { + list.add(this.getStackForType(type)); + } + } + } + + + @Override + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister par1IconRegister) { + this.itemIcon = par1IconRegister.registerIcon("forestry:propolis.0"); + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return itemIcon; + } + + @Override + @SideOnly(Side.CLIENT) + public int getColorFromItemStack(ItemStack stack, int pass) { + int meta = Math.max(0, Math.min(GTPP_PropolisType.values().length - 1, stack.getItemDamage())); + return GTPP_PropolisType.values()[meta].getColours(); + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return GTPP_PropolisType.values()[stack.getItemDamage()].getName(); + } + public void initPropolisRecipes() { + ItemStack tPropolis; + + tPropolis = getStackForType(GTPP_PropolisType.End); + addProcessHV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "end_powder", 1, 0)); + tPropolis = getStackForType(GTPP_PropolisType.Stardust); + addProcessHV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "stardust", 1, 0)); + tPropolis = getStackForType(GTPP_PropolisType.Ectoplasma); + addProcessEV(tPropolis, GT_ModHandler.getModItem(MOD_ID_DC, "item.EctoplasmaChip", 1, 0)); + tPropolis = getStackForType(GTPP_PropolisType.Arcaneshard); + addProcessEV(tPropolis, GT_ModHandler.getModItem(MOD_ID_DC, "item.ArcaneShardChip", 1, 0)); + tPropolis = getStackForType(GTPP_PropolisType.Dragonessence); + addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 0)); + tPropolis = getStackForType(GTPP_PropolisType.Enderman); + addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "enderman_head", 1, 0)); + tPropolis = getStackForType(GTPP_PropolisType.Silverfish); + addProcessEV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "silverfish_blood", 1, 0)); + tPropolis = getStackForType(GTPP_PropolisType.Endium); + addProcessHV(tPropolis, GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.HeeEndium, 1)); + tPropolis = getStackForType(GTPP_PropolisType.Fireessence); + addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 1)); + + //addRecipe(tDrop, aOutput, aOutput2, aChance, aDuration, aEUt); + } + + 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); + } +} 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 new file mode 100644 index 0000000000..ca11b00cff --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BeeDefinition.java @@ -0,0 +1,392 @@ +package gtPlusPlus.xmod.forestry.bees.registry; + +import static forestry.api.apiculture.EnumBeeChromosome.*; +import static forestry.api.core.EnumHumidity.ARID; +import static forestry.api.core.EnumHumidity.DAMP; +import static forestry.api.core.EnumTemperature.*; + +import java.awt.Color; +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.Locale; +import java.util.function.Consumer; + +import org.apache.commons.lang3.reflect.FieldUtils; +import org.apache.commons.lang3.text.WordUtils; + +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; +import forestry.api.apiculture.*; +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; +import forestry.api.genetics.*; +import forestry.apiculture.genetics.*; +import forestry.apiculture.genetics.alleles.AlleleEffect; +import forestry.core.genetics.alleles.AlleleHelper; +import forestry.core.genetics.alleles.EnumAllele.*; +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.util.GT_LanguageManager; +import gregtech.api.util.GT_ModHandler; +import gregtech.common.bees.GT_AlleleBeeSpecies; +import gregtech.common.bees.GT_Bee_Mutation; +import gregtech.common.items.CombType; +import gregtech.loaders.misc.GT_BeeDefinition; +import gregtech.loaders.misc.GT_BranchDefinition; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.item.ItemStack; + + + +public enum GTPP_BeeDefinition implements IBeeDefinition { + + DIVIDED(GT_BranchDefinition.THAUMIC, "Unstable", true, new Color(0xF0F0F0), new Color(0xDCDCDC), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 61), 0.20f); + beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(CombType.DIVIDED), 0.125f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOW); + AlleleHelper.instance.set(template, NOCTURNAL, true); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(DIAMOND, IRON, 3); + if (Loader.isModLoaded("ExtraUtilities")) + tMutation.requireResource(GameRegistry.findBlock("ExtraUtilities", "decorativeBlock1"), 5); + } + ), + NEUTRONIUM(GT_BranchDefinition.RADIOACTIVE, "Neutronium", false, new Color(0xFFF0F0), new Color(0xFAFAFA), + beeSpecies -> { + beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.NEUTRONIUM), 0.0001f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); + AlleleHelper.instance.set(template, NOCTURNAL, true); + }, + dis -> { + IMutationCustom tMutation = dis.registerMutation(NAQUADRIA, AMERICIUM, 1, 2).setIsSecret(); + tMutation.requireResource(GregTech_API.sBlockMetal5, 2); + } + ), + DRAGONESSENCE(GT_BranchDefinition.HEE, "Dragonessence", true, new Color(0xFFA12B), new Color(0x911ECE), + beeSpecies -> { + beeSpecies.addProduct(GT_ModHandler.getModItem(GT_Values.MOD_ID_FR, "beeCombs", 1, 8), 0.30f); + beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(CombType.DRAGONESSENCE), 0.10f); + beeSpecies.setHumidity(ARID); + beeSpecies.setTemperature(EnumTemperature.NORMAL); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectBeatific); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_3); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_3); + }, + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(GT_BeeDefinition.ECTOPLASMA, GT_BeeDefinition.ARCANESHARDS, 4); + tMutation.restrictHumidity(ARID); + if (Loader.isModLoaded("HardcoreEnderExpansion")) + tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "essence_altar"), 1); + tMutation.addMutationCondition(new GTPP_Bees.DimensionMutationCondition(1, "End"));//End Dim + } + ), + TRINIUM(GT_BranchDefinition.SPACE, "Trinium", false, new Color(0xB0E0E6), new Color(0xC8C8D2), + beeSpecies -> { + beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.TRINIUM), 0.75f); + beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(CombType.QUANTIUM), 0.10f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(COLD); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, SPEED, GTPP_Bees.speedBlinding), + new Consumer() { + @Override + public void accept(GTPP_BeeDefinition dis) { + IBeeMutationCustom tMutation = dis.registerMutation(ENCELADUS, IRIDIUM, 4); + tMutation.requireResource(GregTech_API.sBlockMetal4, 9); + tMutation.addMutationCondition(new GTPP_Bees.DimensionMutationCondition(41, "Enceladus"));//Enceladus Dim + } + } + ), + + //Infinity Line + COSMICNEUTRONIUM(GT_BranchDefinition.PLANET, "CosmicNeutronium", false, new Color(0x484848), new Color(0x323232), + beeSpecies -> { + beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.COSMICNEUTRONIUM), 0.25f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(NEUTRONIUM, BARNARDAF, 7, 10); + if (Loader.isModLoaded("Avaritia")) + tMutation.requireResource(GameRegistry.findBlock("Avaritia", "Resource_Block"), 0); + } + ), + INFINITYCATALYST(GT_BranchDefinition.PLANET, "InfinityCatalyst", false, new Color(0xFFFFFF), new Color(0xFFFFFF), + beeSpecies -> { + beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.INFINITYCATALYST), 0.0000005f); + beeSpecies.setHumidity(DAMP); + beeSpecies.setTemperature(HELLISH); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> { + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); + AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "blindness")); + }, + dis -> { + IMutationCustom tMutation = dis.registerMutation(DOB, COSMICNEUTRONIUM, 3, 10).setIsSecret(); + if (Loader.isModLoaded("Avaritia")) + tMutation.requireResource(GameRegistry.findBlock("Avaritia", "Resource_Block"), 1); + } + ), + INFINITY(GT_BranchDefinition.PLANET, "Infinity", false, new Color(0xFFFFFF), new Color(0xFFFFFF), + beeSpecies -> { + beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.INFINITY), 0.00000005f); + beeSpecies.setHumidity(EnumHumidity.NORMAL); + beeSpecies.setTemperature(ICY); + beeSpecies.setNocturnal(); + beeSpecies.setHasEffect(); + }, + template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), + dis -> { + IBeeMutationCustom tMutation = dis.registerMutation(INFINITYCATALYST, COSMICNEUTRONIUM, 1, 100); + if (Loader.isModLoaded("avaritiaddons")) + tMutation.requireResource(GameRegistry.findBlock("avaritiaddons", "InfinityChest"), 0); + } + ), + ; + private final GT_BranchDefinition branch; + private final GT_AlleleBeeSpecies species; + private final Consumer mSpeciesProperties; + private final Consumer mAlleles; + private final Consumer mMutations; + private IAllele[] template; + private IBeeGenome genome; + + GTPP_BeeDefinition(GT_BranchDefinition branch, + String binomial, + boolean dominant, + Color primary, + Color secondary, + Consumer aSpeciesProperties, + Consumer aAlleles, + Consumer aMutations + ) { + this.mAlleles = aAlleles; + this.mMutations = aMutations; + this.mSpeciesProperties = aSpeciesProperties; + String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH); + String species = WordUtils.capitalize(lowercaseName); + + 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 GT_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(GT_AlleleBeeSpecies beeSpecies) { + this.mSpeciesProperties.accept(beeSpecies); + } + + 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 GT_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); + } + + public static IAlleleBeeSpecies getGregtechBeeType(String name){ + Class gtBees; + try { + Class gtBeeTypes = Class.forName("gregtech.loaders.misc.GT_BeeDefinition"); + Enum gtBeeEnumObject = Enum.valueOf(gtBeeTypes, name); + Field gtBeesField = FieldUtils.getDeclaredField(gtBeeTypes, "species", true); + gtBeesField.setAccessible(true); + ReflectionUtils.makeFieldAccessible(gtBeesField); + Object beeType = gtBeesField.get(gtBeeEnumObject); + return (IAlleleBeeSpecies) beeType; + } + catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) { + e.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 new file mode 100644 index 0000000000..35dbb1ded6 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bees.java @@ -0,0 +1,33 @@ +package gtPlusPlus.xmod.forestry.bees.registry; + +import static gregtech.api.enums.GT_Values.MOD_ID_FR; + +import cpw.mods.fml.common.Loader; +import gregtech.GT_Mod; +import gtPlusPlus.xmod.forestry.bees.items.output.*; + +public class GTPP_Bees { + + public final static byte FORESTRY = 0; + public final static byte EXTRABEES = 1; + public final static byte GENDUSTRY = 2; + public final static byte MAGICBEES = 3; + public final static byte GREGTECH = 4; + + public static GTPP_Propolis propolis; + public static GTPP_Pollen pollen; + public static GTPP_Drop drop; + public static GTPP_Comb combs; + + public GTPP_Bees() { + if (Loader.isModLoaded(MOD_ID_FR) && GT_Mod.gregtechproxy.mGTBees) { + propolis = new GTPP_Propolis(); + pollen = new GTPP_Pollen(); + drop = new GTPP_Drop(); + drop.initDropsRecipes(); + combs = new GTPP_Comb(); + combs.initCombsRecipes(); + GTPP_BeeDefinition.initBees(); + } + } +} diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java new file mode 100644 index 0000000000..36ea72d1d1 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java @@ -0,0 +1,87 @@ +package gtPlusPlus.xmod.forestry.bees.registry; + +import forestry.api.apiculture.BeeManager; +import forestry.api.apiculture.EnumBeeChromosome; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IClassification; +import forestry.apiculture.genetics.alleles.AlleleEffect; +import forestry.core.genetics.alleles.AlleleHelper; + +import java.util.Arrays; +import java.util.function.Consumer; + +import static forestry.api.apiculture.EnumBeeChromosome.*; +import static forestry.core.genetics.alleles.EnumAllele.*; +import static gtPlusPlus.xmod.forestry.bees.registry.GTPP_BeeDefinition.getEffect; +import static gtPlusPlus.xmod.forestry.bees.registry.GTPP_BeeDefinition.getFlowers; +import static gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees.EXTRABEES; + +public enum GTPP_BranchDefinition { + + HEE("Finis Expansiones", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_2); + AlleleHelper.instance.set(alleles, HUMIDITY_TOLERANCE, Tolerance.BOTH_2); + AlleleHelper.instance.set(alleles, NOCTURNAL, true); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "book")); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.SHORT); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.SLOW); + AlleleHelper.instance.set(alleles, SPEED, Speed.FASTEST); + AlleleHelper.instance.set(alleles, TERRITORY, Territory.LARGER); + } + ), + SPACE("Cosmicis", alleles -> { + AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.DOWN_2); + AlleleHelper.instance.set(alleles, TOLERANT_FLYER, true); + AlleleHelper.instance.set(alleles, NOCTURNAL, true); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); + AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FASTEST); + AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.LONGEST); + AlleleHelper.instance.set(alleles, SPEED, Speed.FAST); + AlleleHelper.instance.set(alleles, TERRITORY, Territory.LARGEST); + } + ), + ; + + private static IAllele[] defaultTemplate; + private final IClassification branch; + private final Consumer mBranchProperties; + + GTPP_BranchDefinition(String scientific, Consumer aBranchProperties) { + this.branch = BeeManager.beeFactory.createBranch(this.name().toLowerCase(), scientific); + this.mBranchProperties = aBranchProperties; + } + + private static IAllele[] getDefaultTemplate() { + if (defaultTemplate == null) { + defaultTemplate = new IAllele[EnumBeeChromosome.values().length]; + + AlleleHelper.instance.set(defaultTemplate, SPEED, Speed.SLOWEST); + AlleleHelper.instance.set(defaultTemplate, LIFESPAN, Lifespan.SHORTER); + AlleleHelper.instance.set(defaultTemplate, FERTILITY, Fertility.NORMAL); + AlleleHelper.instance.set(defaultTemplate, TEMPERATURE_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(defaultTemplate, NOCTURNAL, false); + AlleleHelper.instance.set(defaultTemplate, HUMIDITY_TOLERANCE, Tolerance.NONE); + AlleleHelper.instance.set(defaultTemplate, TOLERANT_FLYER, false); + AlleleHelper.instance.set(defaultTemplate, CAVE_DWELLING, false); + AlleleHelper.instance.set(defaultTemplate, FLOWER_PROVIDER, Flowers.VANILLA); + AlleleHelper.instance.set(defaultTemplate, FLOWERING, Flowering.SLOWEST); + AlleleHelper.instance.set(defaultTemplate, TERRITORY, Territory.AVERAGE); + AlleleHelper.instance.set(defaultTemplate, EFFECT, AlleleEffect.effectNone); + } + return Arrays.copyOf(defaultTemplate, defaultTemplate.length); + } + + protected final void setBranchProperties(IAllele[] template) { + this.mBranchProperties.accept(template); + } + + public final IAllele[] getTemplate() { + IAllele[] template = getDefaultTemplate(); + setBranchProperties(template); + return template; + } + + public final IClassification getBranch() { + return branch; + } +} -- cgit From 43be31d2ac5c8d390579edd4faa5817e91fc4b1a Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 23 Jan 2022 17:41:06 +0000 Subject: Added framework for custom bees. Boosted drops of Dragon Metal from Chaos Dragons. Fixed https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/9556. --- .gitignore | 5 + dependencies.gradle | 9 +- .../handler/events/EnderDragonDeathHandler.java | 57 +-- .../core/util/reflect/ReflectionUtils.java | 12 + .../java/gtPlusPlus/xmod/forestry/HANDLER_FR.java | 2 +- .../xmod/forestry/bees/handler/GTPP_CombType.java | 230 ++------- .../xmod/forestry/bees/handler/GTPP_DropType.java | 62 ++- .../forestry/bees/handler/GTPP_PollenType.java | 67 ++- .../forestry/bees/handler/GTPP_PropolisType.java | 65 ++- .../xmod/forestry/bees/items/FR_CustomBee.java | 5 - .../xmod/forestry/bees/items/output/GTPP_Comb.java | 550 ++++++--------------- .../xmod/forestry/bees/items/output/GTPP_Drop.java | 49 +- .../forestry/bees/items/output/GTPP_Pollen.java | 13 +- .../forestry/bees/items/output/GTPP_Propolis.java | 36 +- .../bees/registry/GTPP_AlleleBeeSpecies.java | 40 ++ .../forestry/bees/registry/GTPP_BeeDefinition.java | 191 ++----- .../forestry/bees/registry/GTPP_Bee_Mutation.java | 80 +++ .../xmod/forestry/bees/registry/GTPP_Bees.java | 14 + .../bees/registry/GTPP_BranchDefinition.java | 37 +- .../GT_MetaTileEntity_SuperBus_Input.java | 82 --- 20 files changed, 572 insertions(+), 1034 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_CustomBee.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java create mode 100644 src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bee_Mutation.java (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/.gitignore b/.gitignore index 40fb5e4a7d..467d0f686a 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,8 @@ whitelist.json *.iws src/main/resources/mixins.*.json *.bat +*.bak +/screenshots +/world +/saves +/asm diff --git a/dependencies.gradle b/dependencies.gradle index a85633709a..60c3818e72 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -3,12 +3,9 @@ dependencies { compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.18:dev") compile("com.github.GTNewHorizons:StructureLib:1.0.14:dev") - compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.1.22-GTNH:dev") { - transitive = false - } - compileOnly("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") { - transitive = false - } + compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.1.22-GTNH:dev") + compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") + compileOnly("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") compile("curse.maven:cofh-core-69162:2388751") diff --git a/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java b/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java index 884f14386d..967a51fad6 100644 --- a/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/events/EnderDragonDeathHandler.java @@ -13,47 +13,48 @@ public class EnderDragonDeathHandler { private static final String mDragonClassName = "chylex.hee.entity.boss.EntityBossDragon"; private static final boolean mHEE; private static final Class mHardcoreDragonClass; - + + private static final String mChaosDragonClassName = "com.brandon3055.draconicevolution.common.entity.EntityCustomDragon"; + private static final boolean mDE; + private static final Class mChaoseDragonClass; + static { mHEE = ReflectionUtils.doesClassExist(mDragonClassName); mHardcoreDragonClass = (mHEE ? ReflectionUtils.getClass(mDragonClassName) : null); + mDE = ReflectionUtils.doesClassExist(mChaosDragonClassName); + mChaoseDragonClass = (mDE ? ReflectionUtils.getClass(mChaosDragonClassName) : null); } @SubscribeEvent public void onEntityDrop(LivingDropsEvent event) { - - boolean aDidDrop = false; + int aCountTotal = 0; - - //HEE Dragon - if (mHEE) { - if (mHardcoreDragonClass != null) { - if (mHardcoreDragonClass.isInstance(event.entityLiving)) { - for (int y = 0; y < MathUtils.randInt(100, 250); y++) { - int aAmount = MathUtils.randInt(5, 25); - event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1)); - aDidDrop = true; - aCountTotal =+ aAmount; - } - } + + if (mHEE && mHardcoreDragonClass != null && mHardcoreDragonClass.isInstance(event.entityLiving)) { + for (int y = 0; y < MathUtils.randInt(100, 250); y++) { + int aAmount = MathUtils.randInt(5, 25); + event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1)); + aCountTotal = +aAmount; } } - //Vanilla Dragon or any other dragon that extends it - else { - if (event.entityLiving instanceof EntityDragon) { - for (int y = 0; y < MathUtils.randInt(25, 50); y++) { - int aAmount = MathUtils.randInt(1, 10); - event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1)); - aDidDrop = true; - aCountTotal =+ aAmount; - } + else if (mDE && mChaoseDragonClass != null && mChaoseDragonClass.isInstance(event.entityLiving)) { + for (int y = 0; y < MathUtils.randInt(100, 200); y++) { + int aAmount = MathUtils.randInt(1, 5); + event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getIngot(aAmount), MathUtils.randFloat(0, 1)); + aCountTotal = +aAmount; } } - - if (aDidDrop) { - PlayerUtils.messageAllPlayers(aCountTotal+" Shards of Dragons Blood have crystalized into a metallic form."); + else if (event.entityLiving instanceof EntityDragon) { + for (int y = 0; y < MathUtils.randInt(25, 50); y++) { + int aAmount = MathUtils.randInt(1, 10); + event.entityLiving.entityDropItem(ELEMENT.STANDALONE.DRAGON_METAL.getNugget(aAmount), MathUtils.randFloat(0, 1)); + aCountTotal = +aAmount; + } + } + if (aCountTotal > 0) { + PlayerUtils.messageAllPlayers(aCountTotal + " Shards of Dragons Blood have crystalized into a metallic form."); } - + } } diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 92804d72ec..6ccd19019a 100644 --- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -1086,5 +1086,17 @@ public class ReflectionUtils { return null; } + public static Enum getEnum(Class sgtbees, String name) { + if (sgtbees.isEnum()) { + Object[] aValues = sgtbees.getEnumConstants(); + for (Object o : aValues) { + if (o.toString().toLowerCase().equals(name.toLowerCase())) { + return (Enum) o; + } + } + } + return null; + } + } diff --git a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java index c395825b33..7f372837a5 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/HANDLER_FR.java @@ -22,13 +22,13 @@ public class HANDLER_FR { public static void Init(){ if (LoadedMods.Forestry){ - new GTPP_Bees(); } } public static void postInit(){ if (LoadedMods.Forestry){ FR_Gregtech_Recipes.registerItems(); + 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 bc9fb7bcdc..b3f12bc9d5 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 @@ -2,193 +2,51 @@ package gtPlusPlus.xmod.forestry.bees.handler; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; public enum GTPP_CombType { - //Organic Line - LIGNIE("lignite", true, Materials.Lignite, 100,0x58300B, 0x906237), - COAL("coal", true, Materials.Coal, 100,0x525252, 0x666666), - STICKY("stickyresin", true, Materials._NULL, 50,0x2E8F5B, 0xDCC289), - OIL("oil", true, Materials._NULL, 100,0x333333, 0x4C4C4C), - APATITE("apatite", true, Materials.Apatite, 100,0xc1c1f6, 0x676784), - ASH("ash", true, Materials.Ash, 100,0x1e1a18, 0xc6c6c6), - //IC2 Line - COOLANT("coolant", true, Materials._NULL, 100,0x144F5A, 0x2494A2), - ENERGY("energy", true, Materials._NULL, 80,0xC11F1F, 0xEBB9B9), - LAPOTRON("lapotron", true, Materials._NULL, 60,0x1414FF, 0x6478FF), - PYROTHEUM("pyrotheum", true, Materials.Pyrotheum, 50,0xffebc4, 0xe36400), - CRYOTHEUM("cryotheum", true, Materials.Pyrotheum, 50,0x2660ff, 0x5af7ff), - - //Alloy Line - REDALLOY("redalloy", true, Materials.RedAlloy, 100,0xE60000, 0xB80000), - REDSTONEALLOY("redstonealloy", true, Materials.RedstoneAlloy, 90,0xB80000, 0xA50808), - CONDUCTIVEIRON("conductiveiron", true, Materials.ConductiveIron, 80,0x817671, 0xCEADA3), - VIBRANTALLOY("vibrantalloy", true, Materials.VibrantAlloy, 50,0x86A12D, 0xC4F2AE), - ENERGETICALLOY("energeticalloy", true, Materials.EnergeticAlloy, 70,0xFF9933, 0xFFAD5C), - ELECTRICALSTEEL("electricalsteel", true, Materials.ElectricalSteel, 90,0x787878, 0xD8D8D8), - DARKSTEEL("darksteel", true, Materials.DarkSteel, 80,0x252525, 0x443B44), - PULSATINGIRON("pulsatingiron", true, Materials.PulsatingIron, 80,0x006600, 0x6DD284), - STAINLESSSTEEL("stainlesssteel", true, Materials.StainlessSteel, 75,0x778899, 0xC8C8DC), - ENDERIUM("enderium", true, Materials.Enderium, 40,0x2E8B57, 0x599087), - - //Thaumcraft Line - THAUMIUMDUST("thaumiumdust", true, Materials.Thaumium, 100,0x7A007A, 0x5C005C), - THAUMIUMSHARD("thaumiumshard", true, Materials._NULL, 85,0x9966FF, 0xAD85FF), - AMBER("amber", true, Materials.Amber, 90,0x774B15, 0xEE7700), - QUICKSILVER("quicksilver", true, Materials.Mercury, 90,0xc7c7ea, 0xb5b3df), - SALISMUNDUS("salismundus", true, Materials._NULL, 75,0xF7ADDE, 0x592582), - TAINTED("tainted", true, Materials._NULL, 80,0x904BB8, 0xE800FF), - MITHRIL("mithril", true, Materials.Mithril, 70,0xF0E68C, 0xFFFFD2), - ASTRALSILVER("astralsilver", true, Materials.AstralSilver, 70,0xAFEEEE, 0xE6E6FF), - THAUMINITE("thauminite", true, Materials._NULL, 50,0x2E2D79, 0x7581E0), - SHADOWMETAL("shadowmetal", true, Materials.Shadow, 50,0x100322, 0x100342), - DIVIDED("divided", true, Materials.Unstable, 40,0xF0F0F0, 0xDCDCDC), - SPARKELING("sparkling", true, Materials.NetherStar, 40,0x7A007A, 0xFFFFFF), - - //Gem Line - STONE("stone", true, Materials._NULL, 70,0x808080, 0x999999), - CERTUS("certus", true, Materials.CertusQuartz, 100,0x57CFFB, 0xBBEEFF), - FLUIX("fluix", true, Materials.Fluix, 100,0xA375FF, 0xB591FF), - REDSTONE("redstone", true, Materials.Redstone, 100,0x7D0F0F, 0xD11919), - RAREEARTH("rareearth", true, Materials.RareEarth, 100,0x555643, 0x343428), - LAPIS("lapis", true, Materials.Lapis, 100,0x1947D1, 0x476CDA), - RUBY("ruby", true, Materials.Ruby, 100,0xE6005C, 0xCC0052), - REDGARNET("redgarnet", true, Materials.GarnetRed,100,0xBD4C4C, 0xECCECE), - YELLOWGARNET("yellowgarnet", true, Materials.GarnetYellow,100,0xA3A341, 0xEDEDCE), - SAPPHIRE("sapphire", true, Materials.Sapphire, 100,0x0033CC, 0x00248F), - DIAMOND("diamond", true, Materials.Diamond, 100,0xCCFFFF, 0xA3CCCC), - OLIVINE("olivine", true, Materials.Olivine, 100,0x248F24, 0xCCFFCC), - EMERALD("emerald", true, Materials.Emerald, 100,0x248F24, 0x2EB82E), - PYROPE("pyrope", true, Materials.Pyrope, 100,0x763162, 0x8B8B8B), - GROSSULAR("grossular", true, Materials.Grossular, 100,0x9B4E00, 0x8B8B8B), - FIRESTONE("firestone", true, Materials.Firestone, 100,0xC00000, 0xFF0000), - - //Metals Line - SLAG("slag", true, Materials._NULL, 50,0xD4D4D4, 0x58300B), - COPPER("copper", true, Materials.Copper, 100,0xFF6600, 0xE65C00), - TIN("tin", true, Materials.Tin, 100,0xD4D4D4, 0xDDDDDD), - LEAD("lead", true, Materials.Lead, 100,0x666699, 0xA3A3CC), - IRON("iron", true, Materials.Iron, 100,0xDA9147, 0xDE9C59), - STEEL("steel", true, Materials.Steel, 95,0x808080, 0x999999), - NICKEL("nickel", true, Materials.Nickel, 100,0x8585AD, 0x9D9DBD), - ZINC("zinc", true, Materials.Zinc, 100,0xF0DEF0, 0xF2E1F2), - SILVER("silver", true, Materials.Silver, 100,0xC2C2D6, 0xCECEDE), - GOLD("gold", true, Materials.Gold, 100,0xE6B800, 0xCFA600), - SULFUR("sulfur", true, Materials.Sulfur, 100,0x6F6F01, 0x8B8B8B), - GALLIUM ("gallium", true, Materials.Gallium, 75,0x8B8B8B, 0xC5C5E4), - ARSENIC ("arsenic", true, Materials.Arsenic, 75,0x736C52, 0x292412), - - //Rare Metals Line - BAUXITE("bauxite", true, Materials.Bauxite, 85,0x6B3600, 0x8B8B8B), - ALUMINIUM("aluminium", true, Materials.Aluminium, 60,0x008AB8, 0xD6D6FF), - MANGANESE("manganese", true, Materials.Manganese, 30,0xD5D5D5, 0xAAAAAA), - MAGNESIUM("magnesium", true, Materials.Magnesium, 75,0xF1D9D9, 0x8B8B8B), - TITANIUM("titanium", true, Materials.Ilmenite, 100,0xCC99FF, 0xDBB8FF), - CHROME("chromium", true, Materials.Chrome, 50,0xEBA1EB, 0xF2C3F2), - TUNGSTEN("tungsten", true, Materials.Tungstate, 100,0x62626D, 0x161620), - PLATINUM("platinum", true, Materials.Platinum, 40,0xE6E6E6, 0xFFFFCC), - IRIDIUM("iridium", true, Materials.Iridium, 20,0xDADADA, 0xD1D1E0), - MOLYBDENUM("molybdenum", true, Materials.Molybdenum, 20,0xAEAED4, 0x8B8B8B), - OSMIUM("osmium", true, Materials.Osmium, 15,0x2B2BDA, 0x8B8B8B), - LITHIUM("lithium", true, Materials.Lithium, 75,0xF0328C, 0xE1DCFF), - SALT("salt", true, Materials.Salt, 90,0xF0C8C8, 0xFAFAFA), - ELECTROTINE("electrotine", true, Materials.Electrotine, 75,0x1E90FF, 0x3CB4C8), - ALMANDINE("almandine", true, Materials.Almandine, 85,0xC60000, 0x8B8B8B), - - //Radioactive Line - URANIUM("uranium", true, Materials.Uranium, 50,0x19AF19, 0x169E16), - PLUTONIUM("plutonium", true, Materials.Plutonium, 10,0x240000, 0x570000), - NAQUADAH("naquadah", true, Materials.Naquadah, 10,0x000000, 0x004400), - NAQUADRIA("naquadria", true, Materials.Naquadria, 5,0x000000, 0x002400), - DOB("d-o-b", true, Materials._NULL, 50,0x007700, 0x002400), - THORIUM("thorium", true, Materials.Thorium, 75,0x001E00, 0x005000), - LUTETIUM("lutetium", true, Materials.Lutetium, 10,0xE6FFE6, 0xFFFFFF), - AMERICIUM("americium", true, Materials.Americium, 5,0xE6E6FF, 0xC8C8C8), - NEUTRONIUM("neutronium", true, Materials.Neutronium, 2,0xFFF0F0, 0xFAFAFA), - - //Twilight - NAGA("naga", true, Materials._NULL, 100,0x0D5A0D, 0x28874B), - LICH("lich", true, Materials._NULL, 90,0x5C605E, 0xC5C5C5), - HYDRA("hydra", true, Materials._NULL, 80,0x872836, 0xB8132C), - URGHAST("urghast", true, Materials._NULL, 70,0x7C0618, 0xA7041C), - SNOWQUEEN("snowqueen", true, Materials._NULL, 60,0x9C0018, 0xD02001), - - //Space - SPACE("space", true, Materials._NULL, 100,0x003366, 0xC0C0C0), - METEORICIRON("meteoriciron",true, Materials.MeteoricIron, 100,0x321928, 0x643250), - DESH("desh",true, Materials.Desh, 90,0x282828, 0x323232), - LEDOX("ledox",true, Materials.Ledox, 75,0x0000CD, 0x0074FF), - CALLISTOICE("callistoice",true, Materials.CallistoIce, 75,0x0074FF, 0x1EB1FF), - MYTRYL("mytryl",true, Materials.Mytryl, 65,0xDAA520, 0xF26404), - QUANTIUM("quantium",true, Materials.Quantium, 50,0x00FF00, 0x00D10B), - ORIHARUKON("oriharukon",true, Materials.Oriharukon, 50,0x228B22, 0x677D68), - MYSTERIOUSCRYSTAL("mysteriouscrystal",true, Materials.MysteriousCrystal, 45,0x3CB371, 0x16856C), - BLACKPLUTONIUM("blackplutonium",true, Materials.Quantium, 25,0x000000, 0x323232), - TRINIUM("trinium",true, Materials.Trinium, 25,0xB0E0E6, 0xC8C8D2), - - //Planet - MERCURY("mercury", true, Materials._NULL, 65,0x4A4033, 0xB5A288), - VENUS("venus",true, Materials._NULL, 65,0x120E07, 0x272010), - MOON("moon",true, Materials._NULL, 90,0x373735, 0x7E7E78), - MARS("mars",true, Materials._NULL, 80,0x220D05, 0x3A1505), - JUPITER("jupiter",true, Materials._NULL, 75,0x734B2E, 0xD0CBC4), - SATURN("saturn",true, Materials._NULL, 55,0xD2A472, 0xF8C37B), - URANUS("uranus",true, Materials._NULL, 45,0x75C0C9, 0x84D8EC), - NEPTUN("neptun",true, Materials._NULL, 35,0x334CFF, 0x576DFF), - PLUTO("pluto",true, Materials._NULL, 25,0x34271E, 0x69503D), - HAUMEA("haumea",true, Materials._NULL, 20,0x1C1413, 0x392B28), - MAKEMAKE("makemake",true, Materials._NULL, 20,0x301811, 0x120A07), - CENTAURI("centauri",true, Materials._NULL, 15,0x2F2A14, 0xB06B32), - TCETI("tceti",true, Materials._NULL, 10,0x46241A, 0x7B412F), - BARNARDA("barnarda",true, Materials._NULL, 10,0x0D5A0D, 0xE6C18D), - VEGA("vega",true, Materials._NULL, 10,0x1A2036, 0xB5C0DE), - - //Infinity - COSMICNEUTRONIUM("cosmicneutronium",true, Materials._NULL, 5,0x484848, 0x323232), - INFINITYCATALYST("infinitycatalyst",true, Materials._NULL, 2,0xFFFFFF, 0xFFFFFF), - INFINITY("infinity",true, Materials._NULL, 1,0xFFFFFF, 0xFFFFFF), - - //HEE - ENDDUST("enddust", true, Materials._NULL, 50,0x003A7D, 0xCC00FA), - ECTOPLASMA("ectoplasma", true, Materials._NULL, 35,0x381C40, 0xDCB0E5), - ARCANESHARD("arcaneshard", true, Materials._NULL, 35,0x333D82, 0x9010AD), - STARDUST("stardust", true, Materials._NULL, 60,0xDCBE13, 0xffff00), - DRAGONESSENCE("dragonessence", true, Materials._NULL, 30,0x911ECE, 0xFFA12B), - ENDERMAN("enderman", true, Materials._NULL, 25,0x6200e7, 0x161616), - SILVERFISH("silverfish", true, Materials._NULL, 25,0x0000000, 0xEE053D), - ENDIUM("endium", true, Materials.HeeEndium, 50,0x2F5A6C, 0xa0ffff), - RUNEI("rune1", true, Materials._NULL, 10,0x0104D9, 0xE31010), - RUNEII("rune2", true, Materials._NULL, 10,0xE31010, 0x0104D9), - FIREESSENSE("fireessence", true, Materials._NULL, 30,0xFFA157, 0xD41238), - - //New Combs to avoid meta id issues - CRYOLITE("cryolite", true, Materials.Cryolite, 90, 0xBFEFFF, 0x73B9D0); - - public boolean showInList; - public Materials material; - public int chance; - - private String name; - private int[] color; - - GTPP_CombType(String pName, boolean show, Materials material, int chance, int... color) { - this.name = pName; - this.material = material; - this.chance = chance; - this.showInList = show; - this.color=color; - } - - public void setHidden() { - this.showInList = false; - } - - public String getName() { - - return GT_LanguageManager.addStringLocalization("comb." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Comb"); - } - - public int[] getColours() { - return color == null || color.length != 2 ? new int[]{0,0} : color; - } + 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)); + + public boolean mShowInList; + public Materials mMaterial; + public int mChance; + public int mID; + + private String mName; + private String mNameUnlocal; + private int[] mColour; + + private static void map(int aId, GTPP_CombType aType) { + GTPP_Bees.sCombMappings.put(aId, aType); + } + + public static GTPP_CombType get(int aID) { + return GTPP_Bees.sCombMappings.get(aID); + } + + GTPP_CombType(int aID, String aName, boolean aShow, Materials aMaterial, 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); + } + + public void setHidden() { + this.mShowInList = false; + } + + public String getName() { + return GT_LanguageManager.addStringLocalization("comb." + this.mNameUnlocal, this.mName + " Comb"); + } + + public int[] getColours() { + return mColour == null || mColour.length != 2 ? new int[]{0, 0} : mColour; + } } 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 8578baa3c3..70333fdf2d 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 @@ -2,50 +2,48 @@ package gtPlusPlus.xmod.forestry.bees.handler; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; public enum GTPP_DropType { - OIL("oil",true), - MUTAGEN("small mutagen catalyst",true), - COOLANT("coolant",true), - HOT_COOLANT("hot coolant",true), - HYDRA("hydra blood",true), - SNOW_QUEEN("snowqueen blood",true), - OXYGEN("oxygen",true), - LAPIS("lapis coolant",true), - ENDERGOO("ender goo",true); - - private static int[][] colours = new int[][]{ - {0x19191B, 0x303032}, - {0xffc100, 0x00ff11}, - {0x144F5A, 0x2494A2}, - {0xC11F1F, 0xEBB9B9}, - {0x872836, 0xB8132C}, - {0xD02001, 0x9C0018}, - {0x003366, 0x0066BB}, - {0x1727b1, 0x008ce3}, - {0xA005E7, 0x161616}, - }; - public boolean showInList; - public Materials material; - public int chance; - private String name; + DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)); - private GTPP_DropType(String pName, boolean show) { - this.name = pName; - this.showInList = show; + public boolean mShowInList; + public Materials mMaterial; + public int mChance; + public int mID; + + private String mName; + private String mNameUnlocal; + private int[] mColour; + + private static void map(int aId, GTPP_DropType aType) { + GTPP_Bees.sDropMappings.put(aId, aType); + } + + public static GTPP_DropType get(int aID) { + return GTPP_Bees.sDropMappings.get(aID); + } + + private GTPP_DropType(int aID, String aName, boolean aShow, int... aColour) { + this.mID = aID; + this.mName = aName; + this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", ""); + this.mShowInList = aShow; + this.mColour = aColour; + map(aID, this); } public void setHidden() { - this.showInList = false; + this.mShowInList = false; } public String getName() { - - return GT_LanguageManager.addStringLocalization("drop." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Drop"); + return GT_LanguageManager.addStringLocalization("drop." + this.mNameUnlocal, this.mName + " Drop"); } public int[] getColours() { - return colours[this.ordinal()]; + return mColour; } } 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 7010c45cd0..cf0543ebf1 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 @@ -2,33 +2,48 @@ package gtPlusPlus.xmod.forestry.bees.handler; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; public enum GTPP_PollenType { - MATRIX("matrix",true); - - private static int[][] colours = new int[][]{ - {0x19191B, 0x303032}, - }; - public boolean showInList; - public Materials material; - public int chance; - private String name; - - private GTPP_PollenType(String pName, boolean show) { - this.name = pName; - this.showInList = show; - } - - public void setHidden() { - this.showInList = false; - } - - public String getName() { - return GT_LanguageManager.addStringLocalization("pollen." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Pollen"); - } - - public int[] getColours() { - return colours[this.ordinal()]; - } + DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20), Utils.rgbtoHexValue(20, 20, 20)); + + public boolean mShowInList; + public Materials mMaterial; + public int mChance; + public int mID; + + private String mName; + private String mNameUnlocal; + private int[] mColour; + + private static void map(int aId, GTPP_PollenType aType) { + GTPP_Bees.sPollenMappings.put(aId, aType); + } + + public static GTPP_PollenType get(int aID) { + return GTPP_Bees.sPollenMappings.get(aID); + } + + private GTPP_PollenType(int aID, String aName, boolean aShow, int... aColour) { + this.mID = aID; + this.mName = aName; + this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", ""); + this.mShowInList = aShow; + this.mColour = aColour; + map(aID, this); + } + + public void setHidden() { + this.mShowInList = false; + } + + public String getName() { + return GT_LanguageManager.addStringLocalization("pollen." + this.mNameUnlocal, this.mName + " Pollen"); + } + + public int[] getColours() { + return mColour; + } } 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 92ee16571d..a989b4d9cb 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 @@ -2,51 +2,48 @@ package gtPlusPlus.xmod.forestry.bees.handler; import gregtech.api.enums.Materials; import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees; public enum GTPP_PropolisType { - End("End",true), - Ectoplasma("Ectoplasma",true), - Arcaneshard("Arcaneshard",true), - Stardust("Stardust",true), - Dragonessence("Dragonessence",true), - Enderman("Enderman",true), - Silverfish("Silverfish", true), - Endium("Endium", true), - Fireessence("Fireessence",true); - - private static int[] colours = new int[]{ - 0xCC00FA, - 0xDCB0E5, - 0x9010AD, - 0xFFFF00, - 0x911ECE, - 0x161616, - 0xEE053D, - 0xa0ffff, - 0xD41238 - }; - - public boolean showInList; - public Materials material; - public int chance; - private String name; - - private GTPP_PropolisType(String pName, boolean show) { - this.name = pName; - this.showInList = show; + DRAGONBLOOD(0, "Dragon Blood", true, Utils.rgbtoHexValue(220, 20, 20)); + + public boolean mShowInList; + public Materials mMaterial; + public int mChance; + public int mID; + + private String mName; + private String mNameUnlocal; + private int mColour; + + private static void map(int aId, GTPP_PropolisType aType) { + GTPP_Bees.sPropolisMappings.put(aId, aType); + } + + public static GTPP_PropolisType get(int aID) { + return GTPP_Bees.sPropolisMappings.get(aID); + } + + private GTPP_PropolisType(int aID, String aName, boolean aShow, int aColour) { + this.mID = aID; + this.mName = aName; + this.mNameUnlocal = aName.toLowerCase().replaceAll(" ", ""); + this.mShowInList = aShow; + this.mColour = aColour; + map(aID, this); } public void setHidden() { - this.showInList = false; + this.mShowInList = false; } public String getName() { -// return "gt.comb."+this.name; - return GT_LanguageManager.addStringLocalization("propolis." + this.name, this.name.substring(0, 1).toUpperCase() + this.name.substring(1) + " Propolis"); + return GT_LanguageManager.addStringLocalization("propolis." + this.mNameUnlocal, this.mName + " Propolis"); } public int getColours() { - return colours[this.ordinal()]; + return mColour; } } diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_CustomBee.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_CustomBee.java deleted file mode 100644 index 7d9a9e231b..0000000000 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/FR_CustomBee.java +++ /dev/null @@ -1,5 +0,0 @@ -package gtPlusPlus.xmod.forestry.bees.items; - -public class FR_CustomBee { - -} 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 01e7009cb8..f191cc4ae1 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 @@ -1,6 +1,10 @@ package gtPlusPlus.xmod.forestry.bees.items.output; -import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.GT_Values.L; +import static gregtech.api.enums.GT_Values.NF; +import static gregtech.api.enums.GT_Values.NI; +import static gregtech.api.enums.GT_Values.RA; +import static gregtech.api.enums.GT_Values.V; import java.util.Arrays; import java.util.List; @@ -14,15 +18,19 @@ import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.Tabs; import forestry.api.recipes.RecipeManagers; import gregtech.GT_Mod; -import gregtech.api.enums.*; -import gregtech.api.util.*; -import gregtech.loaders.materialprocessing.ProcessingModSupport; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OrePrefixes; +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.xmod.forestry.bees.handler.*; +import gtPlusPlus.xmod.forestry.bees.handler.GTPP_CombType; +import gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType; +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.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; @@ -30,7 +38,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; public class GTPP_Comb extends Item { - + @SideOnly(Side.CLIENT) private IIcon secondIcon; @@ -43,18 +51,18 @@ public class GTPP_Comb extends Item { } public ItemStack getStackForType(GTPP_CombType type) { - return new ItemStack(this, 1, type.ordinal()); + return new ItemStack(this, 1, type.mID); } public ItemStack getStackForType(GTPP_CombType type, int count) { - return new ItemStack(this, count, type.ordinal()); + return new ItemStack(this, count, type.mID); } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List list) { for (GTPP_CombType type : GTPP_CombType.values()) { - if (type.showInList) { + if (type.mShowInList) { list.add(this.getStackForType(type)); } } @@ -72,7 +80,7 @@ public class GTPP_Comb extends Item { } @Override - @SideOnly(Side.CLIENT) + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon("forestry:beeCombs.0"); this.secondIcon = par1IconRegister.registerIcon("forestry:beeCombs.1"); @@ -86,11 +94,10 @@ public class GTPP_Comb extends Item { @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int pass) { - int meta = Math.max(0, Math.min(GTPP_CombType.values().length - 1, stack.getItemDamage())); - int colour = GTPP_CombType.values()[meta].getColours()[0]; + int colour = GTPP_CombType.get(stack.getItemDamage()).getColours()[0]; if (pass >= 1) { - colour = GTPP_CombType.values()[meta].getColours()[1]; + colour = GTPP_CombType.get(stack.getItemDamage()).getColours()[1]; } return colour; @@ -98,470 +105,221 @@ public class GTPP_Comb extends Item { @Override public String getItemStackDisplayName(ItemStack stack) { - return GTPP_CombType.values()[stack.getItemDamage()].getName(); + return GTPP_CombType.get(stack.getItemDamage()).getName(); } - public void initCombsRecipes() { - - //Organic - addProcessGT(GTPP_CombType.LIGNIE, new Materials[] {Materials.Lignite}, Voltage.LV); - addProcessGT(GTPP_CombType.COAL, new Materials[] {Materials.Coal}, Voltage.LV); - addCentrifugeToItemStack(GTPP_CombType.STICKY, new ItemStack[] { ItemList.IC2_Resin.get(1), ItemList.IC2_Plantball.get(1), ItemList.FR_Wax.get(1) }, new int[] {50 * 100, 15 * 100, 50 * 100}, Voltage.ULV); - addProcessGT(GTPP_CombType.OIL, new Materials[] {Materials.Oilsands}, Voltage.LV); - addProcessGT(GTPP_CombType.APATITE, new Materials[] {Materials.Apatite, Materials.Phosphate}, Voltage.LV); - addCentrifugeToMaterial(GTPP_CombType.ASH, new Materials[] {Materials.DarkAsh, Materials.Ash}, new int[] { 50*100, 50*100}, new int[] {}, Voltage.ULV, NI, 50 * 100); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToItemStack(GTPP_CombType.LIGNIE, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), ItemList.FR_Wax.get(1) }, new int[] {90 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToItemStack(GTPP_CombType.COAL, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), ItemList.FR_Wax.get(1) }, new int[] {5 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToItemStack(GTPP_CombType.OIL, new ItemStack[] { ItemList.Crop_Drop_OilBerry.get(1), GTPP_Bees.drop.getStackForType(GTPP_DropType.OIL), ItemList.FR_Wax.get(1) }, new int[] {70 * 100, 100 * 100, 50 * 100}, Voltage.ULV); - }else { - addCentrifugeToItemStack(GTPP_CombType.LIGNIE, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Lignite, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Lignite, 1), ItemList.FR_Wax.get(1) }, new int[] {90 * 100, 100 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToItemStack(GTPP_CombType.COAL, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.gem, Materials.Coal, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Coal, 1), ItemList.FR_Wax.get(1) }, new int[] {5 * 100, 100 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToItemStack(GTPP_CombType.OIL, new ItemStack[] { ItemList.Crop_Drop_OilBerry.get(1), GTPP_Bees.drop.getStackForType(GTPP_DropType.OIL), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Oilsands, 1), ItemList.FR_Wax.get(1) }, new int[] {70 * 100, 100 * 100, 100 * 100, 50 * 100}, Voltage.ULV); - addCentrifugeToMaterial(GTPP_CombType.APATITE, new Materials[] { Materials.Apatite, Materials.Phosphate }, new int[] {100 * 100, 80 * 100 }, new int[] {}, Voltage.ULV, NI, 30 * 100); - } - - //ic2 - addCentrifugeToItemStack(GTPP_CombType.COOLANT, new ItemStack[] { GTPP_Bees.drop.getStackForType(GTPP_DropType.COOLANT), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 100 * 100}, Voltage.HV, 196); - addCentrifugeToItemStack(GTPP_CombType.ENERGY, new ItemStack[] {GTPP_Bees.drop.getStackForType(GTPP_DropType.HOT_COOLANT), ItemList.IC2_Energium_Dust.get(1L), ItemList.FR_RefractoryWax.get(1)}, new int[] {20 * 100, 20 * 100, 50 * 100}, Voltage.HV, 196); - addCentrifugeToItemStack(GTPP_CombType.LAPOTRON, new ItemStack[] {GTPP_Bees.drop.getStackForType(GTPP_DropType.LAPIS), GT_ModHandler.getModItem(MOD_ID_DC, "item.LapotronDust", 1, 0), GT_ModHandler.getModItem("MagicBees", "wax", 1, 2) }, new int[] {20 * 100, 15 * 100, 40 * 100}, Voltage.HV, 196); - addCentrifugeToMaterial(GTPP_CombType.PYROTHEUM, new Materials[] {Materials.Blaze, Materials.Pyrotheum}, new int[] { 25 * 100, 20 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.CRYOTHEUM, new Materials[] {Materials.Blizz, Materials.Cryotheum}, new int[] { 25 * 100, 20 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - - //Alloy - addProcessGT(GTPP_CombType.REDALLOY, new Materials[] {Materials.RedAlloy, Materials.Redstone, Materials.Copper}, Voltage.LV); - addProcessGT(GTPP_CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy, Materials.Redstone, Materials.Silicon, Materials.Coal}, Voltage.LV); - addProcessGT(GTPP_CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron, Materials.Silver, Materials.Iron }, Voltage.MV); - addProcessGT(GTPP_CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy, Materials.Chrome }, Voltage.HV); - addProcessGT(GTPP_CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy, Materials.Gold }, Voltage.HV); - addProcessGT(GTPP_CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel, Materials.Silicon, Materials.Coal }, Voltage.LV); - addProcessGT(GTPP_CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel, Materials.Coal }, Voltage.MV); - addProcessGT(GTPP_CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron, Materials.Iron }, Voltage.HV); - addProcessGT(GTPP_CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel, Materials.Iron, Materials.Chrome, Materials.Manganese, Materials.Nickel }, Voltage.HV); - addCentrifugeToItemStack(GTPP_CombType.ENDERIUM, new ItemStack[] {ItemList.FR_RefractoryWax.get(1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.EnderiumBase, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Enderium, 1) }, new int[] {50 * 100, 30 * 100, 50 * 100 }, Voltage.HV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(GTPP_CombType.REDALLOY, new Materials[] {Materials.RedAlloy}, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy}, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron }, new int[] {90 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy }, new int[] {70 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy }, new int[] {80 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel }, new int[] {100 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel }, new int[] {100 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron }, new int[] {80 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel }, new int[] {50 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - }else { - addCentrifugeToMaterial(GTPP_CombType.REDALLOY, new Materials[] {Materials.RedAlloy, Materials.Redstone, Materials.Copper}, new int[] {100 * 100, 75 * 100, 90 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.REDSTONEALLOY, new Materials[] {Materials.RedstoneAlloy, Materials.Redstone, Materials.Silicon, Materials.Coal}, new int[] {100 * 100, 90 * 100, 75 * 100, 75 * 100 }, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.CONDUCTIVEIRON, new Materials[] {Materials.ConductiveIron, Materials.Silver, Materials.Iron }, new int[] {90 * 100, 55 * 100, 65 * 100}, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.VIBRANTALLOY, new Materials[] {Materials.VibrantAlloy, Materials.Chrome }, new int[] {70 * 100, 50 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.ENERGETICALLOY, new Materials[] {Materials.EnergeticAlloy, Materials.Gold }, new int[] {80 * 100, 60 * 100}, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.ELECTRICALSTEEL, new Materials[] {Materials.ElectricalSteel, Materials.Silicon, Materials.Coal }, new int[] {100 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.DARKSTEEL, new Materials[] {Materials.DarkSteel, Materials.Coal }, new int[] {100 * 100, 75 * 100 }, new int[] {}, Voltage.MV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.PULSATINGIRON, new Materials[] {Materials.PulsatingIron, Materials.Iron }, new int[] {80 * 100, 75 * 100 }, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.STAINLESSSTEEL, new Materials[] {Materials.StainlessSteel, Materials.Iron, Materials.Chrome, Materials.Manganese, Materials.Nickel }, new int[] {50 * 100, 75 * 100, 55 * 100, 75 * 100, 75 * 100 }, new int[] {}, Voltage.HV, ItemList.FR_RefractoryWax.get(1), 50 * 100); - } - - //Thaumic - addProcessGT(GTPP_CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium, Materials.Iron }, Voltage.MV); - addCentrifugeToItemStack(GTPP_CombType.THAUMIUMSHARD, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "propolis", 1, 1), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 2), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 3), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 4), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 5), GT_ModHandler.getModItem("MagicBees", "propolis", 1, 6), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) }, new int[] {20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 20 * 100, 50 * 100 }, Voltage.ULV); - addProcessGT(GTPP_CombType.AMBER, new Materials[] {Materials.Amber}, Voltage.LV); - addProcessGT(GTPP_CombType.QUICKSILVER, new Materials[] {Materials.Cinnabar }, Voltage.LV); - addCentrifugeToItemStack(GTPP_CombType.SALISMUNDUS, new ItemStack[] {GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 14), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {100 * 100, 50 * 100}, Voltage.MV); - addCentrifugeToItemStack(GTPP_CombType.TAINTED, new ItemStack[] {GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 11), GT_ModHandler.getModItem("Thaumcraft", "ItemResource", 1, 12), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 1), GT_ModHandler.getModItem("Thaumcraft", "blockTaintFibres", 1, 2), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {15 * 100, 15 * 100, 15 * 100, 15 * 100, 15 * 100, 50 * 100}, Voltage.ULV); - addProcessGT(GTPP_CombType.MITHRIL, new Materials[] {Materials.Mithril, Materials.Platinum }, Voltage.HV); - addProcessGT(GTPP_CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver, Materials.Silver }, Voltage.HV); - addCentrifugeToMaterial(GTPP_CombType.ASTRALSILVER, new Materials[] {Materials.AstralSilver, Materials.Silver}, new int[] {20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:75) * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - addCentrifugeToItemStack(GTPP_CombType.THAUMINITE, new ItemStack[] {GT_ModHandler.getModItem("thaumicbases", "resource", 1, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Thaumium, 1), GT_ModHandler.getModItem("MagicBees", "wax", 1, 0)}, new int[] {20 * 100, 10 * 100, 50 *100}, Voltage.HV); - addProcessGT(GTPP_CombType.SHADOWMETAL, new Materials[] {Materials.Shadow, Materials.ShadowSteel }, Voltage.HV); - addCentrifugeToMaterial(GTPP_CombType.SHADOWMETAL, new Materials[] {Materials.Shadow, Materials.ShadowSteel}, new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 20:75) * 100, 10 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0) , 50 * 100); - addProcessGT(GTPP_CombType.DIVIDED, new Materials[] {Materials.Iron, Materials.Diamond }, Voltage.HV); - addCentrifugeToItemStack(GTPP_CombType.DIVIDED, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("ExtraUtilities", "unstableingot", 1, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Iron, 1), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Diamond, 1)}, new int[] {50 * 100, 20 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:75) * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 5:55) * 100}, Voltage.HV); - addProcessGT(GTPP_CombType.SPARKELING, new Materials[] {Materials.NetherStar}, Voltage.EV); - addCentrifugeToItemStack(GTPP_CombType.SPARKELING, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("MagicBees", "miscResources", 2, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.NetherStar, 1)}, new int[] {50 * 100, 10 * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 10:50) * 100}, Voltage.EV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(GTPP_CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium }, new int[] {100 * 100}, new int[] {}, Voltage.MV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - addCentrifugeToItemStack(GTPP_CombType.QUICKSILVER, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5) }, new int[] {50 * 100, 100 * 100 }, Voltage.ULV); - }else { - addCentrifugeToMaterial(GTPP_CombType.THAUMIUMDUST, new Materials[] {Materials.Thaumium, Materials.Iron }, new int[] {100 * 100, 75 * 100 }, new int[] {}, Voltage.MV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.AMBER, new Materials[] {Materials.Amber }, new int[] {100 * 100 }, new int[] {}, Voltage.ULV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - addCentrifugeToItemStack(GTPP_CombType.QUICKSILVER, new ItemStack[] {GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), GT_ModHandler.getModItem("Thaumcraft", "ItemNugget", 1, 5), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Cinnabar, 1) }, new int[] {50 * 100, 100 * 100, 85 * 100 }, Voltage.ULV); - addCentrifugeToMaterial(GTPP_CombType.MITHRIL, new Materials[] {Materials.Mithril, Materials.Platinum}, new int[] {75 * 100, 55 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1, 0), 50 * 100); - } - - //Gem Line - addProcessGT(GTPP_CombType.STONE, new Materials[] {Materials.Soapstone, Materials.Talc, Materials.Apatite, Materials.Phosphate, Materials.TricalciumPhosphate}, Voltage.LV); - addProcessGT(GTPP_CombType.CERTUS, new Materials[] {Materials.CertusQuartz, Materials.Quartzite, Materials.Barite}, Voltage.LV); - addProcessGT(GTPP_CombType.FLUIX, new Materials[] {Materials.Redstone, Materials.CertusQuartz, Materials.NetherQuartz}, Voltage.LV); - addProcessGT(GTPP_CombType.REDSTONE, new Materials[] {Materials.Redstone, Materials.Cinnabar}, Voltage.LV); - addCentrifugeToMaterial(GTPP_CombType.RAREEARTH, new Materials[] {Materials.RareEarth}, new int[] {100 * 100}, new int[] { 1}, Voltage.ULV, NI, 30 * 100); - addProcessGT(GTPP_CombType.LAPIS, new Materials[] {Materials.Lapis, Materials.Sodalite, Materials.Lazurite, Materials.Calcite }, Voltage.LV); - addProcessGT(GTPP_CombType.RUBY, new Materials[] {Materials.Ruby, Materials.Redstone }, Voltage.LV); - addProcessGT(GTPP_CombType.REDGARNET, new Materials[] {Materials.GarnetRed, Materials.GarnetYellow }, Voltage.LV); - addProcessGT(GTPP_CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow, Materials.GarnetRed }, Voltage.LV); - addProcessGT(GTPP_CombType.SAPPHIRE, new Materials[] {Materials.Sapphire, Materials.GreenSapphire, Materials.Almandine, Materials.Pyrope}, Voltage.LV); - addProcessGT(GTPP_CombType.DIAMOND, new Materials[] {Materials.Diamond, Materials.Graphite}, Voltage.LV); - addProcessGT(GTPP_CombType.OLIVINE, new Materials[] {Materials.Olivine, Materials.Bentonite, Materials.Magnesite, Materials.Glauconite}, Voltage.LV); - addProcessGT(GTPP_CombType.EMERALD, new Materials[] {Materials.Emerald, Materials.Beryllium, Materials.Thorium}, Voltage.LV); - addProcessGT(GTPP_CombType.FIRESTONE, new Materials[] {Materials.Firestone}, Voltage.LV); - addProcessGT(GTPP_CombType.PYROPE, new Materials[] {Materials.Pyrope, Materials.Aluminium, Materials.Magnesium, Materials.Silicon}, Voltage.LV); - addProcessGT(GTPP_CombType.GROSSULAR, new Materials[] {Materials.Grossular, Materials.Aluminium, Materials.Silicon}, Voltage.LV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(GTPP_CombType.STONE, new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed, Materials.Basalt, Materials.Marble, Materials.Redrock}, new int[] {70 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100, 50 * 100}, new int[] { 9, 9, 9, 9, 9, 9}, Voltage.ULV, NI, 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.FLUIX, new Materials[] {Materials.Fluix}, new int[] {25 * 100}, new int[] { 9}, Voltage.ULV, NI, 30 * 100); - }else { - addCentrifugeToMaterial(GTPP_CombType.STONE, new Materials[] {Materials.Soapstone, Materials.Talc, Materials.Apatite, Materials.Phosphate, Materials.TricalciumPhosphate}, new int[] {95 * 100, 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.CERTUS, new Materials[] {Materials.CertusQuartz, Materials.Quartzite, Materials.Barite}, new int[] {100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.FLUIX, new Materials[] {Materials.Fluix, Materials.Redstone, Materials.CertusQuartz, Materials.NetherQuartz}, new int[] {25 * 100, 90 * 100, 90 * 100, 90 * 100}, new int[] { 9, 1, 1, 1}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.REDSTONE, new Materials[] {Materials.Redstone, Materials.Cinnabar }, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.LAPIS, new Materials[] {Materials.Lapis, Materials.Sodalite, Materials.Lazurite, Materials.Calcite }, new int[] {100 * 100, 90 * 100, 90 * 100, 85 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.RUBY, new Materials[] {Materials.Ruby, Materials.Redstone }, new int[] {100 * 100, 90 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.REDGARNET, new Materials[] {Materials.GarnetRed, Materials.GarnetYellow }, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.YELLOWGARNET, new Materials[] {Materials.GarnetYellow, Materials.GarnetRed }, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.SAPPHIRE, new Materials[] {Materials.Sapphire, Materials.GreenSapphire, Materials.Almandine, Materials.Pyrope}, new int[] {100 * 100, 90 * 100, 90 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.DIAMOND, new Materials[] {Materials.Diamond, Materials.Graphite}, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.OLIVINE, new Materials[] {Materials.Olivine, Materials.Bentonite, Materials.Magnesite, Materials.Glauconite}, new int[] {100 * 100, 90 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.EMERALD, new Materials[] {Materials.Emerald, Materials.Beryllium, Materials.Thorium}, new int[] {100 * 100, 85 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.FIRESTONE, new Materials[] {Materials.Firestone}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, ItemList.FR_RefractoryWax.get(1), 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.PYROPE, new Materials[] {Materials.Pyrope, Materials.Aluminium, Materials.Magnesium, Materials.Silicon}, new int[] {100 * 100, 75 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.GROSSULAR, new Materials[] {Materials.Grossular, Materials.Aluminium, Materials.Silicon}, new int[] {100 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - } - - // Metals Line - addProcessGT(GTPP_CombType.SLAG, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Lepidolite, Materials.Spodumene, Materials.Monazite}, Voltage.LV); - addProcessGT(GTPP_CombType.COPPER, new Materials[] {Materials.Copper, Materials.Tetrahedrite, Materials.Chalcopyrite, Materials.Malachite, Materials.Pyrite, Materials.Stibnite}, Voltage.LV); - addProcessGT(GTPP_CombType.TIN, new Materials[] {Materials.Tin, Materials.Cassiterite, Materials.CassiteriteSand}, Voltage.LV); - addProcessGT(GTPP_CombType.LEAD, new Materials[] {Materials.Lead, Materials.Galena}, Voltage.LV); - addProcessGT(GTPP_CombType.NICKEL, new Materials[] {Materials.Nickel, Materials.Garnierite, Materials.Pentlandite, Materials.Cobaltite, Materials.Wulfenite, Materials.Powellite}, Voltage.LV); - addProcessGT(GTPP_CombType.ZINC, new Materials[] {Materials.Zinc, Materials.Sulfur}, Voltage.LV); - addProcessGT(GTPP_CombType.SILVER, new Materials[] {Materials.Silver, Materials.Galena}, Voltage.LV); - addProcessGT(GTPP_CombType.CRYOLITE, new Materials[] {Materials.Cryolite, Materials.Silver}, Voltage.LV); - addProcessGT(GTPP_CombType.GOLD, new Materials[] {Materials.Gold, Materials.Magnetite}, Voltage.LV); - addChemicalProcess(GTPP_CombType.GOLD, Materials.Magnetite, Materials.Gold, Voltage.LV); - addProcessGT(GTPP_CombType.SULFUR, new Materials[] {Materials.Sulfur, Materials.Pyrite, Materials.Sphalerite}, Voltage.LV); - addProcessGT(GTPP_CombType.GALLIUM, new Materials[] {Materials.Gallium, Materials.Niobium}, Voltage.LV); - addProcessGT(GTPP_CombType.ARSENIC, new Materials[] {Materials.Arsenic, Materials.Bismuth, Materials.Antimony}, Voltage.LV); - if (ProcessingModSupport.aEnableGCMarsMats) { - addProcessGT(GTPP_CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.MeteoricIron}, Voltage.LV); - addProcessGT(GTPP_CombType.STEEL, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.YellowLimonite, Materials.BrownLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.MeteoricIron, Materials.Molybdenite, Materials.Molybdenum}, Voltage.LV); - }else { - addProcessGT(GTPP_CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite}, Voltage.LV); - addProcessGT(GTPP_CombType.STEEL, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.YellowLimonite, Materials.BrownLimonite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Pyrite, Materials.Molybdenite, Materials.Molybdenum}, Voltage.LV); - } - addChemicalProcess(GTPP_CombType.STEEL, Materials.BrownLimonite, Materials.YellowLimonite, Voltage.LV); - addChemicalProcess(GTPP_CombType.STEEL, Materials.YellowLimonite, Materials.BrownLimonite, Voltage.LV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(GTPP_CombType.SLAG, new Materials[] {Materials.Stone, Materials.GraniteBlack, Materials.GraniteRed}, new int[] {50 * 100, 20 * 100, 20 * 100}, new int[] { 9, 9, 9}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.COPPER, new Materials[] {Materials.Copper}, new int[] {70 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.TIN, new Materials[] {Materials.Tin}, new int[] {60 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.LEAD, new Materials[] {Materials.Lead}, new int[] {45 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.IRON, new Materials[] {Materials.Iron}, new int[] {30 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.STEEL, new Materials[] {Materials.Steel}, new int[] {40 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.SILVER, new Materials[] {Materials.Silver}, new int[] {80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.CRYOLITE, new Materials[] {Materials.Cryolite}, new int[] {80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - }else { - addCentrifugeToMaterial(GTPP_CombType.SLAG, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Lepidolite, Materials.Spodumene, Materials.Monazite}, new int[] {100 * 100, 100 * 100, 100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.COPPER, new Materials[] {Materials.Copper, Materials.Tetrahedrite, Materials.Chalcopyrite, Materials.Malachite, Materials.Pyrite, Materials.Stibnite}, new int[] {100 * 100, 85 * 100, 95 * 100, 80 * 100, 75 * 100, 65 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.TIN, new Materials[] {Materials.Tin, Materials.Cassiterite, Materials.CassiteriteSand}, new int[] {100 * 100, 85 * 100, 65 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.LEAD, new Materials[] {Materials.Lead, Materials.Galena}, new int[] {100 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - if (ProcessingModSupport.aEnableGCMarsMats) { - addCentrifugeToMaterial(GTPP_CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.MeteoricIron}, new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.LEAD, new Materials[] {Materials.Steel, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.Molybdenite, Materials.Molybdenum, Materials.MeteoricIron }, new int[] {100 * 100, 90 * 100, 80 * 100, 65 * 100, 65 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - }else { - addCentrifugeToMaterial(GTPP_CombType.IRON, new Materials[] {Materials.Iron, Materials.Magnetite, Materials.BrownLimonite, Materials.YellowLimonite, Materials.VanadiumMagnetite, Materials.BandedIron}, new int[] {100 * 100, 90 * 100, 85 * 100, 85 * 100, 80 * 100, 85 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.STEEL, new Materials[] {Materials.Steel, Materials.Magnetite, Materials.VanadiumMagnetite, Materials.BandedIron, Materials.Molybdenite, Materials.Molybdenum }, new int[] {100 * 100, 90 * 100, 80 * 100, 85 * 100, 65 * 100, 65 * 100 }, new int[] {}, Voltage.ULV, NI, 30 * 100); - } - addCentrifugeToMaterial(GTPP_CombType.NICKEL, new Materials[] {Materials.Nickel, Materials.Garnierite, Materials.Pentlandite, Materials.Cobaltite, Materials.Wulfenite, Materials.Powellite}, new int[] {100 * 100, 85 * 100, 85 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.ZINC, new Materials[] {Materials.Zinc, Materials.Sphalerite, Materials.Sulfur}, new int[] {100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.SILVER, new Materials[] {Materials.Silver, Materials.Galena}, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.CRYOLITE, new Materials[] {Materials.Cryolite, Materials.Silver}, new int[] {100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.GOLD, new Materials[] {Materials.Gold}, new int[] {100 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.SULFUR, new Materials[] {Materials.Sulfur, Materials.Pyrite, Materials.Sphalerite}, new int[] {100 * 100, 90 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.GALLIUM, new Materials[] {Materials.Gallium, Materials.Niobium}, new int[] { 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.ARSENIC, new Materials[] {Materials.Arsenic, Materials.Bismuth, Materials.Antimony}, new int[] {80 * 100, 70 * 100, 70 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); - } - - // Rare Metals Line - addProcessGT(GTPP_CombType.BAUXITE, new Materials[] {Materials.Bauxite, Materials.Aluminium}, Voltage.LV); - addProcessGT(GTPP_CombType.ALUMINIUM, new Materials[] {Materials.Aluminium, Materials.Bauxite}, Voltage.LV); - addProcessGT(GTPP_CombType.MANGANESE, new Materials[] {Materials.Manganese, Materials.Grossular, Materials.Spessartine, Materials.Pyrolusite, Materials.Tantalite}, Voltage.LV); - addProcessGT(GTPP_CombType.TITANIUM, new Materials[] {Materials.Titanium, Materials.Ilmenite, Materials.Bauxite, Materials.Rutile}, Voltage.EV); - addProcessGT(GTPP_CombType.MAGNESIUM, new Materials[] {Materials.Magnesium, Materials.Magnesite}, Voltage.LV); - addProcessGT(GTPP_CombType.CHROME, new Materials[] {Materials.Chrome, Materials.Ruby, Materials.Chromite, Materials.Redstone, Materials.Neodymium, Materials.Bastnasite}, Voltage.HV); - addProcessGT(GTPP_CombType.TUNGSTEN, new Materials[] {Materials.Tungsten, Materials.Tungstate, Materials.Scheelite, Materials.Lithium}, Voltage.IV); - addProcessGT(GTPP_CombType.PLATINUM, new Materials[] {Materials.Platinum, Materials.Cooperite, Materials.Palladium}, Voltage.HV); - addProcessGT(GTPP_CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum, Materials.Molybdenite, Materials.Powellite, Materials.Wulfenite}, Voltage.LV); - addChemicalProcess(GTPP_CombType.MOLYBDENUM, Materials.Osmium, Materials.Osmium, Voltage.IV); - addAutoclaveProcess(GTPP_CombType.MOLYBDENUM, Materials.Osmium, Voltage.IV, 5); - addProcessGT(GTPP_CombType.IRIDIUM, new Materials[] {Materials.Iridium, Materials.Osmium}, Voltage.IV); - addProcessGT(GTPP_CombType.OSMIUM, new Materials[] {Materials.Osmium, Materials.Iridium}, Voltage.IV); - addProcessGT(GTPP_CombType.LITHIUM, new Materials[] {Materials.Lithium, Materials.Aluminium}, Voltage.MV); - addProcessGT(GTPP_CombType.SALT, new Materials[] {Materials.Salt, Materials.RockSalt, Materials.Saltpeter}, Voltage.MV); - addProcessGT(GTPP_CombType.ELECTROTINE, new Materials[] {Materials.Electrotine, Materials.Electrum, Materials.Redstone}, Voltage.MV); - if(GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToItemStack(GTPP_CombType.SALT, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 1), GT_ModHandler.getModItem(MOD_ID_DC, "item.EdibleSalt", 1L, 0), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 50 * 100, 50 * 100}, Voltage.MV, 160); - }else { - addCentrifugeToMaterial(GTPP_CombType.BAUXITE, new Materials[] {Materials.Bauxite, Materials.Aluminium}, new int[] { 75 * 100, 55 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.ALUMINIUM, new Materials[] {Materials.Aluminium, Materials.Bauxite}, new int[] { 60 * 100, 80 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.MANGANESE, new Materials[] {Materials.Manganese, Materials.Grossular, Materials.Spessartine, Materials.Pyrolusite, Materials.Tantalite}, new int[] { 30 * 100, 100 * 100, 100 * 100, 100 * 100, 100 * 100}, new int[] {}, Voltage.ULV , NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.TITANIUM, new Materials[] {Materials.Titanium, Materials.Ilmenite, Materials.Bauxite, Materials.Rutile}, new int[] { 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.MAGNESIUM, new Materials[] {Materials.Magnesium, Materials.Magnesite}, new int[] { 100 * 100, 80 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.CHROME, new Materials[] {Materials.Chrome, Materials.Ruby, Materials.Chromite, Materials.Redstone, Materials.Neodymium, Materials.Bastnasite}, new int[] { 50 * 100, 100 * 100, 50 * 100, 100 * 100, 80 * 100, 80 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.TUNGSTEN, new Materials[] {Materials.Tungsten, Materials.Tungstate, Materials.Scheelite, Materials.Lithium}, new int[] { 50 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.PLATINUM, new Materials[] {Materials.Platinum, Materials.Cooperite, Materials.Palladium}, new int[] { 40 * 100, 40 * 100, 40 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.MOLYBDENUM, new Materials[] {Materials.Molybdenum, Materials.Molybdenite, Materials.Powellite, Materials.Wulfenite}, new int[] { 100 * 100, 80 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.IRIDIUM, new Materials[] {Materials.Iridium, Materials.Osmium}, new int[] { 20 * 100, 15 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.OSMIUM, new Materials[] {Materials.Osmium, Materials.Iridium}, new int[] { 25 * 100, 15 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.LITHIUM, new Materials[] {Materials.Lithium, Materials.Aluminium}, new int[] { 85 * 100, 75 * 100}, new int[] {}, Voltage.MV, NI, 30 * 100); - addCentrifugeToItemStack(GTPP_CombType.SALT, new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Salt, 1), GT_ModHandler.getModItem(MOD_ID_DC, "item.EdibleSalt", 1L, 0),GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.RockSalt, 1), GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.Saltpeter, 1), ItemList.FR_Wax.get(1) }, new int[] {100 * 100, 50 * 100, 75 * 100, 65 * 100, 50 * 100}, Voltage.MV, 160); - addCentrifugeToMaterial(GTPP_CombType.ELECTROTINE, new Materials[] {Materials.Electrotine, Materials.Electrum, Materials.Redstone}, new int[] { 80, 75, 65}, new int[] {}, Voltage.MV, NI, 30 * 100); - } - - //Radioactive Line - addProcessGT(GTPP_CombType.ALMANDINE, new Materials[] {Materials.Almandine, Materials.Pyrope, Materials.Sapphire, Materials.GreenSapphire}, Voltage.LV); - addProcessGT(GTPP_CombType.URANIUM, new Materials[] {Materials.Uranium, Materials.Pitchblende, Materials.Uraninite, Materials.Uranium235}, Voltage.EV); - addProcessGT(GTPP_CombType.PLUTONIUM,new Materials[] {Materials.Plutonium, Materials.Uranium235}, Voltage.EV); - addChemicalProcess(GTPP_CombType.PLUTONIUM, Materials.Uranium235, Materials.Plutonium, Voltage.EV); - addProcessGT(GTPP_CombType.NAQUADAH,new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}, Voltage.IV); - addProcessGT(GTPP_CombType.NAQUADRIA,new Materials[] {Materials.Naquadria, Materials.NaquadahEnriched, Materials.Naquadah}, Voltage.LUV); - addProcessGT(GTPP_CombType.THORIUM,new Materials[] {Materials.Thorium, Materials.Uranium, Materials.Coal}, Voltage.EV); - addProcessGT(GTPP_CombType.LUTETIUM,new Materials[] {Materials.Lutetium, Materials.Thorium}, Voltage.IV); - addProcessGT(GTPP_CombType.AMERICIUM,new Materials[] {Materials.Americium, Materials.Lutetium}, Voltage.LUV); - addProcessGT(GTPP_CombType.NEUTRONIUM,new Materials[] {Materials.Neutronium, Materials.Americium}, Voltage.UV); - if(!GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(GTPP_CombType.ALMANDINE, new Materials[] {Materials.Almandine, Materials.Pyrope, Materials.Sapphire, Materials.GreenSapphire}, new int[] { 90 * 100, 80 * 100, 75 * 100, 75 * 100}, new int[] {}, Voltage.ULV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.URANIUM, new Materials[] {Materials.Uranium, Materials.Pitchblende, Materials.Uraninite, Materials.Uranium235}, new int[] { 50 * 100, 65 * 100, 75 * 100, 50 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.PLUTONIUM,new Materials[] {Materials.Plutonium, Materials.Uranium235}, new int[] {10, 5}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.NAQUADAH,new Materials[] {Materials.Naquadah, Materials.NaquadahEnriched, Materials.Naquadria}, new int[] {10 * 100, 5 * 100, 5 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.NAQUADRIA,new Materials[] {Materials.Naquadria, Materials.NaquadahEnriched, Materials.Naquadah}, new int[] {10 * 100, 10 * 100, 15 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.THORIUM,new Materials[] {Materials.Thorium, Materials.Uranium, Materials.Coal}, new int[] {75 * 100, 75 * 100 * 100, 95 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.LUTETIUM,new Materials[] {Materials.Lutetium, Materials.Thorium}, new int[] {35 * 100, 55 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.AMERICIUM,new Materials[] {Materials.Americium, Materials.Lutetium}, new int[] {25 * 100, 45 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.NEUTRONIUM,new Materials[] {Materials.Neutronium, Materials.Americium}, new int[] {15 * 100, 35 * 100}, new int[] {}, Voltage.UV, NI, 30 * 100); - } - - // Twilight - addCentrifugeToItemStack(GTPP_CombType.NAGA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 4), GT_ModHandler.getModItem(MOD_ID_DC, "item.NagaScaleChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.NagaScaleFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.MV); - addCentrifugeToItemStack(GTPP_CombType.LICH, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 5), GT_ModHandler.getModItem(MOD_ID_DC, "item.LichBoneChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.LichBoneFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.HV); - addCentrifugeToItemStack(GTPP_CombType.HYDRA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 1), GT_ModHandler.getModItem(MOD_ID_DC, "item.FieryBloodDrop", 1L, 0), GTPP_Bees.drop.getStackForType(GTPP_DropType.HYDRA), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.HV); - addCentrifugeToItemStack(GTPP_CombType.URGHAST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), GT_ModHandler.getModItem(MOD_ID_DC, "item.CarminiteChip", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CarminiteFragment", 1L, 0), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.EV); - addCentrifugeToItemStack(GTPP_CombType.SNOWQUEEN, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), GT_ModHandler.getModItem(MOD_ID_DC, "item.SnowQueenBloodDrop", 1L, 0), GTPP_Bees.drop.getStackForType(GTPP_DropType.SNOW_QUEEN), ItemList.FR_Wax.get(1)}, new int[]{5 * 100, 33 * 100, 8 * 100, 30 * 100}, Voltage.EV); - - // HEE - addCentrifugeToItemStack(GTPP_CombType.ENDDUST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.End), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO), }, new int[]{20 * 100, 15 * 100, 10 * 100}, Voltage.HV); - addCentrifugeToItemStack(GTPP_CombType.STARDUST, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Stardust), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{20 * 100, 15 * 100, 10 * 100}, Voltage.HV); - addCentrifugeToItemStack(GTPP_CombType.ECTOPLASMA, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Ectoplasma), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{25 * 100, 10 * 100, 15 * 100}, Voltage.EV); - addCentrifugeToItemStack(GTPP_CombType.ARCANESHARD, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Arcaneshard), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{25 * 100, 10 * 100, 15 * 100}, Voltage.EV); - addCentrifugeToItemStack(GTPP_CombType.DRAGONESSENCE, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Dragonessence), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{30 * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV); - addCentrifugeToItemStack(GTPP_CombType.ENDERMAN, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Enderman), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{3000, 750, 2000}, Voltage.IV); - addCentrifugeToItemStack(GTPP_CombType.SILVERFISH, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Silverfish), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO), new ItemStack(Items.spawn_egg, 1,60) }, new int[]{25 * 100, 10 * 100, 20 * 100, 15 * 100}, Voltage.EV); - addProcessGT(GTPP_CombType.ENDIUM,new Materials[] {Materials.HeeEndium}, Voltage.HV); - if(!GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(GTPP_CombType.ENDIUM,new Materials[] {Materials.HeeEndium}, new int[] {50 * 100}, new int[] {}, Voltage.HV, GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), 20 * 100); - } - addCentrifugeToItemStack(GTPP_CombType.RUNEI, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfPowerFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfAgilityFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfVigorFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfDefenseFragment", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfMagicFragment", 1L, 0) }, new int[]{25 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100, 5 * 100}, Voltage.IV); - addCentrifugeToItemStack(GTPP_CombType.RUNEII, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.RuneOfVoidFragment", 1L, 0) }, new int[]{50 * 100, (int) (2.5 * 100)}, Voltage.IV); - addCentrifugeToItemStack(GTPP_CombType.FIREESSENSE, new ItemStack[] { GT_ModHandler.getModItem("MagicBees", "wax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.Fireessence), GTPP_Bees.drop.getStackForType(GTPP_DropType.ENDERGOO) }, new int[]{30 * 100, (int) (7.5 * 100), 20 * 100}, Voltage.IV); - //Space Line - addCentrifugeToItemStack(GTPP_CombType.SPACE, new ItemStack[] { ItemList.FR_Wax.get(1L), ItemList.FR_RefractoryWax.get(1L), GTPP_Bees.drop.getStackForType(GTPP_DropType.OXYGEN), GT_ModHandler.getModItem(MOD_ID_DC, "item.CoinSpace", 1L, 0)}, new int[]{50 * 100, 30 * 100, 15 * 100, 5 * 100}, Voltage.HV); - addProcessGT(GTPP_CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron, Materials.Iron}, Voltage.HV); - addProcessGT(GTPP_CombType.DESH, new Materials[] {Materials.Desh, Materials.Titanium}, Voltage.EV); - addProcessGT(GTPP_CombType.LEDOX, new Materials[] {Materials.Ledox, Materials.CallistoIce, Materials.Lead}, Voltage.EV); - addProcessGT(GTPP_CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce, Materials.Ledox, Materials.Lead}, Voltage.IV); - addProcessGT(GTPP_CombType.MYTRYL, new Materials[] {Materials.Mytryl, Materials.Mithril}, Voltage.IV); - addProcessGT(GTPP_CombType.QUANTIUM, new Materials[] {Materials.Quantium, Materials.Osmium}, Voltage.IV); - addProcessGT(GTPP_CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon, Materials.Lead}, Voltage.IV); - addProcessGT(GTPP_CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal, Materials.Emerald}, Voltage.LUV); - addCentrifugeToMaterial(GTPP_CombType.MYSTERIOUSCRYSTAL, new Materials[] {Materials.MysteriousCrystal, Materials.Emerald}, new int[] {(GT_Mod.gregtechproxy.mNerfedCombs ? 10 : 40) * 100, (GT_Mod.gregtechproxy.mNerfedCombs ? 15 : 50) * 100}, new int[] {}, Voltage.LUV, 512, NI, 50 * 100); - addProcessGT(GTPP_CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium, Materials.Plutonium}, Voltage.LUV); - addProcessGT(GTPP_CombType.TRINIUM, new Materials[] {Materials.Trinium, Materials.Iridium}, Voltage.ZPM); - if(!GT_Mod.gregtechproxy.mNerfedCombs) { - addCentrifugeToMaterial(GTPP_CombType.METEORICIRON, new Materials[] {Materials.MeteoricIron, Materials.Iron}, new int[] {85 * 100, 100 * 100}, new int[] {}, Voltage.HV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.DESH, new Materials[] {Materials.Desh, Materials.Titanium}, new int[] {75 * 100, 50 * 100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.LEDOX, new Materials[] {Materials.Ledox, Materials.CallistoIce, Materials.Lead}, new int[] {65 * 100, 55 * 100, 85 *100}, new int[] {}, Voltage.EV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.CALLISTOICE, new Materials[] {Materials.CallistoIce, Materials.Ledox, Materials.Lead}, new int[] {65 * 100, 75 * 100, 100 *100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.MYTRYL, new Materials[] {Materials.Mytryl, Materials.Mithril}, new int[] {55 * 100, 50 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.QUANTIUM, new Materials[] {Materials.Quantium, Materials.Osmium}, new int[] {50 * 100, 60 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.ORIHARUKON, new Materials[] {Materials.Oriharukon, Materials.Lead}, new int[] {50 * 100, 75 * 100}, new int[] {}, Voltage.IV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.BLACKPLUTONIUM, new Materials[] {Materials.BlackPlutonium, Materials.Plutonium}, new int[] {25 * 100, 50 * 100}, new int[] {}, Voltage.LUV, NI, 30 * 100); - addCentrifugeToMaterial(GTPP_CombType.TRINIUM, new Materials[] {Materials.Trinium, Materials.Iridium}, new int[] {35 * 100, 45 * 100}, new int[] {}, Voltage.ZPM, NI, 30 * 100); - } - - //Planet Line - addCentrifugeToItemStack(GTPP_CombType.MOON, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MoonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.MV, 300); - addCentrifugeToItemStack(GTPP_CombType.MARS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MarsStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.HV, 300); - addCentrifugeToItemStack(GTPP_CombType.JUPITER, new ItemStack[] { GT_ModHandler.getModItem(MOD_ID_DC, "item.IoStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.EuropaIceDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.EuropaStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.GanymedeStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CallistoStoneDust", 1L, 0), GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.CallistoIce, 1L), ItemList.FR_Wax.get(1L)}, new int[]{30 * 100, 30 * 100, 30 * 100, 30 * 100, 30 * 100, 5 * 100, 50 * 100 }, Voltage.HV, 300); - addCentrifugeToItemStack(GTPP_CombType.MERCURY, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MercuryCoreDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.MercuryStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.EV, 300); - addCentrifugeToItemStack(GTPP_CombType.VENUS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.VenusStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.EV, 300); - addCentrifugeToItemStack(GTPP_CombType.SATURN, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.EnceladusStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.TitanStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); - addCentrifugeToItemStack(GTPP_CombType.URANUS, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MirandaStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.OberonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); - addCentrifugeToItemStack(GTPP_CombType.NEPTUN, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.ProteusStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.TritonStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.IV, 300); - addCentrifugeToItemStack(GTPP_CombType.PLUTO, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.PlutoStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.PlutoIceDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.LUV, 300); - addCentrifugeToItemStack(GTPP_CombType.HAUMEA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.HaumeaStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.LUV, 300); - addCentrifugeToItemStack(GTPP_CombType.MAKEMAKE, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.MakeMakeStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.LUV, 300); - addCentrifugeToItemStack(GTPP_CombType.CENTAURI, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.CentauriASurfaceDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.CentauriAStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.ZPM, 300); - addCentrifugeToItemStack(GTPP_CombType.TCETI, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.TCetiEStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.ZPM, 300); - addCentrifugeToItemStack(GTPP_CombType.BARNARDA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.BarnardaEStoneDust", 1L, 0), GT_ModHandler.getModItem(MOD_ID_DC, "item.BarnardaFStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100, 30 * 100 }, Voltage.ZPM, 300); - addCentrifugeToItemStack(GTPP_CombType.VEGA, new ItemStack[] {ItemList.FR_Wax.get(1L), GT_ModHandler.getModItem(MOD_ID_DC, "item.VegaBStoneDust", 1L, 0)}, new int[]{50 * 100, 30 * 100 }, Voltage.ZPM, 300); - - //Infinity Line - addCentrifugeToMaterial(GTPP_CombType.COSMICNEUTRONIUM, new Materials[] {Materials.CosmicNeutronium, Materials.Neutronium}, new int[] {(int) (0.5 * 100), 1 * 100}, new int[] {}, Voltage.UHV, 12000, NI, 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.INFINITYCATALYST, new Materials[] {Materials.InfinityCatalyst, Materials.Neutronium}, new int[] {(int) (0.05 * 100), 1 * 100}, new int[] {}, Voltage.UEV, 48000, NI, 50 * 100); - addCentrifugeToMaterial(GTPP_CombType.INFINITY, new Materials[] {Materials.Infinity, Materials.InfinityCatalyst}, new int[] {(int) (0.01 * 100), (int) (0.05 * 100)}, new int[] {}, Voltage.UIV, 96000, NI, 50 * 100); + 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; + **/ + 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 + * + * @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); + **/ + 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. - * **/ + * 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) { + 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); + 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" - **/ + * 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]; + 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) { + 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 { + 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) { + if (beeWax != NI) { aOutPut[aOutPut.length - 1] = beeWax; - }else { + } + 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. + * @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 Product = new ImmutableMap.Builder(); - for(int i=0; i < aItem.length; i++) { - if(aItem[i] == NI) { continue; } - Product.put(aItem[i],chance[i]/10000.0f); + Builder Product = new ImmutableMap.Builder(); + 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) { + if (volt.compareTo(Voltage.MV) < 0 || !GT_Mod.gregtechproxy.mNerfedCombs) { RecipeManagers.centrifugeManager.addRecipe(40, tComb, Product.build()); } - + aItem = Arrays.copyOf(aItem, 6); - if(aItem.length > 6) { + if (aItem.length > 6) { chance = Arrays.copyOf(chance, 6); } 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; + 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**/ + /** + * @return aEU/t needed for chemical and autoclave process related to + * the Tier + **/ public int getChemicalEnergy() { - return this.getVoltage()*3/4; + return this.getVoltage() * 3 / 4; } public int getAutoClaveEnergy() { - return (int) ((this.getVoltage()*3/4) * (Math.max(1, Math.pow(2, 5 - this.ordinal())))); + 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**/ + /** + * @return FluidStack needed for chemical process related to the Tier + **/ public FluidStack getComplexChemical() { - if(this.compareTo(Voltage.MV) < 0) { + if (this.compareTo(Voltage.MV) < 0) { return Materials.Water.getFluid((this.compareTo(Voltage.ULV) > 0) ? 1000 : 500); - }else if(this.compareTo(Voltage.HV) < 0) { + } + else if (this.compareTo(Voltage.HV) < 0) { return GT_ModHandler.getDistilledWater(1000L); - }else if(this.compareTo(Voltage.LUV) < 0) { + } + 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) { + } + else if (this.compareTo(Voltage.UHV) < 0) { return FluidRegistry.getFluidStack("mutagen", (int) (Math.pow(2, this.compareTo(Voltage.LUV)) * L)); - }else { + } + else { return NF; } } - /**@return additional required UU-Matter amount for Autoclave process related to the Tier**/ + /** + * @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 9 * ((this.compareTo(Voltage.MV) < 0) ? 1 : this.compareTo(Voltage.MV)); } - /**@return duration needed for Chemical process related to the Tier**/ + /** @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**/ + /** + * @return duration needed for Centrifuge process related to the Tier + **/ public int getSimpleTime() { - if(!GT_Mod.gregtechproxy.mNerfedCombs) { + 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 + } + 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**/ + /** @return aEU/t needed for Centrifuge process related to the Tier **/ public int getSimpleEnergy() { - if(this == Voltage.ULV) { + if (this == Voltage.ULV) { return 5; - }else { + } + else { return (int) (this.getVoltage() / 16) * 15; } } 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 3cd65969d8..3450c49570 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 @@ -1,30 +1,24 @@ package gtPlusPlus.xmod.forestry.bees.items.output; -import static gregtech.api.enums.GT_Values.MOD_ID_DC; - import java.util.List; -import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.Tabs; -import forestry.api.recipes.RecipeManagers; import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; -import gregtech.api.util.GT_ModHandler; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.ELEMENT.STANDALONE; import gtPlusPlus.xmod.forestry.bees.handler.GTPP_DropType; 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; import net.minecraftforge.fluids.FluidStack; public class GTPP_Drop extends Item { - + @SideOnly(Side.CLIENT) private IIcon secondIcon; @@ -37,18 +31,18 @@ public class GTPP_Drop extends Item { } public ItemStack getStackForType(GTPP_DropType type) { - return new ItemStack(this, 1, type.ordinal()); + return new ItemStack(this, 1, type.mID); } public ItemStack getStackForType(GTPP_DropType type, int count) { - return new ItemStack(this, count, type.ordinal()); + return new ItemStack(this, count, type.mID); } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List list) { for (GTPP_DropType type : GTPP_DropType.values()) { - if (type.showInList) { + if (type.mShowInList) { list.add(this.getStackForType(type)); } } @@ -66,7 +60,7 @@ public class GTPP_Drop extends Item { } @Override - @SideOnly(Side.CLIENT) + @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon("forestry:honeyDrop.0"); this.secondIcon = par1IconRegister.registerIcon("forestry:honeyDrop.1"); @@ -80,11 +74,10 @@ public class GTPP_Drop extends Item { @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int pass) { - int meta = Math.max(0, Math.min(GTPP_DropType.values().length - 1, stack.getItemDamage())); - int colour = GTPP_DropType.values()[meta].getColours()[0]; + int colour = GTPP_DropType.get(stack.getItemDamage()).getColours()[0]; if (pass >= 1) { - colour = GTPP_DropType.values()[meta].getColours()[1]; + colour = GTPP_DropType.get(stack.getItemDamage()).getColours()[1]; } return colour; @@ -92,33 +85,13 @@ public class GTPP_Drop extends Item { @Override public String getItemStackDisplayName(ItemStack stack) { - return GTPP_DropType.values()[stack.getItemDamage()].getName(); + return GTPP_DropType.get(stack.getItemDamage()).getName(); } public void initDropsRecipes() { ItemStack tDrop; - tDrop = getStackForType(GTPP_DropType.OIL); - addProcessLV(tDrop, Materials.OilHeavy.getFluid(100L), GT_ModHandler.getModItem("Forestry", "propolis", 1L, 0), 3000, 8); - RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, Materials.OilHeavy.getFluid(100L), GT_ModHandler.getModItem("Forestry", "propolis", 1L, 0), 30); - tDrop = getStackForType(GTPP_DropType.COOLANT); - addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 0), 3000, 8); - RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 0), 30); - tDrop = getStackForType(GTPP_DropType.HOT_COOLANT); - addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("ic2hotcoolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 3000, 8); - RecipeManagers.squeezerManager.addRecipe(40, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2hotcoolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 30); - tDrop = getStackForType(GTPP_DropType.SNOW_QUEEN); - addProcessMV(tDrop, Materials.FierySteel.getFluid(200L), GT_ModHandler.getModItem(MOD_ID_DC, "SnowQueenBloodDrop", 1L, 0), 1500, 48); - tDrop = getStackForType(GTPP_DropType.LAPIS); - addProcessLV(tDrop,new FluidStack(FluidRegistry.getFluid("ic2coolant"), 200), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), 5000, 1200,2); - RecipeManagers.squeezerManager.addRecipe(400, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 3), 30); - tDrop = getStackForType(GTPP_DropType.HYDRA); - addProcessMV(tDrop, Materials.FierySteel.getFluid(50L), GT_ModHandler.getModItem("MagicBees", "propolis", 1L, 2), 3000, 8); - tDrop = getStackForType(GTPP_DropType.OXYGEN); - addProcessLV(tDrop, new FluidStack(FluidRegistry.getFluid("liquidoxygen"), 100), GT_ModHandler.getModItem("ExtraBees", "propolis", 1L, 2), 250, 1200,8); - RecipeManagers.squeezerManager.addRecipe(400, new ItemStack[]{tDrop}, new FluidStack(FluidRegistry.getFluid("ic2coolant"), 100), GT_ModHandler.getModItem("ExtraBees", "propolis", 1L, 2), 30); - tDrop = getStackForType(GTPP_DropType.ENDERGOO); - if ( Loader.isModLoaded("HardcoreEnderExpansion")) - addProcessHV(tDrop, new FluidStack(FluidRegistry.getFluid("endergoo"), 500), GT_Values.NI ,1000); + tDrop = getStackForType(GTPP_DropType.DRAGONBLOOD); + addProcessHV(tDrop, new FluidStack(STANDALONE.DRAGON_METAL.getFluid(), 4), GT_Values.NI, 1000); } public void addProcessLV(ItemStack tDrop, FluidStack aOutput, ItemStack aOutput2, int aChance, int aEUt) { diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java index f7766b2aff..9d13ca7ebd 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/items/output/GTPP_Pollen.java @@ -28,18 +28,18 @@ public class GTPP_Pollen extends Item { } public ItemStack getStackForType(GTPP_PollenType type) { - return new ItemStack(this, 1, type.ordinal()); + return new ItemStack(this, 1, type.mID); } public ItemStack getStackForType(GTPP_PollenType type, int count) { - return new ItemStack(this, count, type.ordinal()); + return new ItemStack(this, count, type.mID); } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List list) { for (GTPP_PollenType type : GTPP_PollenType.values()) { - if (type.showInList) { + if (type.mShowInList) { list.add(this.getStackForType(type)); } } @@ -71,11 +71,10 @@ public class GTPP_Pollen extends Item { @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int pass) { - int meta = Math.max(0, Math.min(GTPP_PollenType.values().length - 1, stack.getItemDamage())); - int colour = GTPP_PollenType.values()[meta].getColours()[0]; + int colour = GTPP_PollenType.get(stack.getItemDamage()).getColours()[0]; if (pass >= 1) { - colour = GTPP_PollenType.values()[meta].getColours()[1]; + colour = GTPP_PollenType.get(stack.getItemDamage()).getColours()[1]; } return colour; @@ -83,7 +82,7 @@ public class GTPP_Pollen extends Item { @Override public String getItemStackDisplayName(ItemStack stack) { - return GTPP_PollenType.values()[stack.getItemDamage()].getName(); + return GTPP_PollenType.get(stack.getItemDamage()).getName(); } 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 279c6b92fc..8d61801d20 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 @@ -1,16 +1,13 @@ package gtPlusPlus.xmod.forestry.bees.items.output; -import static gregtech.api.enums.GT_Values.MOD_ID_DC; - import java.util.List; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.Tabs; -import gregtech.api.enums.*; +import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.forestry.bees.handler.GTPP_PropolisType; import net.minecraft.client.renderer.texture.IIconRegister; @@ -34,18 +31,18 @@ public class GTPP_Propolis extends Item { } public ItemStack getStackForType(GTPP_PropolisType type) { - return new ItemStack(this, 1, type.ordinal()); + return new ItemStack(this, 1, type.mID); } public ItemStack getStackForType(GTPP_PropolisType type, int count) { - return new ItemStack(this, count, type.ordinal()); + return new ItemStack(this, count, type.mID); } @Override @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs tabs, List list) { for (GTPP_PropolisType type : GTPP_PropolisType.values()) { - if (type.showInList) { + if (type.mShowInList) { list.add(this.getStackForType(type)); } } @@ -66,35 +63,20 @@ public class GTPP_Propolis extends Item { @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack stack, int pass) { - int meta = Math.max(0, Math.min(GTPP_PropolisType.values().length - 1, stack.getItemDamage())); - return GTPP_PropolisType.values()[meta].getColours(); + return GTPP_PropolisType.get(stack.getItemDamage()).getColours(); } @Override public String getItemStackDisplayName(ItemStack stack) { - return GTPP_PropolisType.values()[stack.getItemDamage()].getName(); + return GTPP_PropolisType.get(stack.getItemDamage()).getName(); } + public void initPropolisRecipes() { ItemStack tPropolis; - tPropolis = getStackForType(GTPP_PropolisType.End); - addProcessHV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "end_powder", 1, 0)); - tPropolis = getStackForType(GTPP_PropolisType.Stardust); - addProcessHV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "stardust", 1, 0)); - tPropolis = getStackForType(GTPP_PropolisType.Ectoplasma); - addProcessEV(tPropolis, GT_ModHandler.getModItem(MOD_ID_DC, "item.EctoplasmaChip", 1, 0)); - tPropolis = getStackForType(GTPP_PropolisType.Arcaneshard); - addProcessEV(tPropolis, GT_ModHandler.getModItem(MOD_ID_DC, "item.ArcaneShardChip", 1, 0)); - tPropolis = getStackForType(GTPP_PropolisType.Dragonessence); + + tPropolis = getStackForType(GTPP_PropolisType.DRAGONBLOOD); addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 0)); - tPropolis = getStackForType(GTPP_PropolisType.Enderman); - addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "enderman_head", 1, 0)); - tPropolis = getStackForType(GTPP_PropolisType.Silverfish); - addProcessEV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "silverfish_blood", 1, 0)); - tPropolis = getStackForType(GTPP_PropolisType.Endium); - addProcessHV(tPropolis, GT_OreDictUnificator.get(OrePrefixes.dustSmall, Materials.HeeEndium, 1)); - tPropolis = getStackForType(GTPP_PropolisType.Fireessence); - addProcessIV(tPropolis, GT_ModHandler.getModItem("HardcoreEnderExpansion", "essence", 16, 1)); //addRecipe(tDrop, aOutput, aOutput2, aChance, aDuration, aEUt); } diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java new file mode 100644 index 0000000000..222b1215eb --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_AlleleBeeSpecies.java @@ -0,0 +1,40 @@ +package gtPlusPlus.xmod.forestry.bees.registry; + +import forestry.api.apiculture.EnumBeeChromosome; +import forestry.api.apiculture.IAlleleBeeSpeciesCustom; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IClassification; +import forestry.apiculture.genetics.alleles.AlleleBeeSpecies; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + +public class GTPP_AlleleBeeSpecies extends AlleleBeeSpecies { + + public GTPP_AlleleBeeSpecies(String uid, boolean dominant, String unlocalizedName, String authority, String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor) { + super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial, primaryColor, secondaryColor); + AlleleManager.alleleRegistry.registerAllele(this, EnumBeeChromosome.SPECIES); + } + + @Override + public IAlleleBeeSpeciesCustom addProduct(ItemStack product, Float chance) { + if (product == null || product.getItem() == null) { + product = new ItemStack(Items.boat); + } + if (chance <= 0.0f || chance > 1.0f) { + chance = 0.1f; + } + return super.addProduct(product, chance); + } + + @Override + public IAlleleBeeSpeciesCustom addSpecialty(ItemStack specialty, Float chance) { + if (specialty == null || specialty.getItem() == null) { + specialty = new ItemStack(Items.boat); + } + if (chance <= 0.0f || chance > 1.0f) { + chance = 0.1f; + } + return super.addSpecialty(specialty, chance); + } + +} 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 ca11b00cff..7fcf4bf98f 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 @@ -2,20 +2,14 @@ package gtPlusPlus.xmod.forestry.bees.registry; import static forestry.api.apiculture.EnumBeeChromosome.*; import static forestry.api.core.EnumHumidity.ARID; -import static forestry.api.core.EnumHumidity.DAMP; -import static forestry.api.core.EnumTemperature.*; -import java.awt.Color; import java.lang.reflect.Field; import java.util.Arrays; import java.util.Locale; import java.util.function.Consumer; -import org.apache.commons.lang3.reflect.FieldUtils; import org.apache.commons.lang3.text.WordUtils; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.apiculture.*; import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; @@ -23,166 +17,82 @@ import forestry.api.genetics.*; import forestry.apiculture.genetics.*; import forestry.apiculture.genetics.alleles.AlleleEffect; import forestry.core.genetics.alleles.AlleleHelper; -import forestry.core.genetics.alleles.EnumAllele.*; -import gregtech.api.GregTech_API; +import forestry.core.genetics.alleles.EnumAllele.Lifespan; +import forestry.core.genetics.alleles.EnumAllele.Tolerance; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_ModHandler; -import gregtech.common.bees.GT_AlleleBeeSpecies; -import gregtech.common.bees.GT_Bee_Mutation; import gregtech.common.items.CombType; -import gregtech.loaders.misc.GT_BeeDefinition; -import gregtech.loaders.misc.GT_BranchDefinition; +import gregtech.loaders.misc.GT_Bees; +import gtPlusPlus.core.material.ELEMENT.STANDALONE; +import gtPlusPlus.core.util.Utils; 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 { - DIVIDED(GT_BranchDefinition.THAUMIC, "Unstable", true, new Color(0xF0F0F0), new Color(0xDCDCDC), - beeSpecies -> { - beeSpecies.addProduct(GT_ModHandler.getModItem("ExtraBees", "honeyComb", 1, 61), 0.20f); - beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(CombType.DIVIDED), 0.125f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(EnumTemperature.NORMAL); - beeSpecies.setHasEffect(); - }, - template -> { - AlleleHelper.instance.set(template, SPEED, Speed.SLOWER); - AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORT); - AlleleHelper.instance.set(template, FLOWERING, Flowering.SLOW); - AlleleHelper.instance.set(template, NOCTURNAL, true); - }, - dis -> { - IBeeMutationCustom tMutation = dis.registerMutation(DIAMOND, IRON, 3); - if (Loader.isModLoaded("ExtraUtilities")) - tMutation.requireResource(GameRegistry.findBlock("ExtraUtilities", "decorativeBlock1"), 5); - } - ), - NEUTRONIUM(GT_BranchDefinition.RADIOACTIVE, "Neutronium", false, new Color(0xFFF0F0), new Color(0xFAFAFA), - beeSpecies -> { - beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.NEUTRONIUM), 0.0001f); - beeSpecies.setHumidity(DAMP); - beeSpecies.setTemperature(HELLISH); - beeSpecies.setHasEffect(); - }, - template -> { - AlleleHelper.instance.set(template, SPEED, Speed.SLOWEST); - AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGEST); - AlleleHelper.instance.set(template, NOCTURNAL, true); - }, - dis -> { - IMutationCustom tMutation = dis.registerMutation(NAQUADRIA, AMERICIUM, 1, 2).setIsSecret(); - tMutation.requireResource(GregTech_API.sBlockMetal5, 2); - } - ), - DRAGONESSENCE(GT_BranchDefinition.HEE, "Dragonessence", true, new Color(0xFFA12B), new Color(0x911ECE), + DRAGONBLOOD(GTPP_BranchDefinition.LEGENDARY, "Dragon Blood", 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(CombType.DRAGONESSENCE), 0.10f); + beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(GTPP_CombType.DRAGONBLOOD), 0.10f); beeSpecies.setHumidity(ARID); beeSpecies.setTemperature(EnumTemperature.NORMAL); beeSpecies.setHasEffect(); }, template -> { AlleleHelper.instance.set(template, LIFESPAN, Lifespan.LONGER); - AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectBeatific); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectAggressive); AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_3); AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_3); }, dis -> { - IBeeMutationCustom tMutation = dis.registerMutation(GT_BeeDefinition.ECTOPLASMA, GT_BeeDefinition.ARCANESHARDS, 4); + IBeeMutationCustom tMutation = dis.registerMutation("DRAGONESSENCE", "NEUTRONIUM", 2); tMutation.restrictHumidity(ARID); - if (Loader.isModLoaded("HardcoreEnderExpansion")) - tMutation.requireResource(GameRegistry.findBlock("HardcoreEnderExpansion", "essence_altar"), 1); - tMutation.addMutationCondition(new GTPP_Bees.DimensionMutationCondition(1, "End"));//End Dim + tMutation.requireResource(STANDALONE.DRAGON_METAL.getBlock(), 1); + tMutation.addMutationCondition(new GT_Bees.DimensionMutationCondition(1, "End"));//End Dim } ), - TRINIUM(GT_BranchDefinition.SPACE, "Trinium", false, new Color(0xB0E0E6), new Color(0xC8C8D2), + FORCE(GTPP_BranchDefinition.LEGENDARY, "Force", true, Utils.rgbtoHexValue(250, 250, 20), Utils.rgbtoHexValue(200, 200, 5), beeSpecies -> { - beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.TRINIUM), 0.75f); - beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(CombType.QUANTIUM), 0.10f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.STONE), 0.30f); + beeSpecies.addProduct(GT_Bees.combs.getStackForType(CombType.SALT), 0.15f); + beeSpecies.addSpecialty(GTPP_Bees.combs.getStackForType(GTPP_CombType.FORCE), 0.10f); beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(COLD); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - }, - template -> AlleleHelper.instance.set(template, SPEED, GTPP_Bees.speedBlinding), - new Consumer() { - @Override - public void accept(GTPP_BeeDefinition dis) { - IBeeMutationCustom tMutation = dis.registerMutation(ENCELADUS, IRIDIUM, 4); - tMutation.requireResource(GregTech_API.sBlockMetal4, 9); - tMutation.addMutationCondition(new GTPP_Bees.DimensionMutationCondition(41, "Enceladus"));//Enceladus Dim - } - } - ), - - //Infinity Line - COSMICNEUTRONIUM(GT_BranchDefinition.PLANET, "CosmicNeutronium", false, new Color(0x484848), new Color(0x323232), - beeSpecies -> { - beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.COSMICNEUTRONIUM), 0.25f); - beeSpecies.setHumidity(DAMP); - beeSpecies.setTemperature(ICY); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - }, - template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), - dis -> { - IBeeMutationCustom tMutation = dis.registerMutation(NEUTRONIUM, BARNARDAF, 7, 10); - if (Loader.isModLoaded("Avaritia")) - tMutation.requireResource(GameRegistry.findBlock("Avaritia", "Resource_Block"), 0); - } - ), - INFINITYCATALYST(GT_BranchDefinition.PLANET, "InfinityCatalyst", false, new Color(0xFFFFFF), new Color(0xFFFFFF), - beeSpecies -> { - beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.INFINITYCATALYST), 0.0000005f); - beeSpecies.setHumidity(DAMP); - beeSpecies.setTemperature(HELLISH); - beeSpecies.setNocturnal(); + beeSpecies.setTemperature(EnumTemperature.HOT); beeSpecies.setHasEffect(); }, template -> { - AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST); - AlleleHelper.instance.set(template, EFFECT, getEffect(EXTRABEES, "blindness")); + AlleleHelper.instance.set(template, LIFESPAN, Lifespan.NORMAL); + AlleleHelper.instance.set(template, EFFECT, AlleleEffect.effectAggressive); + AlleleHelper.instance.set(template, TEMPERATURE_TOLERANCE, Tolerance.BOTH_1); + AlleleHelper.instance.set(template, HUMIDITY_TOLERANCE, Tolerance.BOTH_1); }, dis -> { - IMutationCustom tMutation = dis.registerMutation(DOB, COSMICNEUTRONIUM, 3, 10).setIsSecret(); - if (Loader.isModLoaded("Avaritia")) - tMutation.requireResource(GameRegistry.findBlock("Avaritia", "Resource_Block"), 1); - } - ), - INFINITY(GT_BranchDefinition.PLANET, "Infinity", false, new Color(0xFFFFFF), new Color(0xFFFFFF), - beeSpecies -> { - beeSpecies.addProduct(GTPP_Bees.combs.getStackForType(CombType.INFINITY), 0.00000005f); - beeSpecies.setHumidity(EnumHumidity.NORMAL); - beeSpecies.setTemperature(ICY); - beeSpecies.setNocturnal(); - beeSpecies.setHasEffect(); - }, - template -> AlleleHelper.instance.set(template, LIFESPAN, Lifespan.SHORTEST), - dis -> { - IBeeMutationCustom tMutation = dis.registerMutation(INFINITYCATALYST, COSMICNEUTRONIUM, 1, 100); - if (Loader.isModLoaded("avaritiaddons")) - tMutation.requireResource(GameRegistry.findBlock("avaritiaddons", "InfinityChest"), 0); + IBeeMutationCustom tMutation = dis.registerMutation("STEEL", "GOLD", 10); + tMutation.restrictHumidity(ARID); + tMutation.restrictBiomeType(Type.HOT); } ), + ; - private final GT_BranchDefinition branch; - private final GT_AlleleBeeSpecies species; - private final Consumer mSpeciesProperties; + private final GTPP_BranchDefinition branch; + private final GTPP_AlleleBeeSpecies species; + private final Consumer mSpeciesProperties; private final Consumer mAlleles; private final Consumer mMutations; private IAllele[] template; private IBeeGenome genome; - GTPP_BeeDefinition(GT_BranchDefinition branch, + GTPP_BeeDefinition(GTPP_BranchDefinition branch, String binomial, boolean dominant, - Color primary, - Color secondary, - Consumer aSpeciesProperties, + int primary, + int secondary, + Consumer aSpeciesProperties, Consumer aAlleles, Consumer aMutations ) { @@ -190,7 +100,7 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { this.mMutations = aMutations; this.mSpeciesProperties = aSpeciesProperties; String lowercaseName = this.toString().toLowerCase(Locale.ENGLISH); - String species = WordUtils.capitalize(lowercaseName); + String species = WordUtils.capitalize(binomial); String uid = "gtpp.bee.species" + species; String description = "for.description." + species; @@ -198,7 +108,7 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { GT_LanguageManager.addStringLocalization("for.bees.species." + lowercaseName, species, true); this.branch = branch; - this.species = new GT_AlleleBeeSpecies(uid, dominant, name, "GT++", description, branch.getBranch(), binomial, primary, secondary); + this.species = new GTPP_AlleleBeeSpecies(uid, dominant, name, "GT++", description, branch.getBranch(), binomial, primary, secondary); } public static void initBees() { @@ -281,8 +191,8 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { } - protected final void setSpeciesProperties(GT_AlleleBeeSpecies beeSpecies) { - this.mSpeciesProperties.accept(beeSpecies); + protected final void setSpeciesProperties(GTPP_AlleleBeeSpecies species2) { + this.mSpeciesProperties.accept(species2); } protected final void setAlleles(IAllele[] template) { @@ -330,7 +240,7 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { * 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 GT_Bee_Mutation(parent1, parent2, this.getTemplate(), chance, 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) { @@ -373,20 +283,19 @@ public enum GTPP_BeeDefinition implements IBeeDefinition { return new BeeVariation.RainResist(this); } + private static final Class sGtBees = ReflectionUtils.getClass("gregtech.loaders.misc.GT_BeeDefinition"); + public static IAlleleBeeSpecies getGregtechBeeType(String name){ - Class gtBees; try { - Class gtBeeTypes = Class.forName("gregtech.loaders.misc.GT_BeeDefinition"); - Enum gtBeeEnumObject = Enum.valueOf(gtBeeTypes, name); - Field gtBeesField = FieldUtils.getDeclaredField(gtBeeTypes, "species", true); - gtBeesField.setAccessible(true); - ReflectionUtils.makeFieldAccessible(gtBeesField); - Object beeType = gtBeesField.get(gtBeeEnumObject); - return (IAlleleBeeSpecies) beeType; - } - catch (ClassNotFoundException | IllegalArgumentException | IllegalAccessException e) { - e.printStackTrace(); - } - return null; + Enum aBeeObject = ReflectionUtils.getEnum(sGtBees, name); + Field gtBeesField = ReflectionUtils.getField(sGtBees, "species"); + 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_Bee_Mutation.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bee_Mutation.java new file mode 100644 index 0000000000..92a2a9fb30 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_Bee_Mutation.java @@ -0,0 +1,80 @@ +package gtPlusPlus.xmod.forestry.bees.registry; + +import forestry.api.apiculture.*; +import forestry.api.core.IClimateProvider; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IGenome; +import forestry.api.genetics.IMutationCondition; +import forestry.apiculture.genetics.BeeMutation; +import forestry.core.genetics.mutations.Mutation; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import org.apache.commons.lang3.reflect.FieldUtils; + +import java.lang.reflect.Field; +import java.util.List; + + +public class GTPP_Bee_Mutation extends BeeMutation { + + private final float split; + + public GTPP_Bee_Mutation(IAlleleBeeSpecies bee0, IAlleleBeeSpecies bee1, IAllele[] result, int chance, float split) { + super(bee0, bee1, result, chance); + this.split = split; + BeeManager.beeRoot.registerMutation(this); + } + + @Override + public float getBaseChance() { + return super.getBaseChance() / split; + } + + @Override + public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1) { + World world = housing != null ? housing.getWorld() : null; + ChunkCoordinates housingCoordinates = housing != null ? housing.getCoordinates() : null; + int x = housingCoordinates != null ? housingCoordinates.posX : 0; + int y = housingCoordinates != null ? housingCoordinates.posY : 0; + int z = housingCoordinates != null ? housingCoordinates.posZ : 0; + + float processedChance = getBasicChance(world, x, y, z, allele0, allele1, genome0, genome1, housing); + + if (processedChance <= 0f) { + return 0f; + } + + IBeeModifier beeHousingModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); + IBeeModifier beeModeModifier = BeeManager.beeRoot.getBeekeepingMode(world).getBeeModifier(); + + processedChance *= beeHousingModifier.getMutationModifier(genome0, genome1, processedChance); + processedChance *= beeModeModifier.getMutationModifier(genome0, genome1, processedChance); + + return processedChance; + } + + @SuppressWarnings("unchecked") + private float getBasicChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1, IClimateProvider climate) { + float mutationChance = this.getBaseChance(); + List mutationConditions = null; + Field f = FieldUtils.getDeclaredField(Mutation.class, "mutationConditions", true); + if (f == null) + f = FieldUtils.getField(Mutation.class, "mutationConditions", true); + if (f == null) + return mutationChance; + try { + mutationConditions = f.get(this) instanceof List ? (List) f.get(this) : null; + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + + if (mutationConditions != null) + for (IMutationCondition mutationCondition : mutationConditions) { + mutationChance *= mutationCondition.getChance(world, x, y, z, allele0, allele1, genome0, genome1, climate); + if (mutationChance == 0) { + return 0; + } + } + return mutationChance; + } +} 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 35dbb1ded6..68da927a1c 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 @@ -2,8 +2,13 @@ package gtPlusPlus.xmod.forestry.bees.registry; import static gregtech.api.enums.GT_Values.MOD_ID_FR; +import java.util.HashMap; + import cpw.mods.fml.common.Loader; import gregtech.GT_Mod; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.forestry.bees.handler.*; import gtPlusPlus.xmod.forestry.bees.items.output.*; public class GTPP_Bees { @@ -18,9 +23,18 @@ public class GTPP_Bees { public static GTPP_Pollen pollen; public static GTPP_Drop drop; public static GTPP_Comb combs; + + public static HashMap sPropolisMappings = new HashMap(); + public static HashMap sPollenMappings = new HashMap(); + public static HashMap sDropMappings = new HashMap(); + public static HashMap sCombMappings = new HashMap(); public GTPP_Bees() { if (Loader.isModLoaded(MOD_ID_FR) && GT_Mod.gregtechproxy.mGTBees) { + + if (!ReflectionUtils.doesClassExist("gregtech.loaders.misc.GT_BeeDefinition")) { + CORE.crash("Missing gregtech.loaders.misc.GT_BeeDefinition."); + } propolis = new GTPP_Propolis(); pollen = new GTPP_Pollen(); drop = new GTPP_Drop(); diff --git a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java index 36ea72d1d1..3c7630a434 100644 --- a/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java +++ b/src/main/java/gtPlusPlus/xmod/forestry/bees/registry/GTPP_BranchDefinition.java @@ -1,53 +1,40 @@ package gtPlusPlus.xmod.forestry.bees.registry; +import static forestry.api.apiculture.EnumBeeChromosome.*; + +import java.util.Arrays; +import java.util.function.Consumer; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.genetics.IAllele; import forestry.api.genetics.IClassification; import forestry.apiculture.genetics.alleles.AlleleEffect; import forestry.core.genetics.alleles.AlleleHelper; - -import java.util.Arrays; -import java.util.function.Consumer; - -import static forestry.api.apiculture.EnumBeeChromosome.*; -import static forestry.core.genetics.alleles.EnumAllele.*; -import static gtPlusPlus.xmod.forestry.bees.registry.GTPP_BeeDefinition.getEffect; -import static gtPlusPlus.xmod.forestry.bees.registry.GTPP_BeeDefinition.getFlowers; -import static gtPlusPlus.xmod.forestry.bees.registry.GTPP_Bees.EXTRABEES; +import forestry.core.genetics.alleles.EnumAllele.*; public enum GTPP_BranchDefinition { - HEE("Finis Expansiones", alleles -> { + LEGENDARY("gtpp.legendary", "Summa Potestas", alleles -> { AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.BOTH_2); AlleleHelper.instance.set(alleles, HUMIDITY_TOLERANCE, Tolerance.BOTH_2); + AlleleHelper.instance.set(alleles, TOLERANT_FLYER, true); AlleleHelper.instance.set(alleles, NOCTURNAL, true); - AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "book")); + AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, Flowers.END); AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.SHORT); AlleleHelper.instance.set(alleles, FLOWERING, Flowering.SLOW); AlleleHelper.instance.set(alleles, SPEED, Speed.FASTEST); AlleleHelper.instance.set(alleles, TERRITORY, Territory.LARGER); } - ), - SPACE("Cosmicis", alleles -> { - AlleleHelper.instance.set(alleles, TEMPERATURE_TOLERANCE, Tolerance.DOWN_2); - AlleleHelper.instance.set(alleles, TOLERANT_FLYER, true); - AlleleHelper.instance.set(alleles, NOCTURNAL, true); - AlleleHelper.instance.set(alleles, FLOWER_PROVIDER, getFlowers(EXTRABEES, "rock")); - AlleleHelper.instance.set(alleles, FLOWERING, Flowering.FASTEST); - AlleleHelper.instance.set(alleles, LIFESPAN, Lifespan.LONGEST); - AlleleHelper.instance.set(alleles, SPEED, Speed.FAST); - AlleleHelper.instance.set(alleles, TERRITORY, Territory.LARGEST); - } - ), + ) ; private static IAllele[] defaultTemplate; private final IClassification branch; private final Consumer mBranchProperties; - GTPP_BranchDefinition(String scientific, Consumer aBranchProperties) { - this.branch = BeeManager.beeFactory.createBranch(this.name().toLowerCase(), scientific); + GTPP_BranchDefinition(String internal, String scientific, Consumer aBranchProperties) { + this.branch = BeeManager.beeFactory.createBranch(internal.toLowerCase(), scientific); this.mBranchProperties = aBranchProperties; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java index b27cb95ca4..d0682b85e8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java @@ -6,16 +6,13 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Utility; import gregtech.api.util.extensions.ArrayExt; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_InputBus { public GT_MetaTileEntity_SuperBus_Input(int aID, String aName, String aNameRegional, int aTier) { @@ -72,54 +69,10 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In return null; } - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) { - if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.hasInventoryBeenModified()) { - this.fillStacksIntoFirstSlots(); - } - - } - - public void updateSlots() { - for (int i = 0; i < this.mInventory.length; ++i) { - if (this.mInventory[i] != null && this.mInventory[i].stackSize <= 0) { - this.mInventory[i] = null; - } - } - - this.fillStacksIntoFirstSlots(); - } - - protected void fillStacksIntoFirstSlots() { - for (int i = 0; i < this.mInventory.length; ++i) { - for (int j = i + 1; j < this.mInventory.length; ++j) { - if (this.mInventory[j] != null && (this.mInventory[i] == null - || GT_Utility.areStacksEqual(this.mInventory[i], this.mInventory[j]))) { - GT_Utility.moveStackFromSlotAToSlotB((IInventory) this.getBaseMetaTileEntity(), (IInventory) this.getBaseMetaTileEntity(), j, i, (byte) 64, (byte) 1, (byte) 64, (byte) 1); - } - } - } - - } - public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { return aSide == this.getBaseMetaTileEntity().getFrontFacing(); } - public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aSide == this.getBaseMetaTileEntity().getFrontFacing() - && (this.mRecipeMap == null || this.mRecipeMap.containsInput(aStack)); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - } - @Override public String[] getDescription() { String[] aDesc = new String[] { @@ -192,39 +145,4 @@ public class GT_MetaTileEntity_SuperBus_Input extends GT_MetaTileEntity_Hatch_In } - @Override - public int getMaxItemCount() { - // TODO Auto-generated method stub - return super.getMaxItemCount(); - } - - @Override - public int getSizeInventory() { - // TODO Auto-generated method stub - return super.getSizeInventory(); - } - - @Override - public ItemStack getStackInSlot(int aIndex) { - // TODO Auto-generated method stub - return super.getStackInSlot(aIndex); - } - - @Override - public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { - // TODO Auto-generated method stub - return super.canInsertItem(aIndex, aStack, aSide); - } - - @Override - public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { - // TODO Auto-generated method stub - return super.canExtractItem(aIndex, aStack, aSide); - } - - @Override - public ItemStack[] getRealInventory() { - // TODO Auto-generated method stub - return super.getRealInventory(); - } } \ No newline at end of file -- cgit From 3d46d957637c60aeecb59065da2328401f27949d Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sun, 23 Jan 2022 20:07:04 +0000 Subject: Added some bees and shit. Added Force. Updated how GT++ material components get localized. --- src/main/java/gtPlusPlus/api/objects/Logger.java | 6 +- src/main/java/gtPlusPlus/core/item/ModItems.java | 1 + .../core/item/base/BaseItemComponent.java | 43 ++- .../java/gtPlusPlus/core/material/ELEMENT.java | 1 + .../core/util/reflect/ReflectionUtils.java | 9 + .../java/gtPlusPlus/xmod/forestry/HANDLER_FR.java | 2 +- .../xmod/forestry/bees/handler/GTPP_CombType.java | 17 +- .../xmod/forestry/bees/handler/GTPP_DropType.java | 13 +- .../forestry/bees/handler/GTPP_PollenType.java | 10 +- .../forestry/bees/handler/GTPP_PropolisType.java | 13 +- .../xmod/forestry/bees/items/output/GTPP_Comb.java | 233 ++---------- .../xmod/forestry/bees/items/output/GTPP_Drop.java | 36 +- .../forestry/bees/items/output/GTPP_Propolis.java | 34 +- .../forestry/bees/registry/GTPP_BeeDefinition.java | 419 ++++++++++----------- .../xmod/forestry/bees/registry/GTPP_Bees.java | 31 +- .../interfaces/internal/IGregtech_RecipeAdder.java | 4 +- .../xmod/gregtech/recipes/GregtechRecipeAdder.java | 33 +- 17 files changed, 409 insertions(+), 496 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/api/objects/Logger.java b/src/main/java/gtPlusPlus/api/objects/Logger.java index 1a1da6868b..5824c5260d 100644 --- a/src/main/java/gtPlusPlus/api/objects/Logger.java +++ b/src/main/java/gtPlusPlus/api/objects/Logger.java @@ -97,11 +97,7 @@ public class Logger { * Special Logger for Bee related content */ public static void BEES(final String s) { - if (enabled) { - if (CORE_Preloader.DEV_ENVIRONMENT || CORE_Preloader.DEBUG_MODE) { - modLogger.info("[Bees] "+s); - } - } + modLogger.info("[Bees] "+s); } /** * Special Logger for Debugging Bee related content diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index fca4c5d3c6..cf70c56f21 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -536,6 +536,7 @@ public final class ModItems { MaterialGenerator.generate(ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN); MaterialGenerator.generate(ELEMENT.STANDALONE.HYPOGEN); MaterialGenerator.generate(ELEMENT.STANDALONE.CHRONOMATIC_GLASS); + MaterialGenerator.generate(ELEMENT.STANDALONE.FORCE); //Custom Materials that are from Runescape MaterialGenerator.generate(ELEMENT.STANDALONE.BLACK_METAL); diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java index 9ad8ea3feb..1d435e1269 100644 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -1,21 +1,19 @@ package gtPlusPlus.core.item.base; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; -import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.data.StringUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -64,6 +62,9 @@ public class BaseItemComponent extends Item{ //if (componentType != ComponentTypes.DUST) GT_OreDictUnificator.registerOre(componentType.getOreDictName()+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this)); + if (componentType == ComponentTypes.GEAR) { + GT_OreDictUnificator.registerOre("gear"+material.getUnlocalizedName(), ItemUtils.getSimpleStack(this)); + } if (LoadedMods.Thaumcraft) { //ThaumcraftUtils.addAspectToItem(ItemUtils.getSimpleStack(this), TC_Aspect_Wrapper.generate(TC_Aspects.METALLUM.mAspect), 1); if (componentMaterial.isRadioactive) { @@ -161,6 +162,34 @@ public class BaseItemComponent extends Item{ public final String getMaterialName() { return this.materialName; } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + if (componentMaterial == null) { + String aFormattedLangName = componentType.getName(); + if (!aFormattedLangName.startsWith(" ")) { + if (aFormattedLangName.contains("@")) { + String[] aSplit = aFormattedLangName.split("@"); + aFormattedLangName = aSplit[0] + " " + getMaterialName() + " " + aSplit[1]; + } + } + if (aFormattedLangName.equals(componentType.getName())) { + aFormattedLangName = getMaterialName() + aFormattedLangName; + } + return GT_LanguageManager.addStringLocalization(unlocalName, aFormattedLangName); + } + String aFormattedLangName = componentType.getName(); + if (!aFormattedLangName.startsWith(" ")) { + if (aFormattedLangName.contains("@")) { + String[] aSplit = aFormattedLangName.split("@"); + aFormattedLangName = aSplit[0] + " " + componentMaterial.getLocalizedName() + " " + aSplit[1]; + } + } + if (aFormattedLangName.equals(componentType.getName())) { + aFormattedLangName = componentMaterial.getLocalizedName() + aFormattedLangName; + } + return GT_LanguageManager.addStringLocalization(unlocalName, aFormattedLangName); + } @SuppressWarnings({ "unchecked", "rawtypes" }) @Override @@ -509,10 +538,10 @@ public class BaseItemComponent extends Item{ public static enum ComponentTypes { DUST("Dust", " Dust", "dust", OrePrefixes.dust), - DUSTSMALL("DustSmall", " Dust", "dustSmall", OrePrefixes.dustSmall), - DUSTTINY("DustTiny", " Dust", "dustTiny", OrePrefixes.dustTiny), + DUSTSMALL("DustSmall", "Small Pile of@Dust", "dustSmall", OrePrefixes.dustSmall), + DUSTTINY("DustTiny", "Tiny Pile of@Dust", "dustTiny", OrePrefixes.dustTiny), INGOT("Ingot", " Ingot", "ingot", OrePrefixes.ingot), - HOTINGOT("HotIngot", " Hot Ingot", "ingotHot", OrePrefixes.ingotHot), + HOTINGOT("HotIngot", " Hot@Ingot", "ingotHot", OrePrefixes.ingotHot), PLATE("Plate", " Plate", "plate", OrePrefixes.plate), PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble", OrePrefixes.plateDouble), ROD("Rod", " Rod", "stick", OrePrefixes.stick), diff --git a/src/main/java/gtPlusPlus/core/material/ELEMENT.java b/src/main/java/gtPlusPlus/core/material/ELEMENT.java index 01d3fd5330..579fba73f5 100644 --- a/src/main/java/gtPlusPlus/core/material/ELEMENT.java +++ b/src/main/java/gtPlusPlus/core/material/ELEMENT.java @@ -216,6 +216,7 @@ public final class ELEMENT { public static final Material ADVANCED_NITINOL = new Material("Advanced Nitinol", MaterialState.SOLID, TextureSets.ENRICHED.get(), ALLOY.NITINOL_60.getRGB(), 8400, 14377, 40, 51, true, "⚷⚙⚷ Ni4Ti6", 0);//Not a GT Inherited Material public static final Material HYPOGEN = new Material("Hypogen", MaterialState.SOLID, TextureSets.NUCLEAR.get(), new short[]{220, 120, 75, 2}, 12255, 19377, 240, 251, true, "Hy⚶", 0);//Not a GT Inherited Material public static final Material RHUGNOR = new Material("Rhugnor", MaterialState.SOLID, TextureSets.ENRICHED.get(), new short[]{190, 0, 255, 0}, 8750, 14757, 184, 142, true, "Fs⚶", 0);//Not a GT Inherited Material //funeris + public static final Material FORCE = new Material("Force", MaterialState.SOLID, TextureSets.ENRICHED.get(), new short[]{250, 250, 20, 0}, 4550, 6830, 63, 81, true, "Fc⚙", 0);//Not a GT Inherited Material //Runescape materials diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 6ccd19019a..48cdb18d7c 100644 --- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -362,6 +362,15 @@ public class ReflectionUtils { return loaded > 0; } + + public static void loadClass(String aClassName) { + try { + Class.forName(aClassName, true, ReflectionUtils.class.getClassLoader()); + } + catch (ClassNotFoundException e) { + e.printStackTrace(); + } + } 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 Product = new ImmutableMap.Builder(); - 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 mSpeciesProperties; - private final Consumer mAlleles; - private final Consumer mMutations; - private IAllele[] template; - private IBeeGenome genome; - - GTPP_BeeDefinition(GTPP_BranchDefinition branch, - String binomial, - boolean dominant, - int primary, - int secondary, - Consumer aSpeciesProperties, - Consumer aAlleles, - Consumer 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 mSpeciesProperties; + private final Consumer mAlleles; + private final Consumer mMutations; + private IAllele[] template; + private IBeeGenome genome; + + GTPP_BeeDefinition(GTPP_BranchDefinition branch, String binomial, Materials aMat, boolean dominant, int primary, int secondary, Consumer aSpeciesProperties, Consumer aAlleles, Consumer 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 aSpeciesProperties, Consumer aAlleles, Consumer 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 sMaterialMappings = new HashMap(); public static HashMap sPropolisMappings = new HashMap(); public static HashMap sPollenMappings = new HashMap(); public static HashMap sDropMappings = new HashMap(); @@ -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"); + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index dfc1e58975..ce26d14e53 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -316,7 +316,9 @@ public interface IGregtech_RecipeAdder { public boolean addPyrolyseRecipe(ItemStack aInput, FluidStack aFluidInput, int intCircuit, ItemStack aOutput, FluidStack aFluidOutput, int aDuration, int aEUt); - public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt); + + public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt); public boolean addDistilleryRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, ItemStack aSolidOutput, int aDuration, int aEUt, boolean aHidden); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index 2b324fc172..d727da4211 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -1550,15 +1550,32 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt) { + return addExtractorRecipe(aInput, aOutput, 10000, aDuration, aEUt); + } + + @Override + public boolean addExtractorRecipe(ItemStack aInput, ItemStack aOutput, int aChance, int aDuration, int aEUt) { if (aInput != null && aOutput != null) { - if ((aDuration = GregTech_API.sRecipeFile.get("extractor", aInput, aDuration)) <= 0) { - return false; - } else { - GT_Recipe_Map.sExtractorRecipes.addRecipe(true, new ItemStack[]{aInput}, new ItemStack[]{aOutput}, - (Object) null, (FluidStack[]) null, (FluidStack[]) null, aDuration, aEUt, 0); - return true; - } - } else { + GT_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] { + aInput.copy() + }, + new ItemStack[] { + aOutput.copy() + }, + null, + new int[] {aChance}, + null, + null, + aDuration, + aEUt, + 0); + int aSize = GT_Recipe_Map.sExtractorRecipes.mRecipeList.size(); + GT_Recipe_Map.sExtractorRecipes.add(aRecipe); + return GT_Recipe_Map.sExtractorRecipes.mRecipeList.size() > aSize; + } + else { return false; } } -- cgit From 9a25f7d7141def59ba11317a8ac4e3b2f72f24fd Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Wed, 26 Jan 2022 17:29:56 +0000 Subject: Added a way to hide every filled Universal Cell. Minor Locale fix. --- .../java/gtPlusPlus/core/config/ConfigHandler.java | 330 ++++++++------------- .../core/item/base/BaseItemComponent.java | 2 +- src/main/java/gtPlusPlus/core/lib/CORE.java | 1 + .../java/gtPlusPlus/core/proxy/ClientProxy.java | 38 ++- .../xmod/forestry/bees/items/output/GTPP_Comb.java | 2 +- 5 files changed, 160 insertions(+), 213 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java index 382b63e2c3..d89d320da5 100644 --- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java +++ b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java @@ -14,232 +14,160 @@ import net.minecraftforge.common.config.Configuration; public class ConfigHandler { public static void handleConfigFile(final FMLPreInitializationEvent event) { - final Configuration config = new Configuration( - new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); + final Configuration config = new Configuration(new File(event.getModConfigurationDirectory(), "GTplusplus/GTplusplus.cfg")); config.load(); - + // Debug /* DEBUG = config.getBoolean("debugMode", "debug", false, "Enables all sorts of debug logging. (Don't use unless told to, breaks other things.)");*/ - disableEnderIOIntegration = config.getBoolean("disableEnderIO", "debug", false, - "Disables EnderIO Integration."); - disableEnderIOIngotTooltips = config.getBoolean("disableEnderIOIngotTooltips", "debug", false, - "Disables EnderIO Ingot Tooltips. These apparently may cause issues for a very small number of users."); - MACHINE_INFO = config.getBoolean("enableMachineInfoLogging", "debug", false, - "Makes many machines display lots of debug logging."); - showHiddenNEIItems = config.getBoolean("showHiddenNEIItems", "debug", false, - "Makes all items hidden from NEI display."); - dumpItemAndBlockData = config.getBoolean("dumpItemAndBlockData", "debug", false, - "Dumps all GT++ and Toxic Everglade Data to en_US.lang in the config folder. This config option can be used by foreign players to generate blank .lang files, which they can populate with their language of choice."); - - + disableEnderIOIntegration = config.getBoolean("disableEnderIO", "debug", false, "Disables EnderIO Integration."); + disableEnderIOIngotTooltips = config.getBoolean("disableEnderIOIngotTooltips", "debug", false, "Disables EnderIO Ingot Tooltips. These apparently may cause issues for a very small number of users."); + MACHINE_INFO = config.getBoolean("enableMachineInfoLogging", "debug", false, "Makes many machines display lots of debug logging."); + showHiddenNEIItems = config.getBoolean("showHiddenNEIItems", "debug", false, "Makes all items hidden from NEI display."); + dumpItemAndBlockData = config.getBoolean("dumpItemAndBlockData", "debug", false, "Dumps all GT++ and Toxic Everglade Data to en_US.lang in the config folder. This config option can be used by foreign players to generate blank .lang files, which they can populate with their language of choice."); + // Machines - enableThaumcraftShardUnification = config.getBoolean("enableThaumcraftShardUnification", "machines", false, - "Allows the use of TC shards across many recipes by oreDicting them into a common group."); - enableAlternativeBatteryAlloy = config.getBoolean("enableAlternativeBatteryAlloy", "machines", false, - "Adds a non-Antimony using Battery Alloy. Not Balanced at all.."); - disableIC2Recipes = config.getBoolean("disableIC2Recipes", "machines", false, - "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks."); - enableAlternativeDivisionSigilRecipe = config.getBoolean("enableAlternativeDivisionSigilRecipe", "machines", - false, "Utilizes Neutronium instead."); + enableThaumcraftShardUnification = config.getBoolean("enableThaumcraftShardUnification", "machines", false, "Allows the use of TC shards across many recipes by oreDicting them into a common group."); + enableAlternativeBatteryAlloy = config.getBoolean("enableAlternativeBatteryAlloy", "machines", false, "Adds a non-Antimony using Battery Alloy. Not Balanced at all.."); + disableIC2Recipes = config.getBoolean("disableIC2Recipes", "machines", false, "Alkaluscraft Related - Removes IC2 Cables Except glass fibre. Few other Misc Tweaks."); + enableAlternativeDivisionSigilRecipe = config.getBoolean("enableAlternativeDivisionSigilRecipe", "machines", false, "Utilizes Neutronium instead."); boilerSteamPerSecond = config.getInt("boilerSteamPerSecond", "machines", 750, 0, 10000, "Sets the steam per second value in LV,MV,HV boilers (respectively 1x,2x,3x this number for the tiers)"); - - //requireControlCores + + // requireControlCores boolean temp = config.getBoolean("requireControlCores", "machines", true, "Multiblocks Require Control Cores"); - - - - //Circuits - enableCustomCircuits = config.getBoolean("enableCustomCircuits", "gregtech", false, - "Adds custom circuits to expand past the Master Tier. Only really recommended to enable if enableOldGTcircuits is enabled."); - enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false, - "Restores circuits and their recipes from Pre-5.09.28 times."); - + + // Circuits + enableCustomCircuits = config.getBoolean("enableCustomCircuits", "gregtech", false, "Adds custom circuits to expand past the Master Tier. Only really recommended to enable if enableOldGTcircuits is enabled."); + enableOldGTcircuits = config.getBoolean("enableOldGTcircuits", "gregtech", false, "Restores circuits and their recipes from Pre-5.09.28 times."); + // Tools - enableSkookumChoochers = config.getBoolean("enableSkookumChoochers", "gregtech", true, - "Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench."); - enableMultiSizeTools = config.getBoolean("enableMultiSizeTools", "gregtech", true, - "Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available."); - + enableSkookumChoochers = config.getBoolean("enableSkookumChoochers", "gregtech", true, "Adds Custom GT Tools, called Skookum Choochers, functioning as a hard hammer and a wrench."); + enableMultiSizeTools = config.getBoolean("enableMultiSizeTools", "gregtech", true, "Adds Custom GT Shovels and Pickaxes which mine in a 3x3 style. One of each whill be generated for each Gregtech Material which has Dense Plates and Long Rods available."); + // GT-Fixes - enableNitroFix = config.getBoolean("enableNitroFix", "gregtech", false, - "Restores the old Nitro-Diesel recipes."); - enableSulfuricAcidFix = config.getBoolean("enableSulfuricAcidFix", "gregtech", false, - "Adds GT6 recipes for Sulfuric Acid. Should remove all pre-existing recipes."); - enableAnimatedTurbines = config.getBoolean("enableAnimatedTurbines", "gregtech", true, - "Gives GT Gas/Steam turbines animated textures while running."); + enableNitroFix = config.getBoolean("enableNitroFix", "gregtech", false, "Restores the old Nitro-Diesel recipes."); + enableSulfuricAcidFix = config.getBoolean("enableSulfuricAcidFix", "gregtech", false, "Adds GT6 recipes for Sulfuric Acid. Should remove all pre-existing recipes."); + enableAnimatedTurbines = config.getBoolean("enableAnimatedTurbines", "gregtech", true, "Gives GT Gas/Steam turbines animated textures while running."); turbineCutoffBase = config.getInt("turbineCutoffBase", "gregtech", 75000, 0, Integer.MAX_VALUE, "Rotors below this durability will be removed, prevents NEI clutter. Minimum Durability is N * x, where N is the new value set and x is the turbine size, where 1 is Tiny and 4 is Huge. Set to 0 to disable."); - - enableHarderRecipesForHighTierCasings = config.getBoolean("enableHarderRecipesForHighTierCasings", "gregtech", false, - "Makes LuV+ Casings and Hulls more difficult to craft."); - + + enableHarderRecipesForHighTierCasings = config.getBoolean("enableHarderRecipesForHighTierCasings", "gregtech", false, "Makes LuV+ Casings and Hulls more difficult to craft."); + // Pipes & Cables - enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true, - "Adds Custom GT Fluid Pipes."); - enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true, - "Adds Custom GT Cables."); - + enableCustom_Pipes = config.getBoolean("enableCustom_Pipes", "gregtech", true, "Adds Custom GT Fluid Pipes."); + enableCustom_Cables = config.getBoolean("enableCustom_Cables", "gregtech", true, "Adds Custom GT Cables."); + // Block Drops - chanceToDropDrainedShard = config.getInt("chanceToDropDrainedShard", "blockdrops", 196, 0, - 10000, "Drained shards have a 1 in X chance to drop."); - chanceToDropFluoriteOre = config.getInt("chanceToDropFluoriteOre", "blockdrops", 32, 0, - 10000, "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone.."); - + chanceToDropDrainedShard = config.getInt("chanceToDropDrainedShard", "blockdrops", 196, 0, 10000, "Drained shards have a 1 in X chance to drop."); + chanceToDropFluoriteOre = config.getInt("chanceToDropFluoriteOre", "blockdrops", 32, 0, 10000, "Fluorite Ore has a 1 in X chance to drop from Limestone and a 1 in X*20 from Sandstone.."); + // Single machines - enableMachine_SolarGenerators = config.getBoolean("enableSolarGenerators", "gregtech", - false, "These may be overpowered, Consult a local electrician."); - enableMachine_ComponentAssemblers = config.getBoolean("enableComponentAssemblers", "gregtech", - true, "These construct machine components."); - enableMachine_Safes = config.getBoolean("enableMachineSafes", "gregtech", true, - "These protect your goodies/rare stuff."); - enableMachine_Dehydrators = config.getBoolean("enableMachineDehydrators", "gregtech", true, - "These dehydrate stuff."); - enableMachine_SteamConverter = config.getBoolean("enableMachineSteamConverter", "gregtech", - true, "Converts IC2 steam -> Railcraft steam."); - enableMachine_FluidTanks = config.getBoolean("enableMachineFluidTanks", "gregtech", true, - "Portable fluid tanks."); - enableMachine_RocketEngines = config.getBoolean("enableMachineRocketEngines", "gregtech", - true, "Diesel egines with different internals, they consume less fuel overall."); - enableMachine_GeothermalEngines = config.getBoolean("enableMachineGeothermalEngines", - "gregtech", true, "These may be overpowered, Consult a local geologist."); - enableMachine_WorldAccelerators = config.getBoolean("enableMachineWorldAccelerators", - "gregtech", true, "These allow boosting Block/TileEntity Tick times [OP]."); - enableMachine_Tesseracts = config.getBoolean("enableMachineTesseracts", - "gregtech", true, "Tesseracts for wireless item/fluid movement."); - enableMachine_SimpleWasher = config.getBoolean("enableMachineSimpleWasher", - "gregtech", true, "Very basic automated cauldron for dust washing."); - enableMachine_Pollution = config.getBoolean("enableMachinePollution", - "gregtech", true, "Pollution Detector & Scrubbers."); - enableMachine_RF_Convetor = config.getBoolean("enableMachineRFConvetor", "gregtech", - true, "Converts RF to GTEU. Requires COFH-Core to be installed."); - - + enableMachine_SolarGenerators = config.getBoolean("enableSolarGenerators", "gregtech", false, "These may be overpowered, Consult a local electrician."); + enableMachine_ComponentAssemblers = config.getBoolean("enableComponentAssemblers", "gregtech", true, "These construct machine components."); + enableMachine_Safes = config.getBoolean("enableMachineSafes", "gregtech", true, "These protect your goodies/rare stuff."); + enableMachine_Dehydrators = config.getBoolean("enableMachineDehydrators", "gregtech", true, "These dehydrate stuff."); + enableMachine_SteamConverter = config.getBoolean("enableMachineSteamConverter", "gregtech", true, "Converts IC2 steam -> Railcraft steam."); + enableMachine_FluidTanks = config.getBoolean("enableMachineFluidTanks", "gregtech", true, "Portable fluid tanks."); + enableMachine_RocketEngines = config.getBoolean("enableMachineRocketEngines", "gregtech", true, "Diesel egines with different internals, they consume less fuel overall."); + enableMachine_GeothermalEngines = config.getBoolean("enableMachineGeothermalEngines", "gregtech", true, "These may be overpowered, Consult a local geologist."); + enableMachine_WorldAccelerators = config.getBoolean("enableMachineWorldAccelerators", "gregtech", true, "These allow boosting Block/TileEntity Tick times [OP]."); + enableMachine_Tesseracts = config.getBoolean("enableMachineTesseracts", "gregtech", true, "Tesseracts for wireless item/fluid movement."); + enableMachine_SimpleWasher = config.getBoolean("enableMachineSimpleWasher", "gregtech", true, "Very basic automated cauldron for dust washing."); + enableMachine_Pollution = config.getBoolean("enableMachinePollution", "gregtech", true, "Pollution Detector & Scrubbers."); + enableMachine_RF_Convetor = config.getBoolean("enableMachineRFConvetor", "gregtech", true, "Converts RF to GTEU. Requires COFH-Core to be installed."); + // Multi machines - enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter", - "gregtech", true, - "Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal."); - enableMultiblock_IndustrialCentrifuge = config - .getBoolean("enableMultiblockIndustrialCentrifuge", "gregtech", true, "Spin, Spin, Spiiiin."); - enableMultiblock_IndustrialCokeOven = config.getBoolean( - "enableMultiblockIndustrialCokeOven", "gregtech", true, - "Pyro Oven Alternative, older, more realistic, better."); - enableMultiblock_IndustrialElectrolyzer = config.getBoolean( - "enableMultiblockIndustrialElectrolyzer", "gregtech", true, - "Electrolyzes things with extra bling factor."); - enableMultiblock_IndustrialMacerationStack = config.getBoolean( - "enableMultiblockIndustrialMacerationStack", "gregtech", true, - "A hyper efficient maceration tower, nets more bonus outputs."); - enableMultiblock_IndustrialPlatePress = config.getBoolean( - "enableMultiblockIndustrialPlatePress", "gregtech", true, "Industrial bendering machine thingo."); - enableMultiblock_IndustrialWireMill = config.getBoolean( - "enableMultiblockIndustrialWireMill", "gregtech", true, "Produces fine wire and exotic cables."); - enableMultiblock_IronBlastFurnace = config.getBoolean("enableMultiblockIronBlastFurnace", - "gregtech", true, "Skip the Bronze age, very slowly."); - enableMultiblock_MatterFabricator = config.getBoolean("enableMultiblockMatterFabricator", - "gregtech", true, "?FAB?RIC?ATE MA?TT?ER."); - enableMultiblock_MultiTank = config.getBoolean("enableMultiblockMultiTank", "gregtech", - true, "Tall tanks, each layer adds extra fluid storage."); - enableMultiblock_PowerSubstation = config.getBoolean("enableMultiblockPowerSubstation", - "gregtech", true, "For managing large power grids."); - enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean( - "enableMultiblockLiquidFluorideThoriumReactor", "gregtech", true, "For supplying large power grids."); - enableMultiblock_NuclearFuelRefinery = config.getBoolean( - "enableMultiblock_NuclearFuelRefinery", "gregtech", true, - "Refines molten chemicals into nuclear fuels."); - enableMultiblock_IndustrialSifter = config.getBoolean("enableMultiblock_IndustrialSifter", - "gregtech", true, "Large scale sifting."); - enableMultiblock_LargeAutoCrafter = config.getBoolean("enableMultiblock_LargeAutoCrafter", - "gregtech", true, "Can Assemble, Disassemble and Craft Project data from Data Sticks."); - enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean("enableMultiblock_IndustrialThermalCentrifuge", - "gregtech", true, "Your warm spin for the ore thing."); - enableMultiblock_IndustrialWashPlant = config.getBoolean("enableMultiblock_IndustrialWashPlant", - "gregtech", true, "Used to wash the dirt, riiiiight offff.."); - enableMultiblock_ThermalBoiler = config.getBoolean("enableMachineThermalBoiler", - "gregtech", true, "Thermal Boiler from GT4. Can Filter Lava for resources."); - enableMultiblock_IndustrialCuttingMachine = config.getBoolean("enableMultiblock_IndustrialCuttingMachine", - "gregtech", true, "Very fast and efficient Cutting Machine."); - enableMultiblock_IndustrialFishingPort = config.getBoolean("enableMultiblock_IndustrialFishingPort", - "gregtech", true, "Fish the seas, except on land."); - enableMultiblock_IndustrialExtrudingMachine = config.getBoolean("enableMultiblock_IndustrialExtrudingMachine", - "gregtech", true, "Very fast and efficient Extruding Machine."); - enableMultiblock_IndustrialMultiMachine = config.getBoolean("enableMultiblock_IndustrialMultiMachine", - "gregtech", true, "Can run recipes for 9 different types of machines."); - enableMultiblock_Cyclotron = config.getBoolean("enableMultiblock_Cyclotron", - "gregtech", true, "COMET - Scientific Cyclotron."); - + enableMultiblock_AlloyBlastSmelter = config.getBoolean("enableMultiblockAlloyBlastSmelter", "gregtech", true, "Required to smelt most high tier materials from GT++. Also smelts everything else to molten metal."); + enableMultiblock_IndustrialCentrifuge = config.getBoolean("enableMultiblockIndustrialCentrifuge", "gregtech", true, "Spin, Spin, Spiiiin."); + enableMultiblock_IndustrialCokeOven = config.getBoolean("enableMultiblockIndustrialCokeOven", "gregtech", true, "Pyro Oven Alternative, older, more realistic, better."); + enableMultiblock_IndustrialElectrolyzer = config.getBoolean("enableMultiblockIndustrialElectrolyzer", "gregtech", true, "Electrolyzes things with extra bling factor."); + enableMultiblock_IndustrialMacerationStack = config.getBoolean("enableMultiblockIndustrialMacerationStack", "gregtech", true, "A hyper efficient maceration tower, nets more bonus outputs."); + enableMultiblock_IndustrialPlatePress = config.getBoolean("enableMultiblockIndustrialPlatePress", "gregtech", true, "Industrial bendering machine thingo."); + enableMultiblock_IndustrialWireMill = config.getBoolean("enableMultiblockIndustrialWireMill", "gregtech", true, "Produces fine wire and exotic cables."); + enableMultiblock_IronBlastFurnace = config.getBoolean("enableMultiblockIronBlastFurnace", "gregtech", true, "Skip the Bronze age, very slowly."); + enableMultiblock_MatterFabricator = config.getBoolean("enableMultiblockMatterFabricator", "gregtech", true, "?FAB?RIC?ATE MA?TT?ER."); + enableMultiblock_MultiTank = config.getBoolean("enableMultiblockMultiTank", "gregtech", true, "Tall tanks, each layer adds extra fluid storage."); + enableMultiblock_PowerSubstation = config.getBoolean("enableMultiblockPowerSubstation", "gregtech", true, "For managing large power grids."); + enableMultiblock_LiquidFluorideThoriumReactor = config.getBoolean("enableMultiblockLiquidFluorideThoriumReactor", "gregtech", true, "For supplying large power grids."); + enableMultiblock_NuclearFuelRefinery = config.getBoolean("enableMultiblock_NuclearFuelRefinery", "gregtech", true, "Refines molten chemicals into nuclear fuels."); + enableMultiblock_IndustrialSifter = config.getBoolean("enableMultiblock_IndustrialSifter", "gregtech", true, "Large scale sifting."); + enableMultiblock_LargeAutoCrafter = config.getBoolean("enableMultiblock_LargeAutoCrafter", "gregtech", true, "Can Assemble, Disassemble and Craft Project data from Data Sticks."); + enableMultiblock_IndustrialThermalCentrifuge = config.getBoolean("enableMultiblock_IndustrialThermalCentrifuge", "gregtech", true, "Your warm spin for the ore thing."); + enableMultiblock_IndustrialWashPlant = config.getBoolean("enableMultiblock_IndustrialWashPlant", "gregtech", true, "Used to wash the dirt, riiiiight offff.."); + enableMultiblock_ThermalBoiler = config.getBoolean("enableMachineThermalBoiler", "gregtech", true, "Thermal Boiler from GT4. Can Filter Lava for resources."); + enableMultiblock_IndustrialCuttingMachine = config.getBoolean("enableMultiblock_IndustrialCuttingMachine", "gregtech", true, "Very fast and efficient Cutting Machine."); + enableMultiblock_IndustrialFishingPort = config.getBoolean("enableMultiblock_IndustrialFishingPort", "gregtech", true, "Fish the seas, except on land."); + enableMultiblock_IndustrialExtrudingMachine = config.getBoolean("enableMultiblock_IndustrialExtrudingMachine", "gregtech", true, "Very fast and efficient Extruding Machine."); + enableMultiblock_IndustrialMultiMachine = config.getBoolean("enableMultiblock_IndustrialMultiMachine", "gregtech", true, "Can run recipes for 9 different types of machines."); + enableMultiblock_Cyclotron = config.getBoolean("enableMultiblock_Cyclotron", "gregtech", true, "COMET - Scientific Cyclotron."); + // Options - rfPerEU = config.getInt("rfUsedPerEUForUniversalBatteries", "configurables", 4, 1, 1000, - "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)"); - + rfPerEU = config.getInt("rfUsedPerEUForUniversalBatteries", "configurables", 4, 1, 1000, "How much RF is a single unit of EU worth? (Most mods use 4:1 ratio)"); + // Features - enableCustomCapes = config.getBoolean("enableSupporterCape", "features", true, - "Enables Custom GT++ Cape."); - disableZombieReinforcement = config.getBoolean("disableZombieReinforcement", "features", false, - "Disables Zombie Reinforcement on hard difficutly."); + enableCustomCapes = config.getBoolean("enableSupporterCape", "features", true, "Enables Custom GT++ Cape."); + disableZombieReinforcement = config.getBoolean("disableZombieReinforcement", "features", false, "Disables Zombie Reinforcement on hard difficutly."); enableWatchdogBGM = config.getInt("enableWatchdogBGM", "features", 0, 0, Short.MAX_VALUE, "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s."); - - //Biomes + hideUniversalCells = config.getBoolean("hideUniversalCells", "features", true, "Hides every filled IC2 Universal Cell from NEI."); + + // Biomes EVERGLADES_ID = config.getInt("darkworld_ID", "worldgen", 227, 1, 254, "The ID of the Dark Dimension."); EVERGLADESBIOME_ID = config.getInt("darkbiome_ID", "worldgen", 238, 1, 254, "The biome within the Dark Dimension."); - - //Blacklisted Accelerator TileEntities - BlacklistedTileEntiyClassNames = new String[] { "com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry" }; - BlacklistedTileEntiyClassNames = config.getStringList( - "BlacklistedTileEntiyClassNames", "gregtech", - BlacklistedTileEntiyClassNames, - "The Canonical Class-Names of TileEntities that should be ignored by the WorldAccelerator"); - - //Pollution - pollutionPerSecondMultiPackager = config.get("pollution", "pollutionPerSecondMultiPackager", pollutionPerSecondMultiPackager,"pollution rate in gibbl/s for the Amazon warehousing depot").getInt(pollutionPerSecondMultiPackager); - pollutionPerSecondMultiIndustrialAlloySmelter = config.get("pollution", "pollutionPerSecondMultiIndustrialAlloySmelter", pollutionPerSecondMultiIndustrialAlloySmelter,"pollution rate in gibbl/s for the Alloy blast smelter").getInt(pollutionPerSecondMultiIndustrialAlloySmelter); - pollutionPerSecondMultiIndustrialArcFurnace = config.get("pollution", "pollutionPerSecondMultiIndustrialArcFurnace", pollutionPerSecondMultiIndustrialArcFurnace,"pollution rate in gibbl/s for the High current arc furnace").getInt(pollutionPerSecondMultiIndustrialArcFurnace); - pollutionPerSecondMultiIndustrialCentrifuge = config.get("pollution", "pollutionPerSecondMultiIndustrialCentrifuge", pollutionPerSecondMultiIndustrialCentrifuge,"pollution rate in gibbl/s for the Industrial centrifuge").getInt(pollutionPerSecondMultiIndustrialCentrifuge); - pollutionPerSecondMultiIndustrialCokeOven = config.get("pollution", "pollutionPerSecondMultiIndustrialCokeOven", pollutionPerSecondMultiIndustrialCokeOven,"pollution rate in gibbl/s for the Industrial coke oven").getInt(pollutionPerSecondMultiIndustrialCokeOven); - pollutionPerSecondMultiIndustrialCuttingMachine = config.get("pollution", "pollutionPerSecondMultiIndustrialCuttingMachine", pollutionPerSecondMultiIndustrialCuttingMachine,"pollution rate in gibbl/s for the Cutting factory").getInt(pollutionPerSecondMultiIndustrialCuttingMachine); - pollutionPerSecondMultiIndustrialDehydrator = config.get("pollution", "pollutionPerSecondMultiIndustrialDehydrator", pollutionPerSecondMultiIndustrialDehydrator,"pollution rate in gibbl/s for the Utupu-Tanuri").getInt(pollutionPerSecondMultiIndustrialDehydrator); - pollutionPerSecondMultiIndustrialElectrolyzer = config.get("pollution", "pollutionPerSecondMultiIndustrialElectrolyzer", pollutionPerSecondMultiIndustrialElectrolyzer,"pollution rate in gibbl/s for the Industrial electrolyzer").getInt(pollutionPerSecondMultiIndustrialElectrolyzer); - pollutionPerSecondMultiIndustrialExtruder = config.get("pollution", "pollutionPerSecondMultiIndustrialExtruder", pollutionPerSecondMultiIndustrialExtruder,"pollution rate in gibbl/s for the Industrial extrusion machine").getInt(pollutionPerSecondMultiIndustrialExtruder); - pollutionPerSecondMultiIndustrialMacerator = config.get("pollution", "pollutionPerSecondMultiIndustrialMacerator", pollutionPerSecondMultiIndustrialMacerator,"pollution rate in gibbl/s for the Maceration stack").getInt(pollutionPerSecondMultiIndustrialMacerator); - pollutionPerSecondMultiIndustrialMixer = config.get("pollution", "pollutionPerSecondMultiIndustrialMixer", pollutionPerSecondMultiIndustrialMixer,"pollution rate in gibbl/s for the Industrial mixing machine").getInt(pollutionPerSecondMultiIndustrialMixer); - pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal", pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal,"pollution rate in gibbl/s for the Large processing factory in metal mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal); - pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid", pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid,"pollution rate in gibbl/s for the Large processing factory in fluid mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid); - pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc", pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc,"pollution rate in gibbl/s for the Large processing factory in misc mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc); - pollutionPerSecondMultiIndustrialPlatePress_ModeForming = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeForming", pollutionPerSecondMultiIndustrialPlatePress_ModeForming,"pollution rate in gibbl/s for the Industrial material press in forming mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeForming); - pollutionPerSecondMultiIndustrialPlatePress_ModeBending = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeBending", pollutionPerSecondMultiIndustrialPlatePress_ModeBending,"pollution rate in gibbl/s for the Industrial material press in bending mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeBending); - pollutionPerSecondMultiIndustrialSifter = config.get("pollution", "pollutionPerSecondMultiIndustrialSifter", pollutionPerSecondMultiIndustrialSifter,"pollution rate in gibbl/s for the Large Sifter").getInt(pollutionPerSecondMultiIndustrialSifter); - pollutionPerSecondMultiIndustrialThermalCentrifuge = config.get("pollution", "pollutionPerSecondMultiIndustrialThermalCentrifuge", pollutionPerSecondMultiIndustrialThermalCentrifuge,"pollution rate in gibbl/s for the Large thermal refinery").getInt(pollutionPerSecondMultiIndustrialThermalCentrifuge); - pollutionPerSecondMultiIndustrialVacuumFreezer = config.get("pollution", "pollutionPerSecondMultiIndustrialVacuumFreezer", pollutionPerSecondMultiIndustrialVacuumFreezer,"pollution rate in gibbl/s for the Cryogenic freezer").getInt(pollutionPerSecondMultiIndustrialVacuumFreezer); - pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath = config.get("pollution", "pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath", pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath,"pollution rate in gibbl/s for the Ore washing plant in chemical bath mode").getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath); - pollutionPerSecondMultiIndustrialWashPlant_ModeWasher = config.get("pollution", "pollutionPerSecondMultiIndustrialWashPlant_ModeWasher", pollutionPerSecondMultiIndustrialWashPlant_ModeWasher,"pollution rate in gibbl/s for the Ore washing plant in ore washer mode").getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeWasher); - pollutionPerSecondMultiIndustrialWireMill = config.get("pollution", "pollutionPerSecondMultiIndustrialWireMill", pollutionPerSecondMultiIndustrialWireMill,"pollution rate in gibbl/s for the Wire factory").getInt(pollutionPerSecondMultiIndustrialWireMill); - pollutionPerSecondMultiIsaMill = config.get("pollution", "pollutionPerSecondMultiIsaMill", pollutionPerSecondMultiIsaMill,"pollution rate in gibbl/s for the IsaMill grinding machine").getInt(pollutionPerSecondMultiIsaMill); - pollutionPerSecondMultiAdvDistillationTower_ModeDistillery = config.get("pollution", "pollutionPerSecondMultiAdvDistillationTower_ModeDistillery", pollutionPerSecondMultiAdvDistillationTower_ModeDistillery,"pollution rate in gibbl/s for the Dangote distillus in distillery mode").getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDistillery); - pollutionPerSecondMultiAdvDistillationTower_ModeDT = config.get("pollution", "pollutionPerSecondMultiAdvDistillationTower_ModeDT", pollutionPerSecondMultiAdvDistillationTower_ModeDT,"pollution rate in gibbl/s for the Dangote distillus in distillation tower mode").getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDT); - pollutionPerSecondMultiAdvEBF = config.get("pollution", "pollutionPerSecondMultiAdvEBF", pollutionPerSecondMultiAdvEBF,"pollution rate in gibbl/s for the Volcanus").getInt(pollutionPerSecondMultiAdvEBF); - pollutionPerSecondMultiAdvImplosion = config.get("pollution", "pollutionPerSecondMultiAdvImplosion", pollutionPerSecondMultiAdvImplosion,"pollution rate in gibbl/s for the Density^2").getInt(pollutionPerSecondMultiAdvImplosion); - pollutionPerSecondMultiABS = config.get("pollution", "pollutionPerSecondMultiABS", pollutionPerSecondMultiABS,"pollution rate in gibbl/s for the Alloy blast furnace").getInt(pollutionPerSecondMultiABS); - pollutionPerSecondMultiCyclotron = config.get("pollution", "pollutionPerSecondMultiCyclotron", pollutionPerSecondMultiCyclotron,"pollution rate in gibbl/s for the Cyclotron").getInt(pollutionPerSecondMultiCyclotron); - pollutionPerSecondMultiIndustrialFishingPond = config.get("pollution", "pollutionPerSecondMultiIndustrialFishingPond", pollutionPerSecondMultiIndustrialFishingPond,"pollution rate in gibbl/s for the Zuhai - fishing port").getInt(pollutionPerSecondMultiIndustrialFishingPond); - //pollutionPerSecondMultiLargeRocketEngine; - pollutionPerSecondMultiLargeSemiFluidGenerator = config.get("pollution", "pollutionPerSecondMultiLargeSemiFluidGenerator", pollutionPerSecondMultiLargeSemiFluidGenerator,"pollution rate in gibbl/s for the Large semifluid burner").getInt(pollutionPerSecondMultiLargeSemiFluidGenerator); - pollutionPerSecondMultiMassFabricator = config.get("pollution", "pollutionPerSecondMultiMassFabricator", pollutionPerSecondMultiMassFabricator,"pollution rate in gibbl/s for the Matter fabrication CPU").getInt(pollutionPerSecondMultiMassFabricator); - pollutionPerSecondMultiRefinery = config.get("pollution", "pollutionPerSecondMultiRefinery", pollutionPerSecondMultiRefinery,"pollution rate in gibbl/s for the Reactor fuel processing plant").getInt(pollutionPerSecondMultiRefinery); - //pollutionPerSecondMultiGeneratorArray; - pollutionPerSecondMultiIndustrialRockBreaker = config.get("pollution", "pollutionPerSecondMultiIndustrialRockBreaker", pollutionPerSecondMultiIndustrialRockBreaker,"pollution rate in gibbl/s for the Industrial Rock Breaker").getInt(pollutionPerSecondMultiIndustrialRockBreaker); - pollutionPerSecondMultiIndustrialChisel = config.get("pollution", "pollutionPerSecondMultiIndustrialChisel", pollutionPerSecondMultiIndustrialChisel,"pollution rate in gibbl/s for the Industrial Chisel").getInt(pollutionPerSecondMultiIndustrialChisel); - pollutionPerSecondMultiTreeFarm = config.get("pollution", "pollutionPerSecondMultiTreeFarm", pollutionPerSecondMultiTreeFarm,"pollution rate in gibbl/s for the Tree growth simulator").getInt(pollutionPerSecondMultiTreeFarm); - pollutionPerSecondMultiFrothFlotationCell = config.get("pollution", "pollutionPerSecondMultiFrothFlotationCell", pollutionPerSecondMultiFrothFlotationCell,"pollution rate in gibbl/s for the Flotation cell regulator").getInt(pollutionPerSecondMultiFrothFlotationCell); - pollutionPerSecondMultiAutoCrafter = config.get("pollution", "pollutionPerSecondMultiAutoCrafter", pollutionPerSecondMultiAutoCrafter,"pollution rate in gibbl/s for the Large-Scale auto assembler v1.01").getInt(pollutionPerSecondMultiAutoCrafter); - pollutionPerSecondMultiThermalBoiler = config.get("pollution", "pollutionPerSecondMultiThermalBoiler", pollutionPerSecondMultiThermalBoiler,"pollution rate in gibbl/s for the Thermal boiler").getInt(pollutionPerSecondMultiThermalBoiler); - pollutionPerSecondMultiAlgaePond = config.get("pollution", "pollutionPerSecondMultiAlgaePond", pollutionPerSecondMultiAlgaePond,"pollution rate in gibbl/s for the Algae farm").getInt(pollutionPerSecondMultiAlgaePond); + + // Blacklisted Accelerator TileEntities + BlacklistedTileEntiyClassNames = new String[]{"com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry"}; + BlacklistedTileEntiyClassNames = config.getStringList("BlacklistedTileEntiyClassNames", "gregtech", BlacklistedTileEntiyClassNames, "The Canonical Class-Names of TileEntities that should be ignored by the WorldAccelerator"); + + // Pollution + pollutionPerSecondMultiPackager = config.get("pollution", "pollutionPerSecondMultiPackager", pollutionPerSecondMultiPackager, "pollution rate in gibbl/s for the Amazon warehousing depot").getInt(pollutionPerSecondMultiPackager); + pollutionPerSecondMultiIndustrialAlloySmelter = config.get("pollution", "pollutionPerSecondMultiIndustrialAlloySmelter", pollutionPerSecondMultiIndustrialAlloySmelter, "pollution rate in gibbl/s for the Alloy blast smelter").getInt(pollutionPerSecondMultiIndustrialAlloySmelter); + pollutionPerSecondMultiIndustrialArcFurnace = config.get("pollution", "pollutionPerSecondMultiIndustrialArcFurnace", pollutionPerSecondMultiIndustrialArcFurnace, "pollution rate in gibbl/s for the High current arc furnace").getInt(pollutionPerSecondMultiIndustrialArcFurnace); + pollutionPerSecondMultiIndustrialCentrifuge = config.get("pollution", "pollutionPerSecondMultiIndustrialCentrifuge", pollutionPerSecondMultiIndustrialCentrifuge, "pollution rate in gibbl/s for the Industrial centrifuge").getInt(pollutionPerSecondMultiIndustrialCentrifuge); + pollutionPerSecondMultiIndustrialCokeOven = config.get("pollution", "pollutionPerSecondMultiIndustrialCokeOven", pollutionPerSecondMultiIndustrialCokeOven, "pollution rate in gibbl/s for the Industrial coke oven").getInt(pollutionPerSecondMultiIndustrialCokeOven); + pollutionPerSecondMultiIndustrialCuttingMachine = config.get("pollution", "pollutionPerSecondMultiIndustrialCuttingMachine", pollutionPerSecondMultiIndustrialCuttingMachine, "pollution rate in gibbl/s for the Cutting factory").getInt(pollutionPerSecondMultiIndustrialCuttingMachine); + pollutionPerSecondMultiIndustrialDehydrator = config.get("pollution", "pollutionPerSecondMultiIndustrialDehydrator", pollutionPerSecondMultiIndustrialDehydrator, "pollution rate in gibbl/s for the Utupu-Tanuri").getInt(pollutionPerSecondMultiIndustrialDehydrator); + pollutionPerSecondMultiIndustrialElectrolyzer = config.get("pollution", "pollutionPerSecondMultiIndustrialElectrolyzer", pollutionPerSecondMultiIndustrialElectrolyzer, "pollution rate in gibbl/s for the Industrial electrolyzer").getInt(pollutionPerSecondMultiIndustrialElectrolyzer); + pollutionPerSecondMultiIndustrialExtruder = config.get("pollution", "pollutionPerSecondMultiIndustrialExtruder", pollutionPerSecondMultiIndustrialExtruder, "pollution rate in gibbl/s for the Industrial extrusion machine").getInt(pollutionPerSecondMultiIndustrialExtruder); + pollutionPerSecondMultiIndustrialMacerator = config.get("pollution", "pollutionPerSecondMultiIndustrialMacerator", pollutionPerSecondMultiIndustrialMacerator, "pollution rate in gibbl/s for the Maceration stack").getInt(pollutionPerSecondMultiIndustrialMacerator); + pollutionPerSecondMultiIndustrialMixer = config.get("pollution", "pollutionPerSecondMultiIndustrialMixer", pollutionPerSecondMultiIndustrialMixer, "pollution rate in gibbl/s for the Industrial mixing machine").getInt(pollutionPerSecondMultiIndustrialMixer); + pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal", pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal, "pollution rate in gibbl/s for the Large processing factory in metal mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMetal); + pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid", pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid, "pollution rate in gibbl/s for the Large processing factory in fluid mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeFluid); + pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc", pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc, "pollution rate in gibbl/s for the Large processing factory in misc mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc); + pollutionPerSecondMultiIndustrialPlatePress_ModeForming = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeForming", pollutionPerSecondMultiIndustrialPlatePress_ModeForming, "pollution rate in gibbl/s for the Industrial material press in forming mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeForming); + pollutionPerSecondMultiIndustrialPlatePress_ModeBending = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeBending", pollutionPerSecondMultiIndustrialPlatePress_ModeBending, "pollution rate in gibbl/s for the Industrial material press in bending mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeBending); + pollutionPerSecondMultiIndustrialSifter = config.get("pollution", "pollutionPerSecondMultiIndustrialSifter", pollutionPerSecondMultiIndustrialSifter, "pollution rate in gibbl/s for the Large Sifter").getInt(pollutionPerSecondMultiIndustrialSifter); + pollutionPerSecondMultiIndustrialThermalCentrifuge = config.get("pollution", "pollutionPerSecondMultiIndustrialThermalCentrifuge", pollutionPerSecondMultiIndustrialThermalCentrifuge, "pollution rate in gibbl/s for the Large thermal refinery").getInt(pollutionPerSecondMultiIndustrialThermalCentrifuge); + pollutionPerSecondMultiIndustrialVacuumFreezer = config.get("pollution", "pollutionPerSecondMultiIndustrialVacuumFreezer", pollutionPerSecondMultiIndustrialVacuumFreezer, "pollution rate in gibbl/s for the Cryogenic freezer").getInt(pollutionPerSecondMultiIndustrialVacuumFreezer); + pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath = config.get("pollution", "pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath", pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath, "pollution rate in gibbl/s for the Ore washing plant in chemical bath mode").getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath); + pollutionPerSecondMultiIndustrialWashPlant_ModeWasher = config.get("pollution", "pollutionPerSecondMultiIndustrialWashPlant_ModeWasher", pollutionPerSecondMultiIndustrialWashPlant_ModeWasher, "pollution rate in gibbl/s for the Ore washing plant in ore washer mode").getInt(pollutionPerSecondMultiIndustrialWashPlant_ModeWasher); + pollutionPerSecondMultiIndustrialWireMill = config.get("pollution", "pollutionPerSecondMultiIndustrialWireMill", pollutionPerSecondMultiIndustrialWireMill, "pollution rate in gibbl/s for the Wire factory").getInt(pollutionPerSecondMultiIndustrialWireMill); + pollutionPerSecondMultiIsaMill = config.get("pollution", "pollutionPerSecondMultiIsaMill", pollutionPerSecondMultiIsaMill, "pollution rate in gibbl/s for the IsaMill grinding machine").getInt(pollutionPerSecondMultiIsaMill); + pollutionPerSecondMultiAdvDistillationTower_ModeDistillery = config.get("pollution", "pollutionPerSecondMultiAdvDistillationTower_ModeDistillery", pollutionPerSecondMultiAdvDistillationTower_ModeDistillery, "pollution rate in gibbl/s for the Dangote distillus in distillery mode").getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDistillery); + pollutionPerSecondMultiAdvDistillationTower_ModeDT = config.get("pollution", "pollutionPerSecondMultiAdvDistillationTower_ModeDT", pollutionPerSecondMultiAdvDistillationTower_ModeDT, "pollution rate in gibbl/s for the Dangote distillus in distillation tower mode").getInt(pollutionPerSecondMultiAdvDistillationTower_ModeDT); + pollutionPerSecondMultiAdvEBF = config.get("pollution", "pollutionPerSecondMultiAdvEBF", pollutionPerSecondMultiAdvEBF, "pollution rate in gibbl/s for the Volcanus").getInt(pollutionPerSecondMultiAdvEBF); + pollutionPerSecondMultiAdvImplosion = config.get("pollution", "pollutionPerSecondMultiAdvImplosion", pollutionPerSecondMultiAdvImplosion, "pollution rate in gibbl/s for the Density^2").getInt(pollutionPerSecondMultiAdvImplosion); + pollutionPerSecondMultiABS = config.get("pollution", "pollutionPerSecondMultiABS", pollutionPerSecondMultiABS, "pollution rate in gibbl/s for the Alloy blast furnace").getInt(pollutionPerSecondMultiABS); + pollutionPerSecondMultiCyclotron = config.get("pollution", "pollutionPerSecondMultiCyclotron", pollutionPerSecondMultiCyclotron, "pollution rate in gibbl/s for the Cyclotron").getInt(pollutionPerSecondMultiCyclotron); + pollutionPerSecondMultiIndustrialFishingPond = config.get("pollution", "pollutionPerSecondMultiIndustrialFishingPond", pollutionPerSecondMultiIndustrialFishingPond, "pollution rate in gibbl/s for the Zuhai - fishing port").getInt(pollutionPerSecondMultiIndustrialFishingPond); + // pollutionPerSecondMultiLargeRocketEngine; + pollutionPerSecondMultiLargeSemiFluidGenerator = config.get("pollution", "pollutionPerSecondMultiLargeSemiFluidGenerator", pollutionPerSecondMultiLargeSemiFluidGenerator, "pollution rate in gibbl/s for the Large semifluid burner").getInt(pollutionPerSecondMultiLargeSemiFluidGenerator); + pollutionPerSecondMultiMassFabricator = config.get("pollution", "pollutionPerSecondMultiMassFabricator", pollutionPerSecondMultiMassFabricator, "pollution rate in gibbl/s for the Matter fabrication CPU").getInt(pollutionPerSecondMultiMassFabricator); + pollutionPerSecondMultiRefinery = config.get("pollution", "pollutionPerSecondMultiRefinery", pollutionPerSecondMultiRefinery, "pollution rate in gibbl/s for the Reactor fuel processing plant").getInt(pollutionPerSecondMultiRefinery); + // pollutionPerSecondMultiGeneratorArray; + pollutionPerSecondMultiIndustrialRockBreaker = config.get("pollution", "pollutionPerSecondMultiIndustrialRockBreaker", pollutionPerSecondMultiIndustrialRockBreaker, "pollution rate in gibbl/s for the Industrial Rock Breaker").getInt(pollutionPerSecondMultiIndustrialRockBreaker); + pollutionPerSecondMultiIndustrialChisel = config.get("pollution", "pollutionPerSecondMultiIndustrialChisel", pollutionPerSecondMultiIndustrialChisel, "pollution rate in gibbl/s for the Industrial Chisel").getInt(pollutionPerSecondMultiIndustrialChisel); + pollutionPerSecondMultiTreeFarm = config.get("pollution", "pollutionPerSecondMultiTreeFarm", pollutionPerSecondMultiTreeFarm, "pollution rate in gibbl/s for the Tree growth simulator").getInt(pollutionPerSecondMultiTreeFarm); + pollutionPerSecondMultiFrothFlotationCell = config.get("pollution", "pollutionPerSecondMultiFrothFlotationCell", pollutionPerSecondMultiFrothFlotationCell, "pollution rate in gibbl/s for the Flotation cell regulator").getInt(pollutionPerSecondMultiFrothFlotationCell); + pollutionPerSecondMultiAutoCrafter = config.get("pollution", "pollutionPerSecondMultiAutoCrafter", pollutionPerSecondMultiAutoCrafter, "pollution rate in gibbl/s for the Large-Scale auto assembler v1.01").getInt(pollutionPerSecondMultiAutoCrafter); + pollutionPerSecondMultiThermalBoiler = config.get("pollution", "pollutionPerSecondMultiThermalBoiler", pollutionPerSecondMultiThermalBoiler, "pollution rate in gibbl/s for the Thermal boiler").getInt(pollutionPerSecondMultiThermalBoiler); + pollutionPerSecondMultiAlgaePond = config.get("pollution", "pollutionPerSecondMultiAlgaePond", pollutionPerSecondMultiAlgaePond, "pollution rate in gibbl/s for the Algae farm").getInt(pollutionPerSecondMultiAlgaePond); basePollutionPerSecondSemiFluidGenerator = config.get("pollution", "basePollutionPerSecondSemiFluidGenerator", basePollutionPerSecondSemiFluidGenerator, "base pollution rate in gibbl/s for the single block semi fluid generators").getInt(basePollutionPerSecondSemiFluidGenerator); pollutionReleasedByTierSemiFluidGenerator = config.get("pollution", "pollutionReleasedByTierSemiFluidGenerator", pollutionReleasedByTierSemiFluidGenerator, "coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)").getDoubleList(); - basePollutionPerSecondBoiler = config.get("pollution", "basePollutionPerSecondBoiler", basePollutionPerSecondBoiler,"base pollution rate in gibbl/s for the single block boilers").getInt(basePollutionPerSecondBoiler); + basePollutionPerSecondBoiler = config.get("pollution", "basePollutionPerSecondBoiler", basePollutionPerSecondBoiler, "base pollution rate in gibbl/s for the single block boilers").getInt(basePollutionPerSecondBoiler); pollutionReleasedByTierBoiler = config.get("pollution", "pollutionReleasedByTierBoiler", pollutionReleasedByTierBoiler, "coefficient applied to the base rate of the single block semi fluid generators based on its tier (first is tier 0 aka ULV)").getDoubleList(); baseMinPollutionPerSecondRocketFuelGenerator = config.get("pollution", "baseMinPollutionPerSecondRocketFuelGenerator", baseMinPollutionPerSecondRocketFuelGenerator, "minimum base pollution rate in gibbl/s for the single block rocket engines").getInt(baseMinPollutionPerSecondRocketFuelGenerator); baseMaxPollutionPerSecondRocketFuelGenerator = config.get("pollution", "baseMaxPollutionPerSecondRocketFuelGenerator", baseMaxPollutionPerSecondRocketFuelGenerator, "maximum base pollution rate in gibbl/s for the single block rocket engines").getInt(baseMaxPollutionPerSecondRocketFuelGenerator); pollutionReleasedByTierRocketFuelGenerator = config.get("pollution", "pollutionReleasedByTierRocketFuelGenerator", pollutionReleasedByTierRocketFuelGenerator, "coefficient applied to the base rate of the single block rocket engines based on its tier (first is tier 0 aka ULV)").getDoubleList(); - basePollutionPerSecondGeothermalGenerator = config.get("pollution", "basePollutionPerSecondGeothermalGenerator", basePollutionPerSecondGeothermalGenerator,"base pollution rate in gibbl/s for the geothermal engines").getInt(basePollutionPerSecondGeothermalGenerator); + basePollutionPerSecondGeothermalGenerator = config.get("pollution", "basePollutionPerSecondGeothermalGenerator", basePollutionPerSecondGeothermalGenerator, "base pollution rate in gibbl/s for the geothermal engines").getInt(basePollutionPerSecondGeothermalGenerator); pollutionReleasedByTierGeothermalGenerator = config.get("pollution", "pollutionReleasedByTierGeothermalGenerator", pollutionReleasedByTierGeothermalGenerator, "coefficient applied to the base rate of the single block geothermal engines based on its tier (first is tier 0 aka ULV)").getDoubleList(); config.save(); } diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java index 1d435e1269..1dc9996cde 100644 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -541,7 +541,7 @@ public class BaseItemComponent extends Item{ DUSTSMALL("DustSmall", "Small Pile of@Dust", "dustSmall", OrePrefixes.dustSmall), DUSTTINY("DustTiny", "Tiny Pile of@Dust", "dustTiny", OrePrefixes.dustTiny), INGOT("Ingot", " Ingot", "ingot", OrePrefixes.ingot), - HOTINGOT("HotIngot", " Hot@Ingot", "ingotHot", OrePrefixes.ingotHot), + HOTINGOT("HotIngot", "Hot@Ingot", "ingotHot", OrePrefixes.ingotHot), PLATE("Plate", " Plate", "plate", OrePrefixes.plate), PLATEDOUBLE("PlateDouble", " Double Plate", "plateDouble", OrePrefixes.plateDouble), ROD("Rod", " Rod", "stick", OrePrefixes.stick), diff --git a/src/main/java/gtPlusPlus/core/lib/CORE.java b/src/main/java/gtPlusPlus/core/lib/CORE.java index 7508b9fc8f..9ae37ff0a2 100644 --- a/src/main/java/gtPlusPlus/core/lib/CORE.java +++ b/src/main/java/gtPlusPlus/core/lib/CORE.java @@ -205,6 +205,7 @@ public class CORE { public static boolean enableOldGTcircuits = false; public static boolean disableZombieReinforcement = false; public static int enableWatchdogBGM = CORE_Preloader.enableWatchdogBGM; + public static boolean hideUniversalCells = true; //GT Fixes public static boolean enableNitroFix = false; diff --git a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java index 5a0c0f4ea3..6c940adc1d 100644 --- a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.proxy; +import java.util.ArrayList; + import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -12,9 +14,7 @@ import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.australia.entity.model.ModelBoar; -import gtPlusPlus.australia.entity.model.ModelDingo; -import gtPlusPlus.australia.entity.model.ModelOctopus; +import gtPlusPlus.australia.entity.model.*; import gtPlusPlus.australia.entity.render.*; import gtPlusPlus.australia.entity.type.*; import gtPlusPlus.core.client.model.ModelGiantChicken; @@ -27,15 +27,15 @@ import gtPlusPlus.core.entity.monster.*; import gtPlusPlus.core.entity.projectile.*; import gtPlusPlus.core.handler.render.FirepitRender; import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.ConfigSwitches; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; import gtPlusPlus.core.tileentities.general.TileEntityFirepit; import gtPlusPlus.core.util.minecraft.particles.EntityParticleFXMysterious; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; -import gtPlusPlus.xmod.gregtech.common.render.GTPP_CapeRenderer; -import gtPlusPlus.xmod.gregtech.common.render.GTPP_FlaskRenderer; -import gtPlusPlus.xmod.gregtech.common.render.GTPP_Render_MachineBlock; +import gtPlusPlus.xmod.gregtech.common.render.*; +import ic2.core.item.ItemFluidCell; import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.entity.RenderFireball; @@ -43,9 +43,11 @@ import net.minecraft.client.renderer.entity.RenderSnowball; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.client.MinecraftForgeClient; +import net.minecraftforge.fluids.*; public class ClientProxy extends CommonProxy implements Runnable{ @@ -97,9 +99,9 @@ public class ClientProxy extends CommonProxy implements Runnable{ new GTPP_Render_MachineBlock(); if (Meta_GT_Proxy.sDoesVolumetricFlaskExist) { - new GTPP_FlaskRenderer(); + new GTPP_FlaskRenderer(); } - + super.init(e); } @@ -255,17 +257,33 @@ public class ClientProxy extends CommonProxy implements Runnable{ @Override public void onLoadComplete(FMLLoadCompleteEvent event) { GTplusplus.tryPatchTurbineTextures(); + if (CORE.ConfigSwitches.hideUniversalCells) { + hideUniversalCells(); + } super.onLoadComplete(event); } + public void hideUniversalCells() { + ArrayList itemList = new ArrayList(); + for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) { + if (fluid == null) { + continue; + } + itemList.add(ItemFluidCell.getUniversalFluidCell(new FluidStack(fluid, 2147483647))); + } + for (ItemStack aCell : itemList) { + codechicken.nei.api.API.hideItem(aCell); + } + } + @Override public World getClientWorld() { return FMLClientHandler.instance().getClient().theWorld; } - + @Override public EntityPlayer getPlayerEntity(MessageContext ctx) { - return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer : super.getPlayerEntity(ctx)); + return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer : super.getPlayerEntity(ctx)); } } 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 138ffe3cb4..26b32c8b22 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 @@ -113,7 +113,7 @@ public class GTPP_Comb extends Item { public static void initCombsRecipes() { 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}); + addChemicalRecipe(GTPP_CombType.FORCE, new ItemStack[]{GT_ModHandler.getModItem("Forestry", "beeswax", 1L, 0), GTPP_Bees.propolis.getStackForType(GTPP_PropolisType.FORCE), GTPP_Bees.drop.getStackForType(GTPP_DropType.FORCE)}, new int[]{5000, 3000, 1000}); } -- cgit From 143a76dd8b380f85dad4fee6359b5a17022feccb Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 29 Jan 2022 13:07:43 +0000 Subject: Added Mob Mentality. Added perks to sleeping. Added Magic Feather. --- src/main/java/gtPlusPlus/GTplusplus.java | 4 +- .../java/gtPlusPlus/core/common/CommonProxy.java | 2 + .../java/gtPlusPlus/core/handler/MobMentality.java | 58 ++++++ .../handler/events/PlayerSleepEventHandler.java | 124 +++++++++++++ src/main/java/gtPlusPlus/core/item/ModItems.java | 9 +- .../core/item/general/ItemMagicFeather.java | 196 +++++++++++++++++++++ .../gtPlusPlus/core/potion/GtPotionEffect.java | 11 ++ .../java/gtPlusPlus/core/util/math/MathUtils.java | 13 ++ .../forestry/bees/items/output/GTPP_Propolis.java | 2 +- .../miscutils/textures/items/magicfeather.png | Bin 0 -> 324 bytes 10 files changed, 414 insertions(+), 5 deletions(-) create mode 100644 src/main/java/gtPlusPlus/core/handler/MobMentality.java create mode 100644 src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java create mode 100644 src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java create mode 100644 src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java create mode 100644 src/main/resources/assets/miscutils/textures/items/magicfeather.png (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java index 1513a0999c..414eb10dae 100644 --- a/src/main/java/gtPlusPlus/GTplusplus.java +++ b/src/main/java/gtPlusPlus/GTplusplus.java @@ -28,8 +28,7 @@ import gtPlusPlus.core.commands.CommandEnableDebugWhileRunning; import gtPlusPlus.core.commands.CommandMath; import gtPlusPlus.core.common.CommonProxy; import gtPlusPlus.core.config.ConfigHandler; -import gtPlusPlus.core.handler.BookHandler; -import gtPlusPlus.core.handler.PacketHandler; +import gtPlusPlus.core.handler.*; import gtPlusPlus.core.handler.Recipes.RegistrationHandler; import gtPlusPlus.core.handler.events.BlockEventHandler; import gtPlusPlus.core.handler.events.LoginEventHandler; @@ -174,6 +173,7 @@ public class GTplusplus implements ActionListener { Utils.registerEvent(new LoginEventHandler()); Utils.registerEvent(new MissingMappingsEvent()); + Utils.registerEvent(new MobMentality()); Logger.INFO("Login Handler Initialized"); proxy.preInit(event); diff --git a/src/main/java/gtPlusPlus/core/common/CommonProxy.java b/src/main/java/gtPlusPlus/core/common/CommonProxy.java index c038afce8f..fb3f291dd0 100644 --- a/src/main/java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/main/java/gtPlusPlus/core/common/CommonProxy.java @@ -124,6 +124,8 @@ public class CommonProxy { Utils.registerEvent(new HandlerTooltip_EIO()); // Handles Custom Tooltips for GC Utils.registerEvent(new HandlerTooltip_GC()); + // Handles Sleep Benefits + PlayerSleepEventHandler.init(); if (CORE.DEVENV) { Utils.registerEvent(new StopAnnoyingFuckingAchievements()); diff --git a/src/main/java/gtPlusPlus/core/handler/MobMentality.java b/src/main/java/gtPlusPlus/core/handler/MobMentality.java new file mode 100644 index 0000000000..acc289fecd --- /dev/null +++ b/src/main/java/gtPlusPlus/core/handler/MobMentality.java @@ -0,0 +1,58 @@ +package gtPlusPlus.core.handler; + +import java.util.*; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gtPlusPlus.core.util.minecraft.EntityUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.event.entity.living.LivingHurtEvent; + +public class MobMentality { + + public static HashSet> sIgnoredTypes = new HashSet>(); + + @SubscribeEvent + public void onEntityDamaged(LivingHurtEvent event) { + final EntityLivingBase target = event.entityLiving; + for (Class aEntityClass : sIgnoredTypes) { + if (aEntityClass.isInstance(target)) { + return; + } + } + if (target instanceof EntityLivingBase) { + final EntityLivingBase entity = target; + final Entity attacker = event.source.getSourceOfDamage(); + if (/*this.configuration.shouldIgnoreNeutralMobs() && */!(entity instanceof IMob)) { + return; + } + if (attacker == null) { + return; + } + if (attacker instanceof EntityLivingBase && !PlayerUtils.isRealPlayer((EntityLivingBase) attacker)) { + return; + } + if (attacker instanceof EntityPlayer && PlayerUtils.isCreative((EntityPlayer) attacker)) { + return; + } + if (attacker instanceof EntityLivingBase) { + List aEntityList = target.worldObj.loadedEntityList; + List aRangedEntity = new ArrayList(); + for (Entity aEntity : aEntityList) { + if (target.getClass().isInstance(aEntity)) { + if (EntityUtils.getDistance(target, aEntity) <= 32) { + aRangedEntity.add((EntityLivingBase) aEntity); + } + } + } + for (EntityLivingBase aEntity : aRangedEntity) { + aEntity.setRevengeTarget((EntityLivingBase) attacker); + } + } + } + } + +} diff --git a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java new file mode 100644 index 0000000000..d3700e1373 --- /dev/null +++ b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java @@ -0,0 +1,124 @@ +package gtPlusPlus.core.handler.events; + +import cpw.mods.fml.common.eventhandler.Event.Result; + +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.*; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.potion.GtPotionEffect; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraftforge.event.entity.player.PlayerSleepInBedEvent; +import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; + +public class PlayerSleepEventHandler { + + private static ArrayList sPositiveEffects = new ArrayList(); + private static ArrayList sNegativeEffects = new ArrayList(); + + public static void init() { + Utils.registerEvent(new PlayerSleepEventHandler()); + sPositiveEffects.add(Potion.moveSpeed); + sPositiveEffects.add(Potion.waterBreathing); + sPositiveEffects.add(Potion.resistance); + sPositiveEffects.add(Potion.regeneration); + sPositiveEffects.add(Potion.damageBoost); + sPositiveEffects.add(Potion.digSpeed); + sPositiveEffects.add(Potion.fireResistance); + sPositiveEffects.add(Potion.field_76434_w); // Health Boost + sPositiveEffects.add(Potion.field_76444_x); // Absorption + sNegativeEffects.add(Potion.blindness); + sNegativeEffects.add(Potion.confusion); + sNegativeEffects.add(Potion.digSlowdown); + sNegativeEffects.add(Potion.harm); + sNegativeEffects.add(Potion.hunger); + sNegativeEffects.add(Potion.moveSlowdown); + sNegativeEffects.add(Potion.poison); + sNegativeEffects.add(Potion.weakness); + sNegativeEffects.add(Potion.wither); + } + + @SubscribeEvent + public void sleep(PlayerSleepInBedEvent event) { + event.setResult(Result.ALLOW); + } + + @SubscribeEvent + public void wake(PlayerWakeUpEvent event) { + EntityPlayer aPlayer = event.entityPlayer; + if (aPlayer != null && !aPlayer.worldObj.isRemote) { + // Try Heal + float aCurrentHP = aPlayer.getHealth(); + float aMaxHP = aPlayer.getMaxHealth(); + if (aCurrentHP < aMaxHP) { + float aDamage = aMaxHP - aCurrentHP; + float aToHeal = MathUtils.randFloat(1, aDamage); + if (aToHeal > 0) { + aPlayer.heal(aToHeal); + PlayerUtils.messagePlayer(aPlayer, "You slept well and now feel " + (aToHeal >= aDamage / 2 ? "much" : "a little") + " better."); + } + } + // Already healed, try give a buff + else { + int aRandomBuff = MathUtils.randInt(0, sPositiveEffects.size() - 1); + Potion aPotionToApply = sPositiveEffects.get(aRandomBuff); + if (aPotionToApply != null) { + aPlayer.addPotionEffect(new GtPotionEffect(aPotionToApply.id, MathUtils.randInt(60, 180), MathUtils.randInt(0, 2))); + PlayerUtils.messagePlayer(aPlayer, "You feel really well rested."); + } + } + boolean aRemovedBad = false; + /*for (Potion aBadPotion : sNegativeEffects) { + if (curePotionEffect(aPlayer, aBadPotion)) { + aRemovedBad = true; + } + }*/ + if (aRemovedBad) { + PlayerUtils.messagePlayer(aPlayer, "The downsides of life no longer effect you."); + } + } + } + + private static Field sActivePotionEffects = ReflectionUtils.getField(EntityPlayer.class, "activePotionsMap"); + private static Method sOnFinishedPotionEffect = ReflectionUtils.getMethod(EntityPlayer.class, "onFinishedPotionEffect", PotionEffect.class); + + public boolean curePotionEffect(EntityPlayer aPlayer, Potion aPotion) { + HashMap activePotionsMap = new HashMap(); + try { + activePotionsMap = ReflectionUtils.getFieldValue(sActivePotionEffects, aPlayer); + } + catch (Throwable t) { + t.printStackTrace(); + } + if (aPlayer != null && aPotion != null && activePotionsMap != null && activePotionsMap.size() > 0) { + Iterator potionKey = activePotionsMap.keySet().iterator(); + if (!aPlayer.worldObj.isRemote) { + while (potionKey.hasNext()) { + try { + Integer key = potionKey.next(); + PotionEffect effect = (PotionEffect) activePotionsMap.get(key); + if (effect.getPotionID() == aPotion.getId()) { + potionKey.remove(); + ReflectionUtils.invokeVoid(aPlayer, sOnFinishedPotionEffect, new Object[]{effect}); + return true; + } + } + catch (ConcurrentModificationException e) { + e.printStackTrace(); + } + } + } + } + return false; + } + +} diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index cf70c56f21..7342c55939 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -76,11 +76,13 @@ import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechItems; import net.minecraft.item.*; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; public final class ModItems { + public static ToolMaterial STABALLOY = EnumHelper.addToolMaterial("Staballoy", 3, 2500, 7, 1.0F, 18); public static Item ZZZ_Empty; @@ -355,6 +357,8 @@ public final class ModItems { public static CoreItem itemExquisiteIndustrialDiamond; public static BaseItemMetaFood itemMetaFood; + + public static ItemMagicFeather itemMagicFeather; static { Logger.INFO("Items!"); @@ -365,8 +369,9 @@ public final class ModItems { public static final void init(){ - itemDebugScanner = new DebugScanner(); - + itemDebugScanner = new DebugScanner(); + itemMagicFeather = new ItemMagicFeather(); + itemAlkalusDisk = new BaseItemDamageable("itemAlkalusDisk", AddToCreativeTab.tabMisc, 1, 0, "Unknown Use", EnumRarity.rare, EnumChatFormatting.AQUA, false, null); itemBigEgg = new ItemGiantEgg(); itemGenericToken = new ItemGenericToken(); diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java b/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java new file mode 100644 index 0000000000..41b88b7aa8 --- /dev/null +++ b/src/main/java/gtPlusPlus/core/item/general/ItemMagicFeather.java @@ -0,0 +1,196 @@ +package gtPlusPlus.core.item.general; + +import java.util.List; +import java.util.WeakHashMap; + +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.item.ModItems; +import gtPlusPlus.core.item.base.CoreItem; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.*; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityBeacon; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; + +public class ItemMagicFeather extends CoreItem { + + public static final String NAME = "magicfeather"; + private static final WeakHashMap playerData = new WeakHashMap<>(); + + public ItemMagicFeather() { + super("magicfeather", AddToCreativeTab.tabMisc, 1, 100, new String[] {"Lets you fly around Beacons"}, EnumRarity.rare, EnumChatFormatting.BOLD, false, null); + setMaxStackSize(1); + setUnlocalizedName(CORE.MODID + ":" + NAME); + MinecraftForge.EVENT_BUS.register(this); + } + + @Override + public int getEntityLifespan(ItemStack itemStack, World world) { + return Integer.MAX_VALUE; + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + super.addInformation(stack, aPlayer, list, bool); + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + if (player != null) { + if (!isInBeaconRange(player)) { + list.add(""+EnumChatFormatting.RED+"Needs to be within beacon range"); + } + } + } + + public boolean hasCustomEntity(ItemStack stack) { + return true; + } + + private static boolean isInBeaconRange(EntityPlayer player) { + World world = player.getEntityWorld(); + + List tileEntities = world.loadedTileEntityList; + for (TileEntity t : tileEntities) { + if (!(t instanceof TileEntityBeacon)) { + continue; + } + + TileEntityBeacon beacon = (TileEntityBeacon) t; + + int level = beacon.getLevels(); + int radius = (level * 10 + 10); + + int x = beacon.xCoord; + int z = beacon.zCoord;; + + if (player.posX < (x - radius) || player.posX > (x + radius)) { + continue; + } + + if (player.posZ < (z - radius) || player.posZ > (z + radius)) { + continue; + } + + return true; + } + + return false; + } + + private static void setMayFly(EntityPlayer player, boolean mayFly) { + if (player.capabilities.allowFlying == mayFly) { + return; + } + + if (!mayFly) { + // force the player on the ground then remove ability to fly + // this prevent crashing the the ground and dying + // when you accidentally get out of the beacon range + player.capabilities.isFlying = false; + + if (player.onGround && player.fallDistance < 1F) { + player.capabilities.allowFlying = false; + } + } else { + player.capabilities.allowFlying = true; + } + + player.sendPlayerAbilities(); + } + + @SubscribeEvent + public void onPlayerTick(TickEvent.PlayerTickEvent event) { + if (event.side != Side.SERVER) { + return; + } + + EntityPlayer player = event.player; + + MagicFeatherData data = ItemMagicFeather.playerData.get(player); + if (data == null) { + data = new MagicFeatherData(player); + ItemMagicFeather.playerData.put(player, data); + } + + data.onTick(); + } + + private static boolean hasItem(EntityPlayer player, Item item) { + for (int i = 0; i < player.inventory.getSizeInventory(); i++) { + ItemStack stack = player.inventory.getStackInSlot(i); + if (item == stack.getItem()) { + return true; + } + } + + return false; + } + + private static class MagicFeatherData { + private final EntityPlayer player; + private boolean hasItem = false; + + private int checkTick = 0; + private boolean beaconInRangeCache; + + public MagicFeatherData(EntityPlayer player) { + this.player = player; + this.beaconInRangeCache = player.capabilities.allowFlying; + } + + public void onTick() { + + boolean hasItem = hasItem(player, ModItems.itemMagicFeather); + if (hasItem != this.hasItem) { + if (hasItem) { + this.onAdd(); + } + + if (!hasItem) { + this.onRemove(); + } + + this.hasItem = hasItem; + return; + } + + boolean mayFly = player.capabilities.isCreativeMode || (hasItem && checkBeaconInRange(player)); + setMayFly(player, mayFly); + } + + private void onAdd() { + if (!ItemMagicFeather.isInBeaconRange(player)) { + return; + } + + setMayFly(player, true); + } + + private void onRemove() { + if (player.capabilities.isCreativeMode) { + return; + } + + setMayFly(player, false); + } + + private boolean checkBeaconInRange(EntityPlayer player) { + + if (checkTick++ % 40 != 0) { + return beaconInRangeCache; + } + + beaconInRangeCache = ItemMagicFeather.isInBeaconRange(player); + + return beaconInRangeCache; + } + } + +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java b/src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java new file mode 100644 index 0000000000..fa31f68389 --- /dev/null +++ b/src/main/java/gtPlusPlus/core/potion/GtPotionEffect.java @@ -0,0 +1,11 @@ +package gtPlusPlus.core.potion; + +import net.minecraft.potion.PotionEffect; + +public class GtPotionEffect extends PotionEffect { + + public GtPotionEffect(int aPotionID, int aDurationInSecs, int aLevel) { + super(aPotionID, aDurationInSecs * 20, aLevel, false); + } + +} diff --git a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java index 7573e0d51c..ef5db6e4e0 100644 --- a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java @@ -135,6 +135,19 @@ public class MathUtils { public static double findPercentage(final double current, final double max){ return Math.round(((current / max) * 100) * 100.00) / 100.00; } + + /** + * Returns a percentage. + * The returned number is the % of X in Y. + * Supports Floats. + * + * @param current Current value. + * @param max Maximim value. Must be greater than min. + * @return double between min and max, inclusive. + */ + public static float findPercentage(final float current, final float max){ + return (float) (Math.round(((current / max) * 100) * 100.00) / 100.00); + } public static int findPercentageOfInt(long input, float percentage){ return (int)(input*(percentage/100.0f)); 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 d1cf088d39..fef721839b 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 @@ -76,7 +76,7 @@ public class GTPP_Propolis extends Item { 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)) { + if (addProcess(tDrop, aProp.mMaterial.getDust(1), Math.min(Math.max(10000-(aProp.mMaterial.vTier*625), 100), 10000), aProp.mMaterial.vTier * 20 * 15, aProp.mMaterial.vVoltageMultiplier)) { Logger.BEES("Added Propolis extraction recipe for: "+aProp.getName()); } else { diff --git a/src/main/resources/assets/miscutils/textures/items/magicfeather.png b/src/main/resources/assets/miscutils/textures/items/magicfeather.png new file mode 100644 index 0000000000..634529b925 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/items/magicfeather.png differ -- cgit From e77484a62ce2a5c20a6c731147aed7f38098f35d Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 29 Jan 2022 16:59:59 +0000 Subject: Added new crop. Added Wireless Charger locking. Fixed Cyclotron leaving bad input stacks. Improve Block localization. --- .../core/block/base/BlockBaseModular.java | 55 ++++++++---------- .../core/item/base/itemblock/ItemBlockGtBlock.java | 62 ++++++++++++++++----- .../xmod/bartcrops/LoaderOfTheCrops.java | 2 + .../xmod/bartcrops/abstracts/BaseCrop.java | 2 +- .../xmod/bartcrops/crops/Crop_Force.java | 53 ++++++++++++++++++ .../basic/GregtechMetaWirelessCharger.java | 42 ++++++++++---- .../GregtechMetaTileEntity_Cyclotron.java | 1 + .../textures/blocks/crop/blockCrop.Force.1.png | Bin 0 -> 209 bytes .../textures/blocks/crop/blockCrop.Force.2.png | Bin 0 -> 547 bytes .../textures/blocks/crop/blockCrop.Force.3.png | Bin 0 -> 782 bytes .../textures/blocks/crop/blockCrop.Force.4.png | Bin 0 -> 701 bytes .../textures/blocks/crop/blockCrop.Force.5.png | Bin 0 -> 925 bytes 12 files changed, 162 insertions(+), 55 deletions(-) create mode 100644 src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java create mode 100644 src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.1.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.2.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.3.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.4.png create mode 100644 src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.5.png (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java index c0113e869b..035b13dfbf 100644 --- a/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java +++ b/src/main/java/gtPlusPlus/core/block/base/BlockBaseModular.java @@ -6,28 +6,27 @@ import java.util.Map; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.world.IBlockAccess; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; +import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.item.base.itemblock.ItemBlockGtBlock; -import gtPlusPlus.core.item.base.itemblock.ItemBlockGtFrameBox; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.world.IBlockAccess; public class BlockBaseModular extends BasicBlock { protected Material blockMaterial; protected int blockColour; - protected BlockTypes thisBlock; + public BlockTypes thisBlock; protected String thisBlockMaterial; protected final String thisBlockType; @@ -42,7 +41,7 @@ public class BlockBaseModular extends BasicBlock { registerComponent(); } - protected BlockBaseModular(final String unlocalizedName, final String blockMaterial, + protected BlockBaseModular(final String unlocalizedName, final String blockMaterialString, final net.minecraft.block.material.Material vanillaMaterial, final BlockTypes blockType, final int colour, final int miningLevel) { super(blockType, unlocalizedName, vanillaMaterial, miningLevel); @@ -50,33 +49,20 @@ public class BlockBaseModular extends BasicBlock { this.setBlockTextureName(CORE.MODID + ":" + blockType.getTexture()); this.blockColour = colour; this.thisBlock = blockType; - this.thisBlockMaterial = blockMaterial; + this.thisBlockMaterial = blockMaterialString; this.thisBlockType = blockType.name().toUpperCase(); this.setBlockName(this.GetProperName()); int fx = getBlockTypeMeta(); + //ItemBlockGtBlock.sNameCache.put("block."+blockMaterial.getUnlocalizedName()+"."+this.thisBlock.name().toLowerCase(), GetProperName()); + GameRegistry.registerBlock(this, ItemBlockGtBlock.class, Utils.sanitizeString(blockType.getTexture() + unlocalizedName)); if (fx == 0) { - GameRegistry.registerBlock(this, ItemBlockGtBlock.class, - Utils.sanitizeString(blockType.getTexture() + unlocalizedName)); - GT_OreDictUnificator.registerOre( - "block" + getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "") - .replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), - ItemUtils.getSimpleStack(this)); + GT_OreDictUnificator.registerOre("block" + thisBlockMaterial.replace(" ", ""), ItemUtils.getSimpleStack(this)); } else if (fx == 1) { - GameRegistry.registerBlock(this, ItemBlockGtBlock.class, - Utils.sanitizeString(blockType.getTexture() + unlocalizedName)); - GT_OreDictUnificator.registerOre( - "frameGt" + getUnlocalizedName().replace("tile.", "").replace("tile.BlockGtFrame", "") - .replace("-", "").replace("_", "").replace(" ", "").replace("FrameBox", ""), - ItemUtils.getSimpleStack(this)); + GT_OreDictUnificator.registerOre("frameGt" + thisBlockMaterial.replace(" ", ""), ItemUtils.getSimpleStack(this)); } else if (fx == 2) { - GameRegistry.registerBlock(this, ItemBlockGtBlock.class, - Utils.sanitizeString(blockType.getTexture() + unlocalizedName)); - GT_OreDictUnificator.registerOre( - "block" + getUnlocalizedName().replace("tile.block", "").replace("tile.", "").replace("of", "") - .replace("Of", "").replace("Block", "").replace("-", "").replace("_", "").replace(" ", ""), - ItemUtils.getSimpleStack(this)); + GT_OreDictUnificator.registerOre("frameGt" + thisBlockMaterial.replace(" ", ""), ItemUtils.getSimpleStack(this)); } } @@ -135,7 +121,7 @@ public class BlockBaseModular extends BasicBlock { } public String GetProperName() { - String tempIngot; + String tempIngot = null; if (this.thisBlock == BlockTypes.STANDARD) { tempIngot = "Block of " + this.thisBlockMaterial; } @@ -145,13 +131,20 @@ public class BlockBaseModular extends BasicBlock { else if (this.thisBlock == BlockTypes.ORE) { tempIngot = this.thisBlockMaterial + " Ore [Old]"; } - else { - - tempIngot = this.getUnlocalizedName().replace("tile.blockGt", "ingot"); - } return tempIngot; } + @Override + public String getLocalizedName() { + String aFormattedLangName = GetProperName(); + return GT_LanguageManager.addStringLocalization("block."+blockMaterial.getUnlocalizedName()+"."+this.thisBlock.name().toLowerCase()+".name", aFormattedLangName); + } + + @Override + public String getUnlocalizedName() { + return "block."+blockMaterial.getUnlocalizedName()+"."+this.thisBlock.name().toLowerCase(); + } + @Override public boolean isOpaqueCube() { return false; diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java index 396689ef63..af6f036942 100644 --- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java +++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockGtBlock.java @@ -1,30 +1,35 @@ package gtPlusPlus.core.item.base.itemblock; +import java.util.HashMap; import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; - +import gregtech.api.util.GT_LanguageManager; +import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.base.BlockBaseModular; import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialStack; -import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; public class ItemBlockGtBlock extends ItemBlock { + public static HashMap sNameCache = new HashMap(); + protected final int blockColour; private int sRadiation; private Material mMaterial; + protected BlockTypes thisBlockType; private final Block thisBlock; private boolean isOre = false; @@ -50,15 +55,46 @@ public class ItemBlockGtBlock extends ItemBlock { if (block instanceof BlockBaseModular){ BlockBaseModular g = (BlockBaseModular) block; this.mMaterial = g.getMaterialEx(); + this.thisBlockType = g.thisBlock; } else { this.mMaterial = null; + this.thisBlockType = BlockTypes.STANDARD; } - // GT_OreDictUnificator.registerOre("block"+block.getUnlocalizedName().replace("tile.block", - // "").replace("tile.", "").replace("of", "").replace("Of", "").replace("Block", - // "").replace("-", "").replace("_", "").replace(" ", ""), - // ItemUtils.getSimpleStack(this)); + } + + public int getBlockTypeMeta() { + if (this.thisBlockType.equals(BlockTypes.STANDARD)) { + return 0; + } + else if (this.thisBlockType.equals(BlockTypes.FRAME)) { + return 1; + } + else if (this.thisBlockType.equals(BlockTypes.ORE)) { + return 2; + } + return 0; + } + + public String getUnlocalizedBlockName() { + return "block."+mMaterial.getUnlocalizedName()+"."+this.thisBlockType.name().toLowerCase(); + } + + public String GetProperName() { + String tempIngot = sNameCache.get(getUnlocalizedBlockName()); + if (tempIngot == null) { + tempIngot = "BAD.UNLOCAL.NAME"; + } + return tempIngot; + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return this.thisBlock.getLocalizedName(); + //Logger.INFO("Unlocal Name: "+this.getUnlocalizedName()); + //String aFormattedLangName = GetProperName(); + //return GT_LanguageManager.addStringLocalization("block."+mMaterial.getUnlocalizedName()+"."+this.thisBlockType.name().toLowerCase()+".name", aFormattedLangName); } public int getRenderColor(final int aMeta) { diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java index 48813310d2..033aaac663 100644 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/LoaderOfTheCrops.java @@ -5,6 +5,7 @@ import java.util.List; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.bartcrops.crops.Crop_Force; import gtPlusPlus.xmod.bartcrops.crops.Crop_Hemp; import ic2.api.crops.CropCard; import ic2.api.crops.Crops; @@ -48,6 +49,7 @@ public class LoaderOfTheCrops { List p = new ArrayList(); p.add(new LoaderOfTheCrops(new Crop_Hemp(), new ItemStack(Item.getItemById(111), 3))); + p.add(new LoaderOfTheCrops(new Crop_Force(), new ItemStack(Item.getItemById(111), 3))); return p; } diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java index ca2a044564..0f590dcf2b 100644 --- a/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/abstracts/BaseCrop.java @@ -14,10 +14,10 @@ import net.minecraft.util.IIcon; import speiger.src.crops.api.ICropCardInfo; public abstract class BaseCrop extends CropCard implements ICropCardInfo { + @SideOnly(Side.CLIENT) public void registerSprites(IIconRegister iconRegister) { this.textures = new IIcon[this.maxSize()]; - for (int i = 1; i <= this.textures.length; ++i) { this.textures[i - 1] = iconRegister.registerIcon(CORE.MODID+":crop/blockCrop." + this.name() + "." + i); } diff --git a/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java new file mode 100644 index 0000000000..06238a4589 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/bartcrops/crops/Crop_Force.java @@ -0,0 +1,53 @@ +package gtPlusPlus.xmod.bartcrops.crops; + +import gtPlusPlus.core.material.ELEMENT.STANDALONE; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.preloader.CORE_Preloader; +import gtPlusPlus.xmod.bartcrops.abstracts.BaseAestheticCrop; +import ic2.api.crops.ICropTile; +import net.minecraft.item.ItemStack; + +public class Crop_Force extends BaseAestheticCrop { + + public int tier() { + return 4; + } + + public String name() { + return "Force"; + } + + public String discoveredBy() { + return "Alkalus"; + } + + public int growthDuration(ICropTile crop) { + int ret = 800; + + /*if (crop.isBlockBelow(Blocks.dirt) || crop.isBlockBelow(Blocks.flowing_water)) { + ret = 225; + }*/ + + if (CORE_Preloader.DEBUG_MODE) { + ret = 1; + } + + return ret; + } + + public String[] attributes() { + return new String[]{"Power", "Soil", "Yellow", "Gold"}; + } + + public ItemStack getGain(ICropTile crop) { + ItemStack ret = this.getDisplayItem(); + if (MathUtils.randInt(0, 10) > 8) { + ret = STANDALONE.FORCE.getNugget(MathUtils.randInt(4, 8)); + } + return ret; + } + + public ItemStack getDisplayItem() { + return STANDALONE.FORCE.getNugget(0); + } +} \ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index ffaa77a0be..c5e33c088d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -1,20 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; +import java.util.*; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.BaseMetaTileEntity; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.minecraft.BlockPos; @@ -24,12 +17,18 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.helpers.ChargingHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { private boolean mHasBeenMapped = false; private int mCurrentDimension = 0; public int mMode = 0; + public boolean mLocked = true; public GregtechMetaWirelessCharger(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription); @@ -42,6 +41,9 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public String[] getDescription() { return new String[] {this.mDescription, + "Can be locked to the owner by sneaking with a screwdriver", + "Can also be locked with a lock upgrade", + "", "3 Modes, Long-Range, Local and Mixed.", "Long-Range: Can supply 2A of power to a single player up to "+(GT_Values.V[this.mTier]*4)+"m away.", "Local: Can supply several Amps to each player within "+this.mTier*20+"m.", @@ -150,6 +152,11 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { mWirelessChargingMap.clear(); mLocalChargingMap.clear(); + if (aPlayer.isSneaking()) { + mLocked = !mLocked; + PlayerUtils.messagePlayer(aPlayer, mLocked ? "Locked to owner." : "Unlocked."); + } + if (!this.getBaseMetaTileEntity().getWorld().playerEntities.isEmpty()){ for (Object mTempPlayer : this.getBaseMetaTileEntity().getWorld().playerEntities){ if (mTempPlayer instanceof EntityPlayer || mTempPlayer instanceof EntityPlayerMP){ @@ -348,12 +355,14 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { @Override public void saveNBTData(final NBTTagCompound aNBT) { + aNBT.setBoolean("mLocked", this.mLocked); aNBT.setInteger("mMode", this.mMode); aNBT.setInteger("mCurrentDimension", this.mCurrentDimension); } @Override public void loadNBTData(final NBTTagCompound aNBT) { + this.mLocked = aNBT.getBoolean("mLocked"); this.mMode = aNBT.getInteger("mMode"); this.mCurrentDimension = aNBT.getInteger("mCurrentDimension"); } @@ -366,6 +375,19 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { private Map mWirelessChargingMap = new HashMap(); private Map mLocalChargingMap = new HashMap(); + + private boolean isValidPlayer(EntityPlayer aPlayer) { + BaseMetaTileEntity aTile = (BaseMetaTileEntity) this.getBaseMetaTileEntity(); + if (mLocked || ( aTile != null && aTile.privateAccess())) { + if (aPlayer.getUniqueID().equals(getBaseMetaTileEntity().getOwnerUuid())){ + return true; + } + else { + return false; + } + } + return true; + } @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { @@ -389,7 +411,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { if (this.mMode == 1 || this.mMode == 2){ int tempRange = (this.mMode == 1 ? this.mTier*20 : this.mTier*10); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){ - if (!mLocalChargingMap.containsKey(mTemp.getPersistentID())){ + if (isValidPlayer(mTemp) && !mLocalChargingMap.containsKey(mTemp.getPersistentID())){ mLocalChargingMap.put(mTemp.getPersistentID(), mTemp); ChargingHelper.addValidPlayer(mTemp, this); //PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m - Local]."); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index ecd4882516..7514a3dea6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -362,6 +362,7 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas this.mOutputItems = outputs; this.mOutputFluids = new FluidStack[] {tRecipe.getFluidOutput(0)}; + this.updateSlots(); return true; } } diff --git a/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.1.png b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.1.png new file mode 100644 index 0000000000..87b1b2b7d3 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.1.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.2.png b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.2.png new file mode 100644 index 0000000000..631045a936 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.2.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.3.png b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.3.png new file mode 100644 index 0000000000..e987c60374 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.3.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.4.png b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.4.png new file mode 100644 index 0000000000..67965b0c01 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.4.png differ diff --git a/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.5.png b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.5.png new file mode 100644 index 0000000000..c587e84b78 Binary files /dev/null and b/src/main/resources/assets/miscutils/textures/blocks/crop/blockCrop.Force.5.png differ -- cgit From b926dfb3bc67b74b53749a3e420a8a6ce0fba6a7 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 29 Jan 2022 18:49:30 +0000 Subject: Overhauled Matter Fabricator CPU. --- .../xmod/gregtech/api/gui/CONTAINER_MatterFab.java | 71 +++- .../xmod/gregtech/api/gui/GUI_MatterFab.java | 27 +- .../api/gui/basic/CONTAINER_PollutionCleaner.java | 1 + .../GregtechMetaTileEntity_MassFabricator.java | 439 +++++++++++++++++---- 4 files changed, 448 insertions(+), 90 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java index 808eb90728..93591b2aaf 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_MatterFab.java @@ -1,11 +1,15 @@ package gtPlusPlus.xmod.gregtech.api.gui; -import net.minecraft.entity.player.InventoryPlayer; +import java.util.Iterator; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_ContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.core.slots.SlotNoInput; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_MassFabricator; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! @@ -13,9 +17,12 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.Gr * The Container I use for all my Basic Machines */ public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine { - - public int mUUA_USED = ((GregtechMetaTileEntity_MassFabricator)this.mTileEntity.getMetaTileEntity()).getAmplifierUsed(); - public int mUUM_MADE = ((GregtechMetaTileEntity_MassFabricator)this.mTileEntity.getMetaTileEntity()).getMatterProduced(); + + public int mMatterProduced = 0; + public int mScrapProduced = 0; + public int mAmplifierProduced = 0; + public int mScrapUsed = 0; + public int mAmplifierUsed = 0; public CONTAINER_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); @@ -39,4 +46,58 @@ public class CONTAINER_MatterFab extends GT_ContainerMetaTile_Machine { public int getShiftClickSlotCount() { return 0; } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { + return; + } + GregtechMetaTileEntity_MassFabricator aTile = ((GregtechMetaTileEntity_MassFabricator)this.mTileEntity.getMetaTileEntity()); + + mAmplifierProduced = aTile.mAmplifierProduced; + mAmplifierUsed = aTile.mAmplifierUsed; + mMatterProduced = aTile.mMatterProduced; + mScrapProduced = aTile.mScrapProduced; + mScrapUsed = aTile.mScrapUsed; + + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting) var2.next(); + var1.sendProgressBarUpdate(this, 201, mAmplifierProduced); + var1.sendProgressBarUpdate(this, 202, mAmplifierUsed); + var1.sendProgressBarUpdate(this, 203, mMatterProduced); + var1.sendProgressBarUpdate(this, 204, mScrapProduced); + var1.sendProgressBarUpdate(this, 205, mScrapUsed); + } + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 201: + mAmplifierProduced = (par2); + break; + case 202: + mAmplifierUsed = (par2); + break; + case 203: + mMatterProduced = (par2); + break; + case 204: + mScrapProduced = (par2); + break; + case 205: + mScrapUsed = (par2); + break; + } + } + } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java index 95bde9fd9f..653a177285 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java @@ -5,7 +5,7 @@ import net.minecraft.entity.player.InventoryPlayer; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; /** @@ -18,8 +18,11 @@ import gtPlusPlus.core.lib.CORE; public class GUI_MatterFab extends GT_GUIContainerMetaTile_Machine { String mName = ""; - int uuaUsed = 0; - int uumMade = 0; + public int mMatterProduced = 0; + public int mScrapProduced = 0; + public int mAmplifierProduced = 0; + public int mScrapUsed = 0; + public int mAmplifierUsed = 0; public GUI_MatterFab(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aTextureFile) { super(new CONTAINER_MatterFab(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + (aTextureFile == null ? "MultiblockDisplay" : aTextureFile)); @@ -61,11 +64,21 @@ public class GUI_MatterFab extends GT_GUIContainerMetaTile_Machine { this.fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255); this.fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255); } else { - this.uuaUsed = ((CONTAINER_MatterFab) this.mContainer).mUUA_USED; - this.uumMade = ((CONTAINER_MatterFab) this.mContainer).mUUM_MADE; + CONTAINER_MatterFab aContainer = (CONTAINER_MatterFab) this.mContainer; + + this.mMatterProduced = aContainer.mMatterProduced; + this.mAmplifierProduced = aContainer.mAmplifierProduced; + this.mAmplifierUsed = aContainer.mAmplifierUsed; + this.mScrapProduced = aContainer.mScrapProduced; + this.mScrapUsed = aContainer.mScrapUsed; + this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255); - this.fontRendererObj.drawString("UU-Amplifier Used: "+this.uuaUsed, 10, 24, 16448255); - this.fontRendererObj.drawString("UU-Matter Fabricated: "+this.uumMade, 10, 32, 16448255); + + this.fontRendererObj.drawString("Scrap Produced: "+this.mScrapProduced, 10, 32, 16448255); + this.fontRendererObj.drawString("Scrap Used: "+this.mScrapUsed, 10, 40, 16448255); + this.fontRendererObj.drawString("UU-Amplifier Produced: "+this.mAmplifierProduced, 10, 48, 16448255); + this.fontRendererObj.drawString("UU-Amplifier Used: "+this.mAmplifierUsed, 10, 56, 16448255); + this.fontRendererObj.drawString("UU-Matter Fabricated: "+this.mMatterProduced, 10, 64, 16448255); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java index 79d1033bd0..e4dc7835cb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/CONTAINER_PollutionCleaner.java @@ -58,6 +58,7 @@ public class CONTAINER_PollutionCleaner extends GT_Container_BasicTank { super.detectAndSendChanges(); if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return; + Logger.INFO("TEST"); mReduction = ((GregtechMetaAtmosphericReconditioner) mTileEntity.getMetaTileEntity()).mPollutionReduction; Iterator var2 = this.crafters.iterator(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index f016288547..31fcc41cf4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -1,8 +1,5 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; -import java.util.ArrayList; -import java.util.Collection; - import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.enums.ConfigCategories; @@ -17,14 +14,17 @@ import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.minecraft.*; +import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MatterFab; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MatterFab; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import ic2.core.Ic2Items; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -34,6 +34,11 @@ import net.minecraftforge.fluids.FluidStack; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; + +import java.util.*; + +import org.apache.commons.lang3.ArrayUtils; public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlockBase { @@ -41,11 +46,11 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo public static int sUUASpeedBonus = 4; public static int sDurationMultiplier = 3200; - private int mMatterProduced = 0; - private int mScrapProduced = 0; - private int mAmplifierProduced = 0; - private int mScrapUsed = 0; - private int mAmplifierUsed = 0; + public int mMatterProduced = 0; + public int mScrapProduced = 0; + public int mAmplifierProduced = 0; + public int mScrapUsed = 0; + public int mAmplifierUsed = 0; public static String mCasingName1 = "Matter Fabricator Casing"; public static String mCasingName2 = "Containment Casing"; @@ -71,6 +76,10 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo return this.mMatterProduced; } + public int getScrapProduced(){ + return this.mScrapProduced; + } + public GregtechMetaTileEntity_MassFabricator(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); mCasingName1 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 9); @@ -144,24 +153,16 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo return "MatterFabricator"; } - public static ItemStack getScrapPile() { - if (mScrap[0] == null) { - mScrap[0] = ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrap")); - } - return mScrap[0]; - } - public static ItemStack getScrapBox() { - if (mScrap[1] == null) { - mScrap[1] = ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrapbox")); - } - return mScrap[1]; - } - @Override public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { return new GUI_MatterFab(aPlayerInventory, aBaseMetaTileEntity, this.getLocalName(), "MatterFabricator.png"); } + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new CONTAINER_MatterFab(aPlayerInventory, aBaseMetaTileEntity); + } + @Override public void onConfigLoad(final GT_Config aConfig) { super.onConfigLoad(aConfig); @@ -178,9 +179,30 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo ArrayList tFluids = getStoredFluids(); ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); + init(); return checkRecipeGeneric(tItemInputs, tFluidInputs, 4, 80, 00, 100); } + public static boolean sInit = false; + + public static void init() { + if (!sInit) { + if (mScrap[0] == null) { + mScrap[0] = ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrap")); + } + if (mScrap[1] == null) { + mScrap[1] = ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrapbox")); + } + if (mUU[0] == null) { + mUU[0] = Materials.UUAmplifier.getFluid(100); + } + if (mUU[1] == null) { + mUU[1] = Materials.UUMatter.getFluid(100); + } + sInit = true; + } + } + @Override public IStructureDefinition getStructureDefinition() { if (STRUCTURE_DEFINITION == null) { @@ -282,28 +304,6 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo return new GregtechMetaTileEntity_MassFabricator(this.mName); } - public boolean doesHatchContainUUA() { - if (mUU[0] == null) { - mUU[0] = Materials.UUAmplifier.getFluid(100); - } - if (mUU[1] == null) { - mUU[1] = Materials.UUMatter.getFluid(100); - } - - if (mUU[0] != null && mUU[1] != null) { - for (GT_MetaTileEntity_Hatch_Input g : this.mInputHatches) { - if (g.getFluid() != null) { - if (g.mFluid.isFluidEqual(mUU[0])) { - return true; - } - } - } - } - - return false; - } - - /** * Special Recipe Handling */ @@ -316,49 +316,332 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo } @Override - public boolean checkRecipeGeneric( + public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { + if (this.mMode == MODE_SCRAP) { + return checkRecipeScrap(aItemInputs, aFluidInputs, getMaxParallelRecipes(), aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); + } + else { + return checkRecipeUU(aItemInputs, aFluidInputs, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll); + } + } + + public boolean checkRecipeScrap( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll) { + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); + ItemStack aPotentialOutput = GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(1, aItemInputs[0]), 0); + GT_Recipe tRecipe = new GTPP_Recipe(false, new ItemStack[]{GT_Utility.copyAmount(1, aItemInputs[0])}, aPotentialOutput == null ? null : new ItemStack[]{aPotentialOutput}, null, new int[]{2000}, null, null, 40, MaterialUtils.getVoltageForTier(1), 0); + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { + log("BAD RETURN - 2"); + return false; + } + + int parallelRecipes = 0; + // Count recipes to do in parallel, consuming input items and fluids and + // considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + break; + } + log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + ". "); + tTotalEUt += tRecipeEUt; + } + log("Broke at " + parallelRecipes + "."); + if (parallelRecipes > 0) { + // -- Try not to fail after this point - inputs have already been + // consumed! -- + + // Convert speed bonus to duration multiplier + // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe + // duration. + aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); + float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); + this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor); + this.mEUt = (int) Math.ceil(tTotalEUt); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + // Overclock + if (this.mEUt <= 16) { + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); + } + else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 4; + } + } + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOutputItems[h] = tRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + // Set output item stack sizes (taking output chance into account) + for (int f = 0; f < tOutputItems.length; f++) { + if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + for (int g = 0; g < parallelRecipes; g++) { + if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) + tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + tOutputItems = removeNulls(tOutputItems); + for (ItemStack aOutputStack : tOutputItems) { + if (aOutputStack != null) { + mScrapProduced += aOutputStack.stackSize; + } + } + // Sanitize item stack size, splitting any stacks greater than max + // stack size + List splitStacks = new ArrayList(); + for (ItemStack tItem : tOutputItems) { + while (tItem.getMaxStackSize() < tItem.stackSize) { + ItemStack tmp = tItem.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + splitStacks.add(tmp); + } + } + if (splitStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[splitStacks.size()]; + tmp = splitStacks.toArray(tmp); + tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); + } + // Strip empty stacks + List tSList = new ArrayList(); + for (ItemStack tS : tOutputItems) { + if (tS.stackSize > 0) + tSList.add(tS); + } + tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + // Commit outputs + this.mOutputItems = tOutputItems; + updateSlots(); + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + log("" + mScrapProduced); + return true; + } + return false; + } + + public boolean checkRecipeUU( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll) { + int aSpeedBonusPercent, int aOutputChanceRoll) { - if (this.mMode == MODE_SCRAP) { - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - long tEnergy = getMaxInputEnergy(); - GT_Recipe c = new GTPP_Recipe(false, new ItemStack[] { GT_Utility.copyAmount(1, aItemInputs[0]) }, - GT_ModHandler.getRecyclerOutput(GT_Utility.copyAmount(64, aItemInputs[0]), 0) == null ? null - : new ItemStack[] { ItemList.IC2_Scrap.get(1) }, - null, new int[] { 2000 }, null, null, 100, - (int) gregtech.api.enums.GT_Values.V[2], 0); - - // EU discount - float tRecipeEUt = (c.mEUt * aEUPercent) / 100.0f; - float tTotalEUt = 0.0f; - - int parallelRecipes = 0; - // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { - if (!c.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { - log("Broke at "+parallelRecipes+"."); - break; + // Based on the Processing Array. A bit overkill, but very flexible. + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); + log("Running checkRecipeGeneric(0)"); + + GT_Recipe tRecipe = findRecipe( + getBaseMetaTileEntity(), mLastRecipe, false, + gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); + + log("Running checkRecipeGeneric(1)"); + // Remember last recipe - an optimization for findRecipe() + this.mLastRecipe = tRecipe; + + if (tRecipe == null) { + log("BAD RETURN - 1"); + return false; + } + + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { + log("BAD RETURN - 2"); + return false; + } + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + + int parallelRecipes = 0; + + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, true, aFluidInputs, aItemInputs)) { + log("Broke at "+parallelRecipes+"."); + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + + if (parallelRecipes == 0) { + log("BAD RETURN - 3"); + return false; + } + + // -- Try not to fail after this point - inputs have already been consumed! -- + + + + // Convert speed bonus to duration multiplier + // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. + aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); + float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); + this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor); + + this.mEUt = (int)Math.ceil(tTotalEUt); + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + // Overclock + if (this.mEUt <= 16) { + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); + } else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 4; + } + } + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + // Collect fluid outputs + FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { + if (tRecipe.getFluidOutput(h) != null) { + tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); + tOutputFluids[h].amount *= parallelRecipes; + } + } + + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOutputItems[h] = tRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + + // Set output item stack sizes (taking output chance into account) + for (int f = 0; f < tOutputItems.length; f++) { + if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + for (int g = 0; g < parallelRecipes; g++) { + if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) + tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; } - log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); - tTotalEUt += tRecipeEUt; } + } - if (parallelRecipes == 0) { - this.mEUt = (int) gregtech.api.enums.GT_Values.V[tTier]; - this.mMaxProgresstime = 10; - return true; + tOutputItems = removeNulls(tOutputItems); + + + int aMatterProduced = 0; + int aAmplifierProduced = 0; + int aScrapUsed = 0; + int aAmplifierUsed = 0; + + for (int i=0; i splitStacks = new ArrayList(); + for (ItemStack tItem : tOutputItems) { + while (tItem.getMaxStackSize() < tItem.stackSize) { + ItemStack tmp = tItem.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + splitStacks.add(tmp); + } + } + + if (splitStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[splitStacks.size()]; + tmp = splitStacks.toArray(tmp); + tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); } + + // Strip empty stacks + List tSList = new ArrayList(); + for (ItemStack tS : tOutputItems) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + + // Commit outputs + this.mOutputItems = tOutputItems; + this.mOutputFluids = tOutputFluids; - //Return normal Recipe handling - return super.checkRecipeGeneric(aItemInputs, aFluidInputs, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll, true); - } + updateSlots(); + + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + log("GOOD RETURN - 1"); + return true; + + } @Override public int getMaxParallelRecipes() { -- cgit From 30d153e9552251a95bc0ba5fa8c6edc920c07941 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 29 Jan 2022 19:49:15 +0000 Subject: GUI Fixes for Matter Fab. --- .../xmod/gregtech/api/gui/GUI_MatterFab.java | 8 ++--- .../GregtechMetaTileEntity_MassFabricator.java | 35 ++++++++-------------- 2 files changed, 16 insertions(+), 27 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java index 653a177285..f7869bff60 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MatterFab.java @@ -74,11 +74,11 @@ public class GUI_MatterFab extends GT_GUIContainerMetaTile_Machine { this.fontRendererObj.drawString("Running perfectly.", 10, 16, 16448255); - this.fontRendererObj.drawString("Scrap Produced: "+this.mScrapProduced, 10, 32, 16448255); + this.fontRendererObj.drawString("Scrap Made: "+this.mScrapProduced, 10, 32, 16448255); this.fontRendererObj.drawString("Scrap Used: "+this.mScrapUsed, 10, 40, 16448255); - this.fontRendererObj.drawString("UU-Amplifier Produced: "+this.mAmplifierProduced, 10, 48, 16448255); - this.fontRendererObj.drawString("UU-Amplifier Used: "+this.mAmplifierUsed, 10, 56, 16448255); - this.fontRendererObj.drawString("UU-Matter Fabricated: "+this.mMatterProduced, 10, 64, 16448255); + this.fontRendererObj.drawString("UUA Made: "+this.mAmplifierProduced, 10, 48, 16448255); + this.fontRendererObj.drawString("UUA Used: "+this.mAmplifierUsed, 10, 56, 16448255); + this.fontRendererObj.drawString("UUM Made: "+this.mMatterProduced, 10, 64, 16448255); } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index 177d1690cf..253d70d275 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -1,15 +1,17 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; -import java.util.ArrayList; -import java.util.Collection; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; + +import java.util.*; + +import org.apache.commons.lang3.ArrayUtils; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.TAE; -import gregtech.api.enums.Textures; + +import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -17,9 +19,7 @@ import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.*; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.*; @@ -27,23 +27,13 @@ import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_MatterFab; import gtPlusPlus.xmod.gregtech.api.gui.GUI_MatterFab; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import ic2.core.Ic2Items; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; - -import java.util.*; - -import org.apache.commons.lang3.ArrayUtils; - -public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlockBase { public static int sUUAperUUM = 1; public static int sUUASpeedBonus = 4; @@ -307,7 +297,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo @Override public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { if (this.mMode == MODE_SCRAP) { - return checkRecipeScrap(aItemInputs, aFluidInputs, getMaxParallelRecipes(), aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); + return checkRecipeScrap(aItemInputs, aFluidInputs, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll); } else { return checkRecipeUU(aItemInputs, aFluidInputs, getMaxParallelRecipes(), getEuDiscountForParallelism(), aSpeedBonusPercent, aOutputChanceRoll); @@ -425,7 +415,6 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo updateSlots(); // Play sounds (GT++ addition - GT multiblocks play no sounds) startProcess(); - log("" + mScrapProduced); return true; } return false; @@ -483,13 +472,13 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { if (!tRecipe.isRecipeInputEqual(true, true, aFluidInputs, aItemInputs)) { - log("Broke at "+parallelRecipes+"."); break; } log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); tTotalEUt += tRecipeEUt; } + log("Broke at "+parallelRecipes+"."); if (parallelRecipes == 0) { log("BAD RETURN - 3"); return false; -- cgit From 1d983706ef427b1d008787843ac23529e43cc659 Mon Sep 17 00:00:00 2001 From: Alkalus <3060479+draknyte1@users.noreply.github.com> Date: Sat, 29 Jan 2022 19:55:05 +0000 Subject: Minor Clean-up/Regression. --- .../handler/events/PlayerSleepEventHandler.java | 39 ++-------------------- .../basic/GregtechMetaWirelessCharger.java | 16 ++++----- 2 files changed, 11 insertions(+), 44 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java index c36344d805..10677c12db 100644 --- a/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/events/PlayerSleepEventHandler.java @@ -1,8 +1,8 @@ package gtPlusPlus.core.handler.events; import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gtPlusPlus.api.objects.Logger; @@ -20,6 +20,7 @@ import net.minecraftforge.event.entity.player.PlayerWakeUpEvent; public class PlayerSleepEventHandler { + private static Field sEffectDuration = ReflectionUtils.getField(PotionEffect.class, "duration"); private static ArrayList sPositiveEffects = new ArrayList(); private static ArrayList sNegativeEffects = new ArrayList(); @@ -102,38 +103,4 @@ public class PlayerSleepEventHandler { PlayerUtils.messagePlayer(aPlayer, new ChatComponentTranslation(aChatKey, new Object[0])); } - private static Field sEffectDuration = ReflectionUtils.getField(PotionEffect.class, "duration"); - private static Field sActivePotionEffects = ReflectionUtils.getField(EntityPlayer.class, "activePotionsMap"); - private static Method sOnFinishedPotionEffect = ReflectionUtils.getMethod(EntityPlayer.class, "onFinishedPotionEffect", PotionEffect.class); - - public boolean curePotionEffect(EntityPlayer aPlayer, Potion aPotion) { - HashMap activePotionsMap = new HashMap(); - try { - activePotionsMap = ReflectionUtils.getFieldValue(sActivePotionEffects, aPlayer); - } - catch (Throwable t) { - t.printStackTrace(); - } - if (aPlayer != null && aPotion != null && activePotionsMap != null && activePotionsMap.size() > 0) { - Iterator potionKey = activePotionsMap.keySet().iterator(); - if (!aPlayer.worldObj.isRemote) { - while (potionKey.hasNext()) { - try { - Integer key = potionKey.next(); - PotionEffect effect = (PotionEffect) activePotionsMap.get(key); - if (effect.getPotionID() == aPotion.getId()) { - potionKey.remove(); - ReflectionUtils.invokeVoid(aPlayer, sOnFinishedPotionEffect, new Object[]{effect}); - return true; - } - } - catch (ConcurrentModificationException e) { - e.printStackTrace(); - } - } - } - } - return false; - } - } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index 92cbddfdba..6f0176da25 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -410,15 +410,15 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { if (this.mMode == 1 || this.mMode == 2){ int tempRange = (this.mMode == 1 ? this.mTier*20 : this.mTier*10); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){ - if (isValidPlayer(mTemp) && !mLocalChargingMap.containsKey(mTemp.getPersistentID())){ + if (isValidPlayer(mTemp) && !mLocalChargingMap.containsKey(mTemp.getDisplayName())){ mLocalChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID()); ChargingHelper.addValidPlayer(mTemp, this); //PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m - Local]."); } } else { - if (mLocalChargingMap.containsKey(mTemp.getPersistentID())){ - if (mLocalChargingMap.remove(mTemp.getPersistentID()) != null){ + if (mLocalChargingMap.containsKey(mTemp.getDisplayName())){ + if (mLocalChargingMap.remove(mTemp.getDisplayName()) != null){ //PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m - Local]."); ChargingHelper.removeValidPlayer(mTemp, this); } @@ -428,7 +428,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { if (this.mMode == 0 || this.mMode == 2){ int tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) <= tempRange){ - if (!mWirelessChargingMap.containsKey(mTemp)){ + if (!mWirelessChargingMap.containsKey(mTemp.getDisplayName())){ if (isValidPlayer(mTemp)) { mWirelessChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID()); ChargingHelper.addValidPlayer(mTemp, this); @@ -437,15 +437,15 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } } else { - if (mWirelessChargingMap.containsKey(mTemp)){ - if (mWirelessChargingMap.remove(mTemp) != null){ + if (mWirelessChargingMap.containsKey(mTemp.getDisplayName())){ + if (mWirelessChargingMap.remove(mTemp.getDisplayName()) != null){ PlayerUtils.messagePlayer(mTemp, "You have left charging range. ["+tempRange+"m - Long Range]."); ChargingHelper.removeValidPlayer(mTemp, this); } } } - if (mWirelessChargingMap.containsKey(mTemp) && !mTemp.getDisplayName().equalsIgnoreCase(this.getBaseMetaTileEntity().getOwnerName())){ - if (mWirelessChargingMap.remove(mTemp) != null){ + if (mWirelessChargingMap.containsKey(mTemp.getDisplayName())){ + if (mWirelessChargingMap.remove(mTemp.getDisplayName()) != null){ ChargingHelper.removeValidPlayer(mTemp, this); } } -- cgit