From eeb6cb356d90104d3e99f0eb6fe341468ac2510d Mon Sep 17 00:00:00 2001 From: MysteriousAges Date: Tue, 21 Apr 2015 13:36:51 -0700 Subject: [PATCH] Adding Crafting & Lexicon entries for Manasteel Grafter & Scoop. --- .../main/utils/compat/BotaniaHelper.java | 26 ++++++++++++++++++- .../botania/BotaniaAPIDistanceHelper.java | 12 +++++++++ .../assets/magicbees/lang/en_US.lang | 3 +++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java b/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java index 30e0cac..482ddcb 100644 --- a/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java +++ b/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java @@ -1,6 +1,5 @@ package magicbees.main.utils.compat; -import vazkii.botania.api.mana.ManaItemHandler; import magicbees.bees.BeeManager; import magicbees.main.Config; import magicbees.main.utils.BlockInterface; @@ -8,12 +7,17 @@ import magicbees.main.utils.ItemInterface; import magicbees.main.utils.compat.botania.BotaniaAPIDistanceHelper; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.IIcon; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; +import vazkii.botania.api.mana.ManaItemHandler; 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; @@ -21,6 +25,8 @@ public class BotaniaHelper { @SideOnly(Side.CLIENT) public static IIcon subtileIcons[]; + + public static final String LEXICON_ENTRY_MANA_GEAR = "manaGear"; public enum ManaResource { MANASTEEL, @@ -50,6 +56,9 @@ public class BotaniaHelper { public static Item itemManaPetal; public static Item itemManaResource; + public static IRecipe manasteelGrafterRecipe; + public static IRecipe manasteelScoopRecipe; + private static boolean isBotaniaActive = false; public static final String Name = "Botania"; @@ -82,6 +91,21 @@ public class BotaniaHelper { // Hiveacynth would appreciate it if this list existed. BeeManager.populateSpeciesListRarity(); + GameRegistry.addRecipe(new ItemStack(Config.manasteelScoop), new Object[] { + "twt", "tmt", " t ", + 'm', new ItemStack(itemManaResource, 1, ManaResource.MANASTEEL.ordinal()), + 'w', Blocks.wool, + 't', new ItemStack(itemManaResource, 1, ManaResource.LIVINGWOOD_TWIG.ordinal()) + }); + manasteelScoopRecipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1); + + GameRegistry.addRecipe(new ItemStack(Config.manasteelGrafter), new Object[] { + " m", " t ", "t ", + 'm', new ItemStack(itemManaResource, 1, ManaResource.MANASTEEL.ordinal()), + 't', new ItemStack(itemManaResource, 1, ManaResource.LIVINGWOOD_TWIG.ordinal()) + }); + manasteelGrafterRecipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(CraftingManager.getInstance().getRecipeList().size() - 1); + BotaniaAPIDistanceHelper.setupCraftingAndLexicon(); } } diff --git a/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java b/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java index 4b8109b..91f5eb8 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java +++ b/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java @@ -28,6 +28,9 @@ public class BotaniaAPIDistanceHelper { } public static void setupCraftingAndLexicon() { + LexiconEntry manasteelEntry = getLexiconEntryForName(BotaniaHelper.LEXICON_ENTRY_MANA_GEAR); + manasteelEntry.addPage(BotaniaAPI.internalHandler.craftingRecipePage("magicbees.botania.lexicon.manasteelScoop", BotaniaHelper.manasteelScoopRecipe)); + manasteelEntry.addPage(BotaniaAPI.internalHandler.craftingRecipePage("magicbees.botania.lexicon.manasteelGrafter", BotaniaHelper.manasteelGrafterRecipe)); RecipePetals beegoniaRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileBeegonia.NAME), new Object[] { new ItemStack(BotaniaHelper.itemPetal), new ItemStack(BotaniaHelper.itemManaPetal), @@ -57,4 +60,13 @@ public class BotaniaAPIDistanceHelper { BotaniaAPI.internalHandler.petalRecipePage("magicbees.botania.lexicon.hiveacynth.crafting", hiveacynthRecipe) }); } + + public static LexiconEntry getLexiconEntryForName(String name) { + for (LexiconEntry entry : BotaniaAPI.getAllEntries()) { + if (entry.unlocalizedName.equals(name)) { + return entry; + } + } + return null; + } } diff --git a/src/main/resources/assets/magicbees/lang/en_US.lang b/src/main/resources/assets/magicbees/lang/en_US.lang index 6461b9b..08f96ce 100644 --- a/src/main/resources/assets/magicbees/lang/en_US.lang +++ b/src/main/resources/assets/magicbees/lang/en_US.lang @@ -536,6 +536,9 @@ tc.research_page.MB_VisAuraProvider.1=Blah blah blah. #Botania Lexicon entries magicbees.botania.lexicon.subtitle=[Magic Bees] +magicbees.botania.lexicon.manasteelScoop=The &1Manasteel Scoop&0 +magicbees.botania.lexicon.manasteelGrafter=The &1Manasteel Grafter&0 + magicbees.botania.lexicon.beegonia.0=Drones are the foundation of a healthy colony's future, but really, they can start just piling up to the point where you don't know what to do with them anymore.
The &1Beegonia&0 is a solution to the problem of overcrowding! Simply toss your spare drones in their vicinity, and they will reclaim the life force within the drone and convert it into mana! They aren't terribly picky, and will magicbees.botania.lexicon.beegonia.1=produce a constant amount of mana while they work, though it does seem more "complex" bees provide more mana than mundane bees, whatever that means. magicbees.botania.lexicon.beegonia.crafting=Syncrostrike's Elegant Solution