From ffd6f2ca946345cbfc903c1ac1aff9e22219f841 Mon Sep 17 00:00:00 2001 From: MysteriousAges Date: Thu, 12 Sep 2013 19:33:08 -0700 Subject: [PATCH] TC4 & AM2 integration progress! <3 --- magicbees_res/assets/magicbees/lang/en_US.xml | 31 ++- magicbees_res/changelog.txt | 3 +- magicbees_src/magicbees/bees/Allele.java | 3 +- .../magicbees/bees/BeeGenomeManager.java | 14 - magicbees_src/magicbees/bees/BeeMutation.java | 1 - magicbees_src/magicbees/bees/BeeSpecies.java | 39 ++- .../bees/FlowerProviderArsMagicaFlower.java | 35 ++- .../magicbees/block/types/HiveType.java | 2 + .../magicbees/item/ItemThaumiumGrafter.java | 3 +- .../magicbees/item/ItemThaumiumScoop.java | 3 +- .../magicbees/item/types/CombType.java | 8 +- .../magicbees/item/types/PropolisType.java | 4 +- .../magicbees/item/types/ResourceType.java | 4 +- magicbees_src/magicbees/main/Config.java | 26 +- magicbees_src/magicbees/main/MagicBees.java | 32 +-- .../magicbees/main/utils/CraftingManager.java | 66 +++-- .../main/utils/compat/ArsMagicaHelper.java | 54 +++- .../main/utils/compat/ForestryHelper.java | 7 +- .../main/utils/compat/ThaumcraftHelper.java | 253 ++++++++++++++++-- 19 files changed, 441 insertions(+), 147 deletions(-) diff --git a/magicbees_res/assets/magicbees/lang/en_US.xml b/magicbees_res/assets/magicbees/lang/en_US.xml index 37945b5..c935f57 100644 --- a/magicbees_res/assets/magicbees/lang/en_US.xml +++ b/magicbees_res/assets/magicbees/lang/en_US.xml @@ -33,12 +33,12 @@ Furtive Comb Memory Comb Temporal Comb - Harmonizing Comb Windy Comb Firey Comb Watery Comb Earthy Comb - Infused Comb + Ordered Comb + Entropic Comb Essence Comb Potent Comb @@ -67,12 +67,12 @@ Apatite Shard - Dull Propolis + Ordered Propolis Breezey Propolis Burning Propolis Flowing Propolis Stony Propolis - Infused Propolis + Chaotic Propolis Unstable Propolis @@ -88,6 +88,12 @@ Essence of Lost Time Essence of Everlasting Durability Essence of Unending Disregard + Air Infused Dust + Fire Infused Dust + Water Infused Dust + Earth Infused Dust + Order Infused Dust + Chaos Infused Dust Bees and Magic Crystalized %s Aspect @@ -413,9 +419,18 @@ These bees have an increased affinity for aspected magic.|Apinomicon - Apimancy - Apimancy - Adding some sparkle to your buzz. - Don't get too excited. This is just a test. + Apimancy + + Apimancy + [MB] Adding some sparkle to your buzz. + Don't get too excited.##lineBreak##This is just a test. + + Thaumium Scoop + [MB] Handled with care. + Normal scoops are fragile, and prone to breakage. As an authority in Apimancy, you can do better. By adding some Thaumium to the handle, and lacing it with a measure of order, your new scoop will last up to three times longer!##lineBreak##In addition, the Thaumium in the device will accept the Repair enchantment. + + Thaumium Grafter + [MB] Saplings for every occasion. + Simple grafters are almost uselessly fragile, and while Proven Grafters are useful, the rarity of emeralds makes them annoying to procure. The solution? Make it yourself!##lineBreak##The Thaumium Grafter, like the Thaumium Scoop, is a tougher, enchantable version of the most basic of the Arborimancer's tools. Use caution though, for although the Repair enchantment can be applied to the grafter, its unusual properties make it exhausting to use. diff --git a/magicbees_res/changelog.txt b/magicbees_res/changelog.txt index 09918b4..223beea 100644 --- a/magicbees_res/changelog.txt +++ b/magicbees_res/changelog.txt @@ -1,7 +1,8 @@ 2.1.4 Some cleanup of Helper code Hammering out rest of Transmutation effect, and exposing parts of it in an API so other people can hook into it if they want. -Trying out tying in Thaumcraft 4 stuff. +Have some Ars Magica 2 integration. +Also have some Thaumcraft 4 integration. 2.1.3 Added a new mini bee branch: Polymorphic. It is said Unusual bees can have some unusual effects on the world if they are advanced... diff --git a/magicbees_src/magicbees/bees/Allele.java b/magicbees_src/magicbees/bees/Allele.java index 9a38888..753830d 100644 --- a/magicbees_src/magicbees/bees/Allele.java +++ b/magicbees_src/magicbees/bees/Allele.java @@ -190,7 +190,8 @@ public class Allele implements IAllele registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesBlitz", BeeSpecies.AM_LIGHTNING); registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesStaude", BeeSpecies.AM_PLANT); registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesEis", BeeSpecies.AM_ICE); - registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMagma", BeeSpecies.AM_MAGMA); + registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesMagma", BeeSpecies.AM_FIRE); + registry.registerDeprecatedAlleleReplacement("magicbees.speciesMagma", BeeSpecies.AM_FIRE); registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesArkanen", BeeSpecies.AM_ARCANE); registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesVortex", BeeSpecies.AM_VORTEX); registry.registerDeprecatedAlleleReplacement("thaumicbees.speciesWight", BeeSpecies.AM_WIGHT); diff --git a/magicbees_src/magicbees/bees/BeeGenomeManager.java b/magicbees_src/magicbees/bees/BeeGenomeManager.java index 1ff64a9..bac4ac1 100644 --- a/magicbees_src/magicbees/bees/BeeGenomeManager.java +++ b/magicbees_src/magicbees/bees/BeeGenomeManager.java @@ -1138,20 +1138,6 @@ public class BeeGenomeManager return genome; } - public static IAllele[] getTemplateAMMagma() - { - IAllele[] genome = getTemplateAMBase(); - - genome[EnumBeeChromosome.SPECIES.ordinal()] = BeeSpecies.AM_MAGMA; - genome[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = Allele.getBaseAllele("toleranceDown2"); - genome[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = Allele.getBaseAllele("boolTrue"); - genome[EnumBeeChromosome.LIFESPAN.ordinal()] = Allele.getBaseAllele("lifespanElongated"); - genome[EnumBeeChromosome.EFFECT.ordinal()] = Allele.getBaseAllele("effectIgnition"); - - return genome; - } - public static IAllele[] getTemplateAMArcane() { IAllele[] genome = getTemplateAMBase(); diff --git a/magicbees_src/magicbees/bees/BeeMutation.java b/magicbees_src/magicbees/bees/BeeMutation.java index 86b4bd9..7cb4533 100644 --- a/magicbees_src/magicbees/bees/BeeMutation.java +++ b/magicbees_src/magicbees/bees/BeeMutation.java @@ -221,7 +221,6 @@ public class BeeMutation implements IBeeMutation new BeeMutation(BeeSpecies.WINDY, BeeSpecies.AM_AIR, BeeSpecies.AM_LIGHTNING, 8); new BeeMutation(BeeSpecies.EARTHY, BeeSpecies.AM_EARTH, BeeSpecies.AM_PLANT, 8); - new BeeMutation(BeeSpecies.FIREY, BeeSpecies.AM_FIRE, BeeSpecies.AM_MAGMA, 8); new BeeMutation(BeeSpecies.WATERY, BeeSpecies.AM_WATER, BeeSpecies.AM_ICE, 8); new BeeMutation(BeeSpecies.SKULKING, BeeSpecies.AM_ESSENCE, BeeSpecies.AM_VORTEX, 8); diff --git a/magicbees_src/magicbees/bees/BeeSpecies.java b/magicbees_src/magicbees/bees/BeeSpecies.java index 58ec0a1..1efc81f 100644 --- a/magicbees_src/magicbees/bees/BeeSpecies.java +++ b/magicbees_src/magicbees/bees/BeeSpecies.java @@ -230,8 +230,8 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider BeeClassification.ESSENTIAL, 0x49B549, 0xE3A55B, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false), AM_ICE("AMIce", "magica glacium", BeeClassification.ESSENTIAL, 0x86BAC6, 0xE3A55B, EnumTemperature.COLD, EnumHumidity.NORMAL, false, false), - AM_MAGMA("AMMagma", "magica torrens igneus", - BeeClassification.ESSENTIAL, 0x932B1E, 0xE3A55B, EnumTemperature.HELLISH, EnumHumidity.ARID, false, false), + //AM_MAGMA("AMMagma", "magica torrens igneus", + // BeeClassification.ESSENTIAL, 0x932B1E, 0xE3A55B, EnumTemperature.HELLISH, EnumHumidity.ARID, false, false), AM_ARCANE("AMArcane", "magica arcanum", BeeClassification.ESSENTIAL, 0x76184D, 0xE3A55B, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false), @@ -294,18 +294,17 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider if (ArsMagicaHelper.isActive()) { - AM_QUINTESSENCE.addSpecialty(new ItemStack(Config.amArcaneCompound), 5); - AM_EARTH.addSpecialty(new ItemStack(Config.amEssenceEarth), 7); - AM_AIR.addSpecialty(new ItemStack(Config.amEssenceAir), 7); - AM_FIRE.addSpecialty(new ItemStack(Config.amEssenceFire), 7); - AM_WATER.addSpecialty(new ItemStack(Config.amEssenceWater), 7); - AM_LIGHTNING.addSpecialty(new ItemStack(Config.amEssenceLightning), 7); - AM_PLANT.addSpecialty(new ItemStack(Config.amEssencePlant), 7); - AM_ICE.addSpecialty(new ItemStack(Config.amEssenceIce), 7); - AM_MAGMA.addSpecialty(new ItemStack(Config.amEssenceMagma), 7); - AM_ARCANE.addSpecialty(new ItemStack(Config.amEssenceArcane), 11); - AM_VORTEX.addSpecialty(new ItemStack(Config.amArcaneCompound), 15); - AM_WIGHT.addSpecialty(new ItemStack(Item.enderPearl), 11); + AM_QUINTESSENCE.addSpecialty(new ItemStack(Config.amItemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), 5); + AM_EARTH.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 7); + AM_AIR.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.AIR.ordinal()), 7); + AM_FIRE.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.FIRE.ordinal()), 7); + AM_WATER.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.WATER.ordinal()), 7); + AM_LIGHTNING.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.LIGHTNING.ordinal()), 7); + AM_PLANT.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()), 7); + AM_ICE.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.ICE.ordinal()), 7); + AM_ARCANE.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.ARCANE.ordinal()), 11); + AM_VORTEX.addSpecialty(new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), 15); + AM_WIGHT.addSpecialty(new ItemStack(Config.amItemResource, 1, ArsMagicaHelper.ResourceType.ARCANE_COMPOUND.ordinal()), 11); } else { @@ -318,7 +317,6 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider AM_LIGHTNING.setInactive(); AM_PLANT.setInactive(); AM_ICE.setInactive(); - AM_MAGMA.setInactive(); AM_ARCANE.setInactive(); AM_VORTEX.setInactive(); AM_WIGHT.setInactive(); @@ -599,13 +597,13 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider .register(); - TC_CHAOS.addProduct(Config.combs.getStackForType(CombType.HARMONIZING), 10) + TC_CHAOS.addProduct(Config.combs.getStackForType(CombType.CHAOS), 20) .setGenome(BeeGenomeManager.getTemplateTCStark()) .register(); - TC_AIR.addProduct(Config.combs.getStackForType(CombType.AIRY), 10) + TC_AIR.addProduct(Config.combs.getStackForType(CombType.AIRY), 20) .setGenome(BeeGenomeManager.getTemplateTCAir()) .register(); - TC_FIRE.addProduct(Config.combs.getStackForType(CombType.FIREY), 15) + TC_FIRE.addProduct(Config.combs.getStackForType(CombType.FIREY), 20) .setGenome(BeeGenomeManager.getTemplateTCFire()) .register(); TC_WATER.addProduct(Config.combs.getStackForType(CombType.WATERY), 20) @@ -614,7 +612,7 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider TC_EARTH.addProduct(Config.combs.getStackForType(CombType.EARTHY), 20) .setGenome(BeeGenomeManager.getTemplateTCEarth()) .register(); - TC_ORDER.addProduct(Config.combs.getStackForType(CombType.INFUSED), 20) + TC_ORDER.addProduct(Config.combs.getStackForType(CombType.ORDER), 20) .setGenome(BeeGenomeManager.getTemplateTCMagic()) .register(); @@ -689,9 +687,6 @@ public enum BeeSpecies implements IAlleleBeeSpecies, IIconProvider AM_ICE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 12) .setGenome(BeeGenomeManager.getTemplateAMIce()) .register(); - AM_MAGMA.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 12) - .setGenome(BeeGenomeManager.getTemplateAMMagma()) - .register(); AM_ARCANE.addProduct(Config.combs.getStackForType(CombType.AM_POTENT), 19) .setGenome(BeeGenomeManager.getTemplateAMArcane()) .register(); diff --git a/magicbees_src/magicbees/bees/FlowerProviderArsMagicaFlower.java b/magicbees_src/magicbees/bees/FlowerProviderArsMagicaFlower.java index b5d7b80..9e6a177 100644 --- a/magicbees_src/magicbees/bees/FlowerProviderArsMagicaFlower.java +++ b/magicbees_src/magicbees/bees/FlowerProviderArsMagicaFlower.java @@ -11,14 +11,18 @@ import forestry.api.genetics.IPollinatable; public class FlowerProviderArsMagicaFlower implements IFlowerProvider { - private ItemStack[] flowers = {new ItemStack(Config.amBlackOrchid), new ItemStack(Config.amDesertNova) }; + private ItemStack[] flowers = {new ItemStack(Config.amBlackOrchid), new ItemStack(Config.amDesertNova), + new ItemStack(Config.amAum), new ItemStack(Config.amWakebloom), + new ItemStack(Config.amTarmaRoot) }; @Override public boolean isAcceptedFlower(World world, IIndividual genome, int x, int y, int z) { boolean flag = false; int id = world.getBlockId(x, y, z); - if (id == Config.amBlackOrchid.blockID || id == Config.amDesertNova.blockID) + if (id == Config.amBlackOrchid.blockID || id == Config.amDesertNova.blockID || + id == Config.amAum.blockID || id == Config.amWakebloom.blockID || + id == Config.amTarmaRoot.blockID) { flag = true; } @@ -29,12 +33,27 @@ public class FlowerProviderArsMagicaFlower implements IFlowerProvider public boolean growFlower(World world, IIndividual genome, int x, int y, int z) { boolean flag = false; + x = -222; y = 70; z = -51; int blockDown = world.getBlockId(x, y - 1, z); if (world.getBlockId(x, y, z) == 0) { if (blockDown == Block.dirt.blockID || blockDown == Block.grass.blockID) { - world.setBlock(x, y, z, Config.amBlackOrchid.blockID); + int dart = world.rand.nextInt(100); + int id; + if (dart > 60) + { + id = Config.amBlackOrchid.blockID; + } + else if (dart > 30) + { + id = Config.amAum.blockID; + } + else + { + id = Config.amTarmaRoot.blockID; + } + world.setBlock(x, y, z, id); flag = true; } else if (blockDown == Block.sand.blockID) @@ -42,6 +61,16 @@ public class FlowerProviderArsMagicaFlower implements IFlowerProvider world.setBlock(x, y, z, Config.amDesertNova.blockID); flag = true; } + else if (blockDown == Block.stone.blockID) + { + world.setBlock(x, y, z, Config.amTarmaRoot.blockID); + flag = true; + } + else if (blockDown == Block.waterMoving.blockID || blockDown == Block.waterStill.blockID) + { + world.setBlock(x, y, z, Config.amWakebloom.blockID); + flag = true; + } } return flag; } diff --git a/magicbees_src/magicbees/block/types/HiveType.java b/magicbees_src/magicbees/block/types/HiveType.java index 903e5f3..ee78c44 100644 --- a/magicbees_src/magicbees/block/types/HiveType.java +++ b/magicbees_src/magicbees/block/types/HiveType.java @@ -4,7 +4,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Random; +import magicbees.bees.Allele; import magicbees.bees.BeeGenomeManager; +import magicbees.bees.BeeManager; import magicbees.bees.BeeSpecies; import magicbees.bees.HiveDrop; import magicbees.item.types.CombType; diff --git a/magicbees_src/magicbees/item/ItemThaumiumGrafter.java b/magicbees_src/magicbees/item/ItemThaumiumGrafter.java index 4f2e5a7..a25a9a5 100644 --- a/magicbees_src/magicbees/item/ItemThaumiumGrafter.java +++ b/magicbees_src/magicbees/item/ItemThaumiumGrafter.java @@ -24,8 +24,7 @@ public class ItemThaumiumGrafter extends Item implements IRepairableExtended, IT this.setMaxStackSize(1); this.setMaxDamage(15); this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture); - this.setUnlocalizedName(VersionInfo.ModName.toLowerCase() + ":thaumiumGrafter"); - GameRegistry.registerItem(this, VersionInfo.ModName.toLowerCase() + ":thaumiumGrafter"); + this.setUnlocalizedName(this.iconString = VersionInfo.ModName.toLowerCase() + ":thaumiumGrafter"); } @Override diff --git a/magicbees_src/magicbees/item/ItemThaumiumScoop.java b/magicbees_src/magicbees/item/ItemThaumiumScoop.java index 1904a97..c52902e 100644 --- a/magicbees_src/magicbees/item/ItemThaumiumScoop.java +++ b/magicbees_src/magicbees/item/ItemThaumiumScoop.java @@ -20,8 +20,7 @@ public class ItemThaumiumScoop extends Item implements IRepairable, IToolScoop this.setMaxStackSize(1); this.setMaxDamage(30); this.setCreativeTab(forestry.api.core.Tabs.tabApiculture); - this.setUnlocalizedName(VersionInfo.ModName.toLowerCase() + ":thaumiumScoop"); - GameRegistry.registerItem(this, VersionInfo.ModName.toLowerCase() + ":thaumiumScoop"); + this.setUnlocalizedName(this.iconString = VersionInfo.ModName.toLowerCase() + ":thaumiumScoop"); } @Override diff --git a/magicbees_src/magicbees/item/types/CombType.java b/magicbees_src/magicbees/item/types/CombType.java index f713e1a..fc0590d 100644 --- a/magicbees_src/magicbees/item/types/CombType.java +++ b/magicbees_src/magicbees/item/types/CombType.java @@ -17,12 +17,12 @@ public enum CombType INTELLECT("aware", false), TEMPORAL("time", false), - HARMONIZING("harmonizing", false), AIRY("air", false), FIREY("fire", false), WATERY("water", false), EARTHY("earth", false), - INFUSED("magic", false), + ORDER("order", false), + CHAOS("chaos", false), AM_ESSENCE("essence", false), AM_POTENT("potent", false), @@ -41,12 +41,12 @@ public enum CombType {0x0092e9, 0x618fff}, {0x2F9381, 0x773C31}, - {0xB0B0BC, 0x414144}, {0xffff7e, 0x606308}, {0xff3C01, 0x5B0D10}, {0x0090ff, 0x102F6B}, {0x00a000, 0x043004}, - {0xAB12E2, 0x502868}, + {0xDDDDFF, 0x9D9DB5}, + {0x555577, 0x2D2D56}, {0xCC8604, 0x41046F}, {0xCCCC04, 0x41046F}, diff --git a/magicbees_src/magicbees/item/types/PropolisType.java b/magicbees_src/magicbees/item/types/PropolisType.java index ff10dd2..2275d2f 100644 --- a/magicbees_src/magicbees/item/types/PropolisType.java +++ b/magicbees_src/magicbees/item/types/PropolisType.java @@ -5,12 +5,12 @@ import cpw.mods.fml.common.registry.LanguageRegistry; public enum PropolisType { - STARK("dull", 0xBBBBBB), AIR("air", 0xA19E10), FIRE("fire", 0x95132F), WATER("water", 0x1054A1), EARTH("earth", 0x00a000), - INFUSED("magic", 0xaa32fc), + ORDER("dull", 0xDDDDFF), + CHAOS("magic", 0x555577), UNSTABLE("unstable", 0xEFB492), ; diff --git a/magicbees_src/magicbees/item/types/ResourceType.java b/magicbees_src/magicbees/item/types/ResourceType.java index 7ce5019..27c17e2 100644 --- a/magicbees_src/magicbees/item/types/ResourceType.java +++ b/magicbees_src/magicbees/item/types/ResourceType.java @@ -22,7 +22,7 @@ public enum ResourceType z_3("", false), z_4("", false), z_5("", false), - DIMENSIONAL_SINGULARITY("dimensionalSingularity", true), + DIMENSIONAL_SINGULARITY("dimensionalSingularity", false), TC_DUST_AIR("TCairDust", true), TC_DUST_WATER("TCwaterDust", true), TC_DUST_FIRE("TCfireDust", true), @@ -32,7 +32,7 @@ public enum ResourceType // Dummy items for Thaumanomicon research icons. - // These won't ever actually exist in-game, and so + // These won't ever actually exist in-game, and so they can be moved around. RESEARCH_STARTNODE("startNode", false), RESEARCH_BEEINFUSION("beeInfusion", false), ; diff --git a/magicbees_src/magicbees/main/Config.java b/magicbees_src/magicbees/main/Config.java index d882562..e03b6f3 100644 --- a/magicbees_src/magicbees/main/Config.java +++ b/magicbees_src/magicbees/main/Config.java @@ -113,6 +113,7 @@ public class Config public static BackpackDefinition thaumaturgeBackpackDef; //----- Forestry Blocks ------------------------------------ + public static Block fHiveBlock; public static Block fAlvearyBlock; //----- Forestry Items ------------------------------------- public static Item fBeeComb; @@ -144,20 +145,15 @@ public class Config //----- Equivalent Exchange Items -------------------------- public static Item eeMinuimShard; //----- Ars Magica Blocks ---------------------------------- + public static Block amResourceBlock; public static Block amBlackOrchid; public static Block amDesertNova; + public static Block amAum; + public static Block amWakebloom; + public static Block amTarmaRoot; //----- Ars Magica Items ----------------------------------- - public static Item amVinteumDust; - public static Item amArcaneCompound; - public static Item amEssenceArcane; - public static Item amEssenceEarth; - public static Item amEssenceWater; - public static Item amEssenceFire; - public static Item amEssenceAir; - public static Item amEssenceMagma; - public static Item amEssencePlant; - public static Item amEssenceIce; - public static Item amEssenceLightning; + public static Item amItemResource; + public static Item amEssence; //----- Config State info ---------------------------------- @@ -184,7 +180,7 @@ public class Config int slabFullId = configuration.getBlock("slabFull", blockIdBase++).getInt(); int slabHalfId = configuration.getBlock("slabHalf", blockIdBase++).getInt(); - if (ThaumcraftHelper.isActive()) + /*if (ThaumcraftHelper.isActive()) { planksWood = new BlockPlanks(plankId); planksWood.setUnlocalizedName("planks"); @@ -208,7 +204,7 @@ public class Config OreDictionary.registerOre("plankWood", new ItemStack(planksWood, 1, -1)); OreDictionary.registerOre("slabWood", new ItemStack(slabWoodHalf, 1, -1)); - } + }*/ } effectJar = new BlockEffectJar(configuration.getBlock("effectJar", blockIdBase++).getInt()); @@ -275,10 +271,10 @@ public class Config { int crystalId = configuration.getItem("fluxCrystal", itemIDBase++).getInt() - 256; - if (ThaumcraftHelper.isActive()) + /*if (ThaumcraftHelper.isActive()) { solidFlux = new ItemCrystalAspect(crystalId); - } + }*/ } hiveFrameMagic = new ItemMagicHiveFrame(configuration.getItem("frameMagic", itemIDBase++).getInt() - 256, HiveFrameType.MAGIC); diff --git a/magicbees_src/magicbees/main/MagicBees.java b/magicbees_src/magicbees/main/MagicBees.java index d18e0c5..35f839b 100644 --- a/magicbees_src/magicbees/main/MagicBees.java +++ b/magicbees_src/magicbees/main/MagicBees.java @@ -49,6 +49,13 @@ public class MagicBees @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { + // Compatibility Helpers setup time. + ForestryHelper.preInit(); + ExtraBeesHelper.preInit(); + ThaumcraftHelper.preInit(); + EquivalentExchangeHelper.preInit(); + ArsMagicaHelper.preInit(); + this.configsPath = event.getModConfigurationDirectory().getAbsolutePath(); this.modConfig = new Config(event.getSuggestedConfigurationFile()); this.modConfig.setupBlocks(); @@ -57,30 +64,29 @@ public class MagicBees LocalizationManager.setupLocalizationInfo(); new TransmutationEffectController(); - - // Compatibility Helpers setup time. - ForestryHelper.preInit(); - ExtraBeesHelper.preInit(); - ThaumcraftHelper.preInit(); - EquivalentExchangeHelper.preInit(); - ArsMagicaHelper.preInit(); } @Mod.EventHandler public void init(FMLInitializationEvent event) - { - GameRegistry.registerWorldGenerator(worldHandler = new WorldGeneratorHandler()); - + { ForestryHelper.init(); ExtraBeesHelper.init(); ThaumcraftHelper.init(); EquivalentExchangeHelper.init(); ArsMagicaHelper.init(); + + GameRegistry.registerWorldGenerator(worldHandler = new WorldGeneratorHandler()); } @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { + ForestryHelper.postInit(); + ExtraBeesHelper.postInit(); + ThaumcraftHelper.postInit(); + EquivalentExchangeHelper.postInit(); + ArsMagicaHelper.postInit(); + this.guiHandler = new GUIHandler(); NetworkRegistry.instance().registerGuiHandler(this, this.guiHandler); @@ -93,12 +99,6 @@ public class MagicBees CraftingManager.setupCrafting(); VersionInfo.doVersionCheck(); - - ForestryHelper.postInit(); - ExtraBeesHelper.postInit(); - ThaumcraftHelper.postInit(); - EquivalentExchangeHelper.postInit(); - ArsMagicaHelper.postInit(); } @Mod.EventHandler diff --git a/magicbees_src/magicbees/main/utils/CraftingManager.java b/magicbees_src/magicbees/main/utils/CraftingManager.java index d645fcb..d38946c 100644 --- a/magicbees_src/magicbees/main/utils/CraftingManager.java +++ b/magicbees_src/magicbees/main/utils/CraftingManager.java @@ -7,6 +7,7 @@ import magicbees.item.types.DropType; import magicbees.item.types.FluidType; import magicbees.item.types.NuggetType; import magicbees.item.types.PollenType; +import magicbees.item.types.PropolisType; import magicbees.item.types.ResourceType; import magicbees.item.types.WaxType; import magicbees.main.Config; @@ -326,7 +327,7 @@ public class CraftingManager if (ThaumcraftHelper.isActive()) { // Slabs - for (int i = 0; i < PlankType.values().length; ++i) + /*for (int i = 0; i < PlankType.values().length; ++i) { input = new ItemStack(Config.planksWood, 1, i); output = new ItemStack(Config.slabWoodHalf, 6, i); @@ -334,7 +335,7 @@ public class CraftingManager "PPP", 'P', input }); - } + }*/ // Essentia bottles /*output = new ItemStack(Config.tcEssentiaBottle); @@ -388,7 +389,11 @@ public class CraftingManager input = ItemInterface.getItem("apatite"); output = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER, 4); GameRegistry.addShapelessRecipe(output, new Object[] { - new ItemStack(Config.amEssenceEarth), new ItemStack(Config.amEssencePlant), + new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.EARTH.ordinal()), + input, input + }); + GameRegistry.addShapelessRecipe(output, new Object[] { + new ItemStack(Config.amEssence, 1, ArsMagicaHelper.EssenceType.PLANT.ordinal()), input, input }); } @@ -422,8 +427,9 @@ public class CraftingManager RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.INTELLECT), new ItemStack[] { Config.wax.getStackForType(WaxType.MAGIC), ItemInterface.getItem("honeydew"), Config.drops.getStackForType(DropType.INTELLECT) }, new int[] { 90, 40, 10 }); + propolis.setItemDamage(ForestryHelper.Propolis.NORMAL.ordinal()); RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FURTIVE), - new ItemStack[] {ItemInterface.getItem("beeswax"), ItemInterface.getItem("propolis"), ItemInterface.getItem("honeydew") }, + new ItemStack[] {ItemInterface.getItem("beeswax"), propolis, ItemInterface.getItem("honeydew") }, new int[] { 90, 20, 35 }); RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.SOUL), new ItemStack[] {Config.wax.getStackForType(WaxType.SOUL), ItemInterface.getItem("honeydew") }, @@ -431,35 +437,53 @@ public class CraftingManager RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.TEMPORAL), new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.pollen.getStackForType(PollenType.PHASED), new ItemStack(Config.fHoneydew, 1)}, new int[] {100, 5, 60}); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.HARMONIZING), - new ItemStack[] {ItemInterface.getItem("beeswax"), Config.wax.getStackForType(WaxType.MAGIC) }, - new int[] { 10, 95, 10 }); RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AIRY), - new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC) }, - new int[] { 100 }); + new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.propolis.getStackForType(PropolisType.AIR) }, + new int[] { 100, 60 }); RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.FIREY), - new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC) }, - new int[] { 100 }); + new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.propolis.getStackForType(PropolisType.FIRE) }, + new int[] { 100, 60 }); RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.WATERY), - new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC) }, - new int[] { 100 }); + new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.propolis.getStackForType(PropolisType.WATER) }, + new int[] { 100, 60 }); RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.EARTHY), - new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC) }, - new int[] { 100 }); - RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.INFUSED), - new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.wax.getStackForType(WaxType.MAGIC) }, - new int[] { 100, 50 }); + new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.propolis.getStackForType(PropolisType.EARTH) }, + new int[] { 100, 60 }); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.ORDER), + new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.propolis.getStackForType(PropolisType.ORDER) }, + new int[] { 100, 60 }); + RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.CHAOS), + new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), Config.propolis.getStackForType(PropolisType.CHAOS) }, + new int[] { 100, 60 }); RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AM_POTENT), new ItemStack[] {ItemInterface.getItem("beeswax"), ItemInterface.getItem("refractoryWax"), ItemInterface.getItem("honeydew") }, new int[] { 50, 50, 65 } ); - - // if (ThaumcraftHelper.isActive()) { } + + + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.AIR), + new ItemStack[] {propolis, Config.miscResources.getStackForType(ResourceType.TC_DUST_AIR) }, + new int[] { 100, 65 } ); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.FIRE), + new ItemStack[] {propolis, Config.miscResources.getStackForType(ResourceType.TC_DUST_FIRE) }, + new int[] { 100, 65 } ); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.WATER), + new ItemStack[] {propolis, Config.miscResources.getStackForType(ResourceType.TC_DUST_WATER) }, + new int[] { 100, 65 } ); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.EARTH), + new ItemStack[] {propolis, Config.miscResources.getStackForType(ResourceType.TC_DUST_EARTH) }, + new int[] { 100, 65 } ); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.ORDER), + new ItemStack[] {propolis, Config.miscResources.getStackForType(ResourceType.TC_DUST_ORDER) }, + new int[] { 100, 65 } ); + RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.CHAOS), + new ItemStack[] {propolis, Config.miscResources.getStackForType(ResourceType.TC_DUST_CHAOS) }, + new int[] { 100, 65 } ); if (ArsMagicaHelper.isActive()) { RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.AM_ESSENCE), - new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), new ItemStack(Config.amVinteumDust), new ItemStack(Config.amVinteumDust) }, + new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), new ItemStack(Config.amItemResource), new ItemStack(Config.amItemResource) }, new int[] { 85, 10, 2 } ); } } diff --git a/magicbees_src/magicbees/main/utils/compat/ArsMagicaHelper.java b/magicbees_src/magicbees/main/utils/compat/ArsMagicaHelper.java index 4803010..4c7da17 100644 --- a/magicbees_src/magicbees/main/utils/compat/ArsMagicaHelper.java +++ b/magicbees_src/magicbees/main/utils/compat/ArsMagicaHelper.java @@ -7,7 +7,37 @@ import cpw.mods.fml.common.Loader; public class ArsMagicaHelper { + public enum ResourceType + { + VINTEUM_DUST, + ARCANE_COMPOUND, + ARCANE_ASH, + PURIFIED_VINTEUM, + CHIMERITE, + BLUE_TOPAZ, + SUNSTONE, + MOONSTONE, + } + + public enum EssenceType + { + ARCANE, + EARTH, + AIR, + FIRE, + WATER, + PLANT, + ICE, + LIGHTNING, + LIFE, + ENDER, + PURE, + HIGH, + BASE, + } + private static boolean isArsMagicaPresent = false; + private static final String Name = "arsmagica2"; public static boolean isActive() { @@ -16,7 +46,7 @@ public class ArsMagicaHelper public static void preInit() { - if (Loader.isModLoaded("ArsMagica")) + if (Loader.isModLoaded(Name)) { isArsMagicaPresent = true; } @@ -29,6 +59,7 @@ public class ArsMagicaHelper getBlocks(); getItems(); } + } public static void postInit() {} @@ -37,9 +68,13 @@ public class ArsMagicaHelper { try { - Class clazz = Class.forName("mithion.arsmagica.blocks.ArsMagicaBlocksCommonProxy"); + Class clazz = Class.forName("am2.blocks.BlocksCommonProxy"); + Config.amResourceBlock = (Block)(clazz.getField("AMOres").get(null)); Config.amBlackOrchid = (Block)(clazz.getField("blueOrchid").get(null)); Config.amDesertNova = (Block)(clazz.getField("desertNova").get(null)); + Config.amAum = (Block)(clazz.getField("aum").get(null)); + Config.amWakebloom = (Block)(clazz.getField("wakebloom").get(null)); + Config.amTarmaRoot = (Block)(clazz.getField("tarmaRoot").get(null)); } catch (Exception e) { @@ -51,18 +86,9 @@ public class ArsMagicaHelper { try { - Class clazz = Class.forName("mithion.arsmagica.items.ArsMagicaItemsCommonProxy"); - Config.amVinteumDust = (Item)(clazz.getField("vinteumDust").get(null)); - Config.amArcaneCompound = (Item)(clazz.getField("arcaneCompound").get(null)); - Config.amEssenceAir = (Item)(clazz.getField("airEssence").get(null)); - Config.amEssenceArcane = (Item)(clazz.getField("arcaneEssence").get(null)); - Config.amEssenceEarth = (Item)(clazz.getField("earthEssence").get(null)); - Config.amEssenceFire = (Item)(clazz.getField("fireEssence").get(null)); - Config.amEssenceIce = (Item)(clazz.getField("iceEssence").get(null)); - Config.amEssenceLightning = (Item)(clazz.getField("lightningEssence").get(null)); - Config.amEssenceMagma = (Item)(clazz.getField("magmaEssence").get(null)); - Config.amEssencePlant = (Item)(clazz.getField("plantEssence").get(null)); - Config.amEssenceWater = (Item)(clazz.getField("waterEssence").get(null)); + Class clazz = Class.forName("am2.items.ItemsCommonProxy"); + Config.amItemResource = (Item)(clazz.getField("itemOre").get(null)); + Config.amEssence = (Item)(clazz.getField("essence").get(null)); } catch (Exception e) { diff --git a/magicbees_src/magicbees/main/utils/compat/ForestryHelper.java b/magicbees_src/magicbees/main/utils/compat/ForestryHelper.java index 73328d6..600be6a 100644 --- a/magicbees_src/magicbees/main/utils/compat/ForestryHelper.java +++ b/magicbees_src/magicbees/main/utils/compat/ForestryHelper.java @@ -2,6 +2,7 @@ package magicbees.main.utils.compat; import java.lang.reflect.Method; +import magicbees.bees.BeeManager; import magicbees.main.Config; import net.minecraft.block.Block; import cpw.mods.fml.common.FMLLog; @@ -113,6 +114,7 @@ public class ForestryHelper { Class c = Class.forName("forestry.core.config.ForestryBlock"); Config.fAlvearyBlock = (Block)(c.getField("alveary").get(null)); + Config.fHiveBlock = (Block)(c.getField("beehives").get(null)); } catch (Exception e) { @@ -131,7 +133,7 @@ public class ForestryHelper public static IAllele[] getTemplateForestryForSpecies(String speciesName) { - IAllele[] template = null; + /*IAllele[] template = null; try { //BeeTemplates.getValiantTemplate() @@ -144,7 +146,8 @@ public class ForestryHelper FMLLog.severe("Could not get Forestry template for %s.", speciesName); e.printStackTrace(); } - return template; + return template;*/ + return BeeManager.beeRoot.getTemplate("forestry.species" + speciesName); } public static EnumTemperature getEnumTemperatureFromValue(float rawTemp) diff --git a/magicbees_src/magicbees/main/utils/compat/ThaumcraftHelper.java b/magicbees_src/magicbees/main/utils/compat/ThaumcraftHelper.java index 68eebab..a98dfed 100644 --- a/magicbees_src/magicbees/main/utils/compat/ThaumcraftHelper.java +++ b/magicbees_src/magicbees/main/utils/compat/ThaumcraftHelper.java @@ -1,11 +1,21 @@ package magicbees.main.utils.compat; +import magicbees.item.types.PollenType; +import magicbees.item.types.PropolisType; import magicbees.item.types.ResourceType; +import magicbees.item.types.WaxType; import magicbees.main.CommonProxy; import magicbees.main.Config; import magicbees.main.MagicBees; +import magicbees.main.utils.LocalizationManager; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import thaumcraft.api.ThaumcraftApi; +import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; +import thaumcraft.api.crafting.IArcaneRecipe; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; @@ -99,8 +109,8 @@ public class ThaumcraftHelper ; } + public static final String Name = "Thaumcraft"; private static boolean isThaumcraftPresent = false; - public static final String Name = "Thaumcraft_"; public static boolean isActive() { @@ -112,7 +122,6 @@ public class ThaumcraftHelper if (cpw.mods.fml.common.Loader.isModLoaded(Name)) { isThaumcraftPresent = true; - //registerResearchXML(); } else { @@ -129,24 +138,25 @@ public class ThaumcraftHelper public static void init() { - if (isActive()) - { - getBlocks(); - getItems(); - - //addItemsToBackpack(); - } + //if (isActive()) { } } public static void postInit() { if (isActive()) { + // Apparently the Game Registry isn't populated until now. ): + getBlocks(); + getItems(); + + //addItemsToBackpack(); + setupItemAspects(); + setupCrafting(); setupResearch(); } } - public static void getBlocks() + private static void getBlocks() { Config.tcPlant = GameRegistry.findBlock(Name, "blockCustomPlant"); Config.tcCandle = GameRegistry.findBlock(Name, "blockCandle"); @@ -158,7 +168,7 @@ public class ThaumcraftHelper Config.tcWarded = GameRegistry.findBlock(Name, "blockWarded"); } - public static void getItems() + private static void getItems() { Config.tcFilledJar = GameRegistry.findItem(Name, "BlockJarFilledItem"); Config.tcMiscResource = GameRegistry.findItem(Name, "ItemResource"); @@ -169,11 +179,11 @@ public class ThaumcraftHelper Config.tcNuggets = GameRegistry.findItem(Name, "ItemNugget"); Config.tcShard = GameRegistry.findItem(Name, "ItemShard"); Config.tcNuggetChicken = GameRegistry.findItem(Name, "ItemNuggetChicken"); - Config.tcNuggetBeef = GameRegistry.findItem(Name, "itemNuggetBeef"); - Config.tcNuggetPork = GameRegistry.findItem(Name, "itemNuggetPork"); + Config.tcNuggetBeef = GameRegistry.findItem(Name, "ItemNuggetBeef"); + Config.tcNuggetPork = GameRegistry.findItem(Name, "ItemNuggetPork"); } - public static void addItemsToBackpack() + private static void addItemsToBackpack() { if (MagicBees.getConfig().AddThaumcraftItemsToBackpacks) { @@ -210,14 +220,223 @@ public class ThaumcraftHelper } } - public static void setupResearch() + private static IArcaneRecipe thaumScoop; + private static IArcaneRecipe thaumGrafter; + + private static void setupCrafting() + { + ItemStack input, output; + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_AIR); + output = new ItemStack(Config.tcShard, 1, ShardType.AIR.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_WATER); + output = new ItemStack(Config.tcShard, 1, ShardType.WATER.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_FIRE); + output = new ItemStack(Config.tcShard, 1, ShardType.FIRE.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_EARTH); + output = new ItemStack(Config.tcShard, 1, ShardType.EARTH.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_ORDER); + output = new ItemStack(Config.tcShard, 1, ShardType.ORDER.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + input = Config.miscResources.getStackForType(ResourceType.TC_DUST_CHAOS); + output = new ItemStack(Config.tcShard, 1, ShardType.CHAOS.ordinal()); + GameRegistry.addShapelessRecipe(output, input, input, input, input); + + thaumScoop = ThaumcraftApi.addArcaneCraftingRecipe("MB_Scoop", new ItemStack(Config.thaumiumScoop), + new AspectList().add(Aspect.ORDER, 2), new Object[] { + "sWs", "sTs", " T ", + 's', Item.stick, + 'W', Block.cloth, + 'T', new ItemStack(Config.tcMiscResource, 1, MiscResource.THAUMIUM.ordinal()) + }); + + thaumGrafter = ThaumcraftApi.addArcaneCraftingRecipe("MB_Grafter", new ItemStack(Config.thaumiumGrafter), + new AspectList().add(Aspect.ORDER, 5), new Object[] { + " T", " s ", "s ", + 's', Item.stick, + 'T', new ItemStack(Config.tcMiscResource, 1, MiscResource.THAUMIUM.ordinal()) + }); + + } + + private static void setupResearch() { ResearchCategories.registerCategory("MAGICBEES", new ResourceLocation("magicbees", CommonProxy.ITEM_TEXTURE + "beeInfusion.png"), new ResourceLocation("thaumcraft", "textures/gui/gui_researchback.png")); - ResearchItem startNode = new ResearchItem("MAGICBEES_ROOT", "MAGICBEES", new AspectList(), 0, 0, 0, + ResearchItem startNode = new ResearchItem("MB_Root", "MAGICBEES", new AspectList(), + 0, 0, 0, Config.miscResources.getStackForType(ResourceType.RESEARCH_BEEINFUSION)) .setAutoUnlock() - .setPages(new ResearchPage[] { new ResearchPage("mb.researchPage.MBRoot.1") }) + .setPages(new ResearchPage[] { new ResearchPage(getResearchPage("MB_Root.1")) }) + .registerResearchItem(); + + ResearchItem thaumiumScoop = new ResearchItem("MB_Scoop", "MAGICBEES", new AspectList().add(Aspect.TOOL, 1), + 2, -2, 1, + new ItemStack(Config.thaumiumScoop)) + .setPages(new ResearchPage[] { new ResearchPage(getResearchPage("MB_Scoop.1")), new ResearchPage(thaumScoop) }) + .setParents("MB_Root") + .setParentsHidden("THAUMIUM") + .registerResearchItem(); + + ResearchItem thaumiumGrafter = new ResearchItem("MB_Grafter", "MAGICBEES", new AspectList().add(Aspect.TOOL, 2).add(Aspect.TREE, 1).add(Aspect.GREED, 1), + 4, -3, 4, + new ItemStack(Config.thaumiumGrafter)) + .setPages(new ResearchPage[] { new ResearchPage(getResearchPage("MB_Grafter.1")), new ResearchPage(thaumGrafter) }) + .setParents("MB_Scoop") .registerResearchItem(); } + + private static String getResearchPage(String ident) + { + // Helps get around all the stupid XML Doctype restrictions. + return LocalizationManager.getLocalizedString("tc.research_page." + ident) + .replaceAll("##lineBreak##", "
") + .replaceAll("##horizontalRule##", "") + .replaceAll("##img##", "") + .replaceAll("##/img##", ""); + } + + private static void setupItemAspects() + { + ItemStack item; + AspectList list; + + list = new AspectList(Block.wood.blockID, 0); + for (int i = 1; i <= 8; i++) + { + item = forestry.api.core.BlockInterface.getBlock("log" + i); + if (item != null) + { + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + } + } + + list = new AspectList(Block.planks.blockID, 0); + for (int i = 1; i <= 2; i++) + { + item = forestry.api.core.BlockInterface.getBlock("planks" + i); + if (item != null) + { + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + } + } + + list = new AspectList().add(Aspect.ORDER, 5).add(Aspect.ARMOR, 2).add(Aspect.BEAST, 1); + item = new ItemStack(Config.fHiveBlock); + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + ThaumcraftApi.registerObjectTag(Config.hive.blockID, -1, list); + + list = new AspectList().add(Aspect.LIGHT, 1); + item = forestry.api.core.BlockInterface.getBlock("candle"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + + list = new AspectList().add(Aspect.DARKNESS, 1); + item = forestry.api.core.BlockInterface.getBlock("stump"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + + list = new AspectList(Block.glass.blockID, 0).add(Aspect.SENSES, 1); + item = forestry.api.core.BlockInterface.getBlock("glass"); + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + + list = new AspectList().add(Aspect.EARTH, 2).add(Aspect.WATER, 2); + item = forestry.api.core.BlockInterface.getBlock("soil"); + ThaumcraftApi.registerObjectTag(item.itemID, 1, list); + + list = new AspectList(Block.leaves.blockID, 0); + item = forestry.api.core.BlockInterface.getBlock("leaves"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + + list = new AspectList(Block.sapling.blockID, 0); + item = forestry.api.core.BlockInterface.getBlock("saplingGE"); + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + + list = new AspectList().add(Aspect.SEED, 1).add(Aspect.PLANT, 1); + item = forestry.api.core.ItemInterface.getItem("pollenFertile"); + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + + list = new AspectList().add(Aspect.CRYSTAL, 1).add(Aspect.EARTH, 2); + item = forestry.api.core.BlockInterface.getBlock("resources"); + ThaumcraftApi.registerObjectTag(item.itemID, ForestryHelper.BlockResource.APATITE.ordinal(), list.copy().add(Aspect.STONE, 2)); + item = forestry.api.core.ItemInterface.getItem("apatite"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list.copy().add(Aspect.CRYSTAL, 2)); + + + list = new AspectList().add(Aspect.MOTION, 2).add(Aspect.FLIGHT, 1); + item = forestry.api.core.ItemInterface.getItem("beeDroneGE"); + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + list = list.copy().add(Aspect.GREED, 2).add(Aspect.EXCHANGE, 1); + item = forestry.api.core.ItemInterface.getItem("beePrincessGE"); + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + item = forestry.api.core.ItemInterface.getItem("beeQueenGE"); + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.EXCHANGE, 5); + item = forestry.api.core.ItemInterface.getItem("beeLarvaeGE"); + ThaumcraftApi.registerObjectTag(item.itemID, -1, list); + + item = forestry.api.core.ItemInterface.getItem("scoop"); + list = new AspectList(item.itemID, 0).add(Aspect.TOOL, 2); + ThaumcraftApi.registerComplexObjectTag(item.itemID, 0, list); + + item = forestry.api.core.ItemInterface.getItem("grafter"); + list = new AspectList(item.itemID, item.getItemDamage()).add(Aspect.TOOL, 2); + ThaumcraftApi.registerComplexObjectTag(item.itemID, 0, list); + + item = forestry.api.core.ItemInterface.getItem("grafterProven"); + list = list.copy().add(Aspect.TOOL, 2).add(Aspect.EXCHANGE, 3); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + + list = new AspectList().add(Aspect.TRAP, 2); + ThaumcraftApi.registerObjectTag("beeComb", list); + + list = new AspectList().add(Aspect.SLIME, 1); + item = forestry.api.core.ItemInterface.getItem("propolis"); + ThaumcraftApi.registerObjectTag(item.itemID, ForestryHelper.Propolis.NORMAL.ordinal(), list); + ThaumcraftApi.registerObjectTag(item.itemID, ForestryHelper.Propolis.SILKY.ordinal(), list.copy().add(Aspect.SLIME, 1)); + ThaumcraftApi.registerObjectTag(item.itemID, ForestryHelper.Propolis.PULSATING.ordinal(), list.copy().add(Aspect.ELDRITCH, 1)); + ThaumcraftApi.registerObjectTag(Config.propolis.itemID, PropolisType.AIR.ordinal(), list.copy().add(Aspect.AIR, 1)); + ThaumcraftApi.registerObjectTag(Config.propolis.itemID, PropolisType.WATER.ordinal(), list.copy().add(Aspect.WATER, 1)); + ThaumcraftApi.registerObjectTag(Config.propolis.itemID, PropolisType.FIRE.ordinal(), list.copy().add(Aspect.FIRE, 1)); + ThaumcraftApi.registerObjectTag(Config.propolis.itemID, PropolisType.EARTH.ordinal(), list.copy().add(Aspect.EARTH, 1)); + ThaumcraftApi.registerObjectTag(Config.propolis.itemID, PropolisType.ORDER.ordinal(), list.copy().add(Aspect.ORDER, 1)); + ThaumcraftApi.registerObjectTag(Config.propolis.itemID, PropolisType.CHAOS.ordinal(), list.copy().add(Aspect.ENTROPY, 1)); + + list = new AspectList().add(Aspect.PLANT, 2); + item = forestry.api.core.ItemInterface.getItem("pollen"); + ThaumcraftApi.registerObjectTag(item.itemID, ForestryHelper.Pollen.NORMAL.ordinal(), list); + ThaumcraftApi.registerObjectTag(item.itemID, ForestryHelper.Pollen.CRYSTALLINE.ordinal(), list.copy().add(Aspect.ICE, 1)); + ThaumcraftApi.registerObjectTag(Config.pollen.itemID, PollenType.UNUSUAL.ordinal(), list.copy().add(Aspect.MAGIC, 1)); + ThaumcraftApi.registerObjectTag(Config.pollen.itemID, PollenType.PHASED.ordinal(), list.copy().add(Aspect.ELDRITCH, 1)); + + list = new AspectList().add(Aspect.ORDER, 1); + item = forestry.api.core.ItemInterface.getItem("beeswax"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + ThaumcraftApi.registerObjectTag(Config.wax.itemID, WaxType.MAGIC.ordinal(), list.copy().add(Aspect.MAGIC, 1)); + ThaumcraftApi.registerObjectTag(Config.wax.itemID, WaxType.SOUL.ordinal(), list.copy().add(Aspect.SOUL, 1)); + ThaumcraftApi.registerObjectTag(Config.wax.itemID, WaxType.AMNESIC.ordinal(), list.copy().add(Aspect.MIND, 1)); + + list = new AspectList().add(Aspect.EXCHANGE, 2).add(Aspect.LIFE, 2); + item = forestry.api.core.ItemInterface.getItem("honeyDrop"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + + list = new AspectList().add(Aspect.LIFE, 2).add(Aspect.ENERGY, 2); + item = forestry.api.core.ItemInterface.getItem("honeydew"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + + list = new AspectList().add(Aspect.GREED, 1).add(Aspect.LIFE, 4); + item = forestry.api.core.ItemInterface.getItem("royalJelly"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + + list = new AspectList().add(Aspect.FIRE, 1).add(Aspect.TRAP, 2); + item = forestry.api.core.ItemInterface.getItem("phosphor"); + ThaumcraftApi.registerObjectTag(item.itemID, item.getItemDamage(), list); + } }