From 223aba18a4905bac7fbcac1e9324972047b77e0a Mon Sep 17 00:00:00 2001 From: MysteriousAges Date: Fri, 8 May 2015 14:47:40 -0700 Subject: [PATCH] Adding the Hibeescus to Botania integration. Fixing "missing" loc strings for Vis Apiary Booster. Fixing order of petals within some Botania petal recipes. --- .../main/utils/compat/BotaniaHelper.java | 26 ++++ .../botania/BotaniaAPIDistanceHelper.java | 59 ++++++-- .../compat/botania/SubTileHibeescus.java | 141 ++++++++++++++++++ .../assets/magicbees/lang/en_US.lang | 12 +- .../magicbees/textures/blocks/hibeescus.png | Bin 0 -> 415 bytes 5 files changed, 224 insertions(+), 14 deletions(-) create mode 100644 src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java create mode 100644 src/main/resources/assets/magicbees/textures/blocks/hibeescus.png diff --git a/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java b/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java index 42754e1..614b826 100644 --- a/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java +++ b/src/main/java/magicbees/main/utils/compat/BotaniaHelper.java @@ -58,6 +58,26 @@ public class BotaniaHelper { MYCELIUM, ; } + + public enum Rune { + WATER, + FIRE, + EARTH, + AIR, + SPRING, + SUMMER, + AUTUMN, + WINTER, + MANA, + LUST, + GLUTTONY, + GREED, + SLOTH, + WRATH, + ENVY, + PRIDE, + ; + } public static Block blockMysticalFlower; public static Block blockLivingRock; @@ -68,6 +88,7 @@ public class BotaniaHelper { public static Item itemManaPetal; public static Item itemManaResource; public static Item itemPastureSeed; + public static Item itemRune; public static ItemStack[] mysticalFlowerVariants; @@ -154,6 +175,7 @@ public class BotaniaHelper { itemManaPetal = ItemInterface.getItem(Name, "manaPetal"); itemManaResource = ItemInterface.getItem(Name, "manaResource"); itemPastureSeed = ItemInterface.getItem(Name, "grassSeeds"); + itemRune = ItemInterface.getItem(Name, "rune"); } public static void doBotaniaModuleConfigs(Configuration configuration) { @@ -183,4 +205,8 @@ public class BotaniaHelper { public static boolean requestMana(ItemStack stack, EntityPlayer player, int manaPerDamage, int charges) { return ManaItemHandler.requestManaExactForTool(stack, player, manaPerDamage * charges, true); } + + public static ItemStack getRune(Rune rune, int quantity) { + return new ItemStack(itemRune, quantity, rune.ordinal()); + } } 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 800eb22..dfd1cbf 100644 --- a/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java +++ b/src/main/java/magicbees/main/utils/compat/botania/BotaniaAPIDistanceHelper.java @@ -3,6 +3,7 @@ package magicbees.main.utils.compat.botania; import magicbees.bees.BeeSpecies; import magicbees.main.utils.compat.BotaniaHelper; import magicbees.main.utils.compat.BotaniaHelper.ManaResource; +import magicbees.main.utils.compat.BotaniaHelper.Rune; import net.minecraft.item.ItemStack; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.LexiconEntry; @@ -19,6 +20,7 @@ public class BotaniaAPIDistanceHelper { public static LexiconEntry entryBeegonia; public static LexiconEntry entryHiveacynth; + public static LexiconEntry entryHibeescus; public static LexiconEntry entryManaApiaryBooster; public static RecipeManaInfusion infusionBeeBotanical; @@ -34,6 +36,10 @@ public class BotaniaAPIDistanceHelper { BotaniaAPI.registerSubTile(SubTileHiveacynth.NAME, SubTileHiveacynth.class); BotaniaAPI.registerSubTileSignature(SubTileHiveacynth.class, new BotaniaSignature(SubTileHiveacynth.NAME)); BotaniaAPI.addSubTileToCreativeMenu(SubTileHiveacynth.NAME); + + BotaniaAPI.registerSubTile(SubTileHibeescus.NAME, SubTileHibeescus.class); + BotaniaAPI.registerSubTileSignature(SubTileHibeescus.class, new BotaniaSignature(SubTileHibeescus.NAME)); + BotaniaAPI.addSubTileToCreativeMenu(SubTileHibeescus.NAME); } public static void setupCraftingAndLexicon() { @@ -55,12 +61,15 @@ public class BotaniaAPIDistanceHelper { elfResourcesEntry.addPage(BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beeAlfheim.0")); elfResourcesEntry.addPage(BotaniaAPI.internalHandler.elvenTradesPage("magicbees.botania.lexicon.beeAlfheim.trade", tradeBeeAelfheim)); - RecipePetals beegoniaRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileBeegonia.NAME), new Object[] { - new ItemStack(BotaniaHelper.itemPetal), new ItemStack(BotaniaHelper.itemManaPetal), - new ItemStack(BotaniaHelper.itemPetal, 1, 4), new ItemStack(BotaniaHelper.itemPetal, 1, 4), - new ItemStack(BotaniaHelper.itemPetal, 1, 4), new ItemStack(BotaniaHelper.itemManaPetal, 1, 4), + RecipePetals beegoniaRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileBeegonia.NAME), + new ItemStack(BotaniaHelper.itemPetal), + new ItemStack(BotaniaHelper.itemManaPetal), + new ItemStack(BotaniaHelper.itemPetal, 1, 4), + new ItemStack(BotaniaHelper.itemPetal, 1, 4), + new ItemStack(BotaniaHelper.itemPetal, 1, 4), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 4), new ItemStack(BotaniaHelper.itemManaPetal, 1, 15) - }); + ); entryBeegonia = new BotaniaLexiconEntry("tile.botania:flower." + SubTileBeegonia.NAME + ".name", BotaniaAPI.categoryGenerationFlowers); entryBeegonia.setLexiconPages( BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beegonia.0"), @@ -69,19 +78,47 @@ public class BotaniaAPIDistanceHelper { BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.beegonia.2") ); - RecipePetals hiveacynthRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileHiveacynth.NAME), new Object[] { - new ItemStack(BotaniaHelper.itemPetal, 1, 3), new ItemStack(BotaniaHelper.itemPetal, 1, 9), - new ItemStack(BotaniaHelper.itemPetal, 1, 9), new ItemStack(BotaniaHelper.itemPetal, 1, 11), - new ItemStack(BotaniaHelper.itemManaPetal, 1, 3), new ItemStack(BotaniaHelper.itemManaPetal, 1, 9), - new ItemStack(BotaniaHelper.itemManaPetal, 1, 11), new ItemStack(BotaniaHelper.itemManaPetal, 1, 11), + RecipePetals hiveacynthRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileHiveacynth.NAME), + new ItemStack(BotaniaHelper.itemPetal, 1, 3), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 3), + new ItemStack(BotaniaHelper.itemPetal, 1, 9), + new ItemStack(BotaniaHelper.itemPetal, 1, 9), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 9), + new ItemStack(BotaniaHelper.itemPetal, 1, 11), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 11), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 11), new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.REDSTONE_ROOT.ordinal()) - }); + ); entryHiveacynth = new BotaniaLexiconEntry("tile.botania:flower." + SubTileHiveacynth.NAME + ".name", BotaniaAPI.categoryFunctionalFlowers); entryHiveacynth.setLexiconPages(BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hiveacynth.0"), BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hiveacynth.1"), BotaniaAPI.internalHandler.petalRecipePage("magicbees.botania.lexicon.hiveacynth.crafting", hiveacynthRecipe) ); + RecipePetals hibeescusRecipe = BotaniaAPI.registerPetalRecipe(BotaniaAPI.internalHandler.getSubTileAsStack(SubTileHibeescus.NAME), + new ItemStack(BotaniaHelper.itemPetal, 1, 1), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 1), + new ItemStack(BotaniaHelper.itemPetal, 1, 2), + new ItemStack(BotaniaHelper.itemPetal, 1, 2), + new ItemStack(BotaniaHelper.itemPetal, 1, 2), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 2), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 2), + new ItemStack(BotaniaHelper.itemPetal, 1, 14), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 12), + new ItemStack(BotaniaHelper.itemManaPetal, 1, 10), + BotaniaHelper.getRune(Rune.AIR, 1), + BotaniaHelper.getRune(Rune.SUMMER, 1), + BotaniaHelper.getRune(Rune.ENVY, 1), + BotaniaHelper.getRune(Rune.GREED, 1), + BotaniaHelper.getRune(Rune.PRIDE, 1), + new ItemStack(BotaniaHelper.itemManaResource, 1, ManaResource.REDSTONE_ROOT.ordinal()) + ); + entryHibeescus = new BotaniaLexiconEntry("tile.botania:flower." + SubTileHibeescus.NAME + ".name", BotaniaAPI.categoryFunctionalFlowers); + entryHibeescus.setLexiconPages(BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hibeescus.0"), + BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.hibeescus.1"), + BotaniaAPI.internalHandler.petalRecipePage("magicbees.botania.lexicon.hibeescus.crafting", hibeescusRecipe) + ); + entryManaApiaryBooster = new BotaniaLexiconEntry("tile.manaAuraProvider.name", BotaniaAPI.categoryDevices); entryManaApiaryBooster.setLexiconPages( BotaniaAPI.internalHandler.textPage("magicbees.botania.lexicon.manaBooster.0"), diff --git a/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java b/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java new file mode 100644 index 0000000..d4d9142 --- /dev/null +++ b/src/main/java/magicbees/main/utils/compat/botania/SubTileHibeescus.java @@ -0,0 +1,141 @@ +package magicbees.main.utils.compat.botania; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import magicbees.bees.BeeManager; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.AxisAlignedBB; +import vazkii.botania.api.subtile.SubTileFunctional; +import forestry.api.apiculture.EnumBeeType; +import forestry.api.apiculture.IBee; + +public class SubTileHibeescus extends SubTileFunctional { + + public static final String NAME = "hibeescus"; + private final int MANA_PER_OPERATION = 100000; + private final int OPERATION_TICKS_TIME = 20 * 60 * 15; + private final int RANGE = 1; + + private ItemStack beeSlot; + private long operationTicksRemaining; + + @Override + public void onUpdate() { + super.onUpdate(); + + if (beeSlot != null && this.mana >= MANA_PER_OPERATION) { + progressOperation(); + } + else if (beeSlot == null && this.supertile.getWorldObj().getTotalWorldTime() % 10 == 0) { + findBeeItemToHold(); + } + } + + private void progressOperation() { + operationTicksRemaining--; + + if (operationTicksRemaining <= 0) { + mana -= MANA_PER_OPERATION; + IBee bee = BeeManager.beeRoot.getMember(beeSlot); + bee.setIsNatural(true); + EnumBeeType beeType = EnumBeeType.QUEEN; + if (bee.getMate() == null) { + beeType = EnumBeeType.PRINCESS; + } + ItemStack outputStack = BeeManager.beeRoot.getMemberStack(bee, beeType.ordinal()); + Random r = supertile.getWorldObj().rand; + EntityItem entity = new EntityItem(supertile.getWorldObj(), + supertile.xCoord - RANGE + r.nextInt(RANGE * 2 + 1), supertile.yCoord + 1, supertile.zCoord - RANGE + r.nextInt(RANGE * 2 + 1), + outputStack); + entity.motionX = 0; + entity.motionY = 0; + entity.motionZ = 0; + + supertile.getWorldObj().spawnEntityInWorld(entity); + beeSlot = null; + } + } + + private void findBeeItemToHold() { + @SuppressWarnings("unchecked") + List items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, getSearchBoundingBox()); + + for (EntityItem itemEntity : items) { + ItemStack item = itemEntity.getEntityItem(); + if (isItemPrincessOrQueen(item)) { + beeSlot = itemEntity.getEntityItem(); + operationTicksRemaining = OPERATION_TICKS_TIME; + + // Princesses and Queens don't stack, but YOU NEVER KNOW. + item.stackSize -= 1; + if (item.stackSize <= 0) { + itemEntity.setDead(); + } + + // Leave for loop + break; + } + } + } + + private boolean isItemPrincessOrQueen(ItemStack stack) { + boolean isBee = BeeManager.beeRoot.isMember(stack, EnumBeeType.PRINCESS.ordinal()) + || BeeManager.beeRoot.isMember(stack, EnumBeeType.QUEEN.ordinal()); + if (isBee) { + IBee bee = BeeManager.beeRoot.getMember(stack); + // Only process Ignoble bees. + if (!bee.isNatural()) { + return true; + } + } + return false; + } + + private AxisAlignedBB getSearchBoundingBox() { + return AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, + supertile.xCoord + RANGE + 1, supertile.yCoord + 1, supertile.zCoord + RANGE + 1); + } + + @Override + public void readFromPacketNBT(NBTTagCompound cmp) { + super.readFromPacketNBT(cmp); + if (cmp.hasKey("slot")) { + NBTTagCompound itemTag = (NBTTagCompound)cmp.getTag("slot"); + beeSlot = ItemStack.loadItemStackFromNBT(itemTag); + } + operationTicksRemaining = cmp.getLong("operationTicks"); + } + + @Override + public void writeToPacketNBT(NBTTagCompound cmp) { + super.writeToPacketNBT(cmp); + if (beeSlot != null) { + NBTTagCompound itemTag = new NBTTagCompound(); + beeSlot.writeToNBT(itemTag); + cmp.setTag("slot", itemTag); + } + cmp.setLong("operationTicks", operationTicksRemaining); + } + + @Override + public ArrayList getDrops(ArrayList list) { + if (beeSlot != null) { + list.add(beeSlot); + } + return super.getDrops(list); + } + + @Override + public int getMaxMana() { + return MANA_PER_OPERATION; + } + + @Override + public boolean acceptsRedstone() { + return true; + } +} diff --git a/src/main/resources/assets/magicbees/lang/en_US.lang b/src/main/resources/assets/magicbees/lang/en_US.lang index 2a1f858..0222909 100644 --- a/src/main/resources/assets/magicbees/lang/en_US.lang +++ b/src/main/resources/assets/magicbees/lang/en_US.lang @@ -193,6 +193,8 @@ tile.botania:flower.beegonia.name=Beegonia tile.botania:flower.beegonia.lore=We won't bee seeing you any more... tile.botania:flower.hiveacynth.name=Hiveacynth tile.botania:flower.hiveacynth.lore=In a Morvelaira's Garden +tile.botania:flower.hibeescus.name=Hibeescus +tile.botania:flower.hibeescus.lore=The puns may sting a bit #Research research.requiresBlock=Requires a foundation of %s @@ -447,7 +449,7 @@ magicbees.speciesBotSomnolent.description=Slow and sluggish, they work slowly co magicbees.speciesBotDreaming=Dreaming magicbees.speciesBotDreaming.description=These bees spend an inordinate time inactive and asleep; there is no way to know what they dream of.|Apinomicon magicbees.speciesBotAlfheim=Alfheim -magicbees.speciesBotAlfheim.description=They recall their time in Alfheim, and yearn for a world infused with mana, and so seek to make it so.|Apinomicon +magicbees.speciesBotAlfheim.description=They recall their time in Alfheim, and yearn for a world infused with mana, and seek to make it so.|Apinomicon magicbees.species= magicbees.species.description= @@ -573,8 +575,8 @@ tc.research_text.MB_EssenceOblivion=[MB] Cast aside with malice tc.research_page.MB_EssenceOblivion.1=Breeding bees for mutations can be aggrivating, especially whith long-lived species. With a little cleverness and only the slightest hint of smugness, you have found a way to utilize the Dimensional Singularity in a manner that only sucks away the life force of your tiny flying friends, bit by bit. Well, maybe significant amounts all at once. It's probably not going to affect them too badly.
It may be somewhat tricky to obtain more than one of the §5Dragon Eggs§0 nessecary to obtain more than one of these. Perhaps there is a bee species that can assist with the limitation. tc.research_name.MB_VisAuraProvider=Vis Apiary Booster -tc.research_text.MB_VisAuraProvider=[MB]Vis? What about Bis? -tc.research_page.MB_VisAuraProvider.1=Blah blah blah. +tc.research_text.MB_VisAuraProvider=[MB] Vis? What about Bis? +tc.research_page.MB_VisAuraProvider.1=Infusing Unusual Pollen with vis and combining it with gold creates an unusual crystal that, when fed vis from an aura node, creates an energizing aura that bees are naturally attracted to when attuned to the environment within a Magic Apiary. #Botania Lexicon entries magicbees.botania.lexicon.subtitle=[Magic Bees] @@ -594,5 +596,9 @@ magicbees.botania.lexicon.hiveacynth.0=Finding new bees for your stock can be a magicbees.botania.lexicon.hiveacynth.1=will ever be produced, and roughly in proportion to how they are found in the wild.
Occasionally, the flower will give itself airs, and produce a vaunted heiress rather than a vulgar drone. A redstone signal will prevent the &1Hiveacynth&0 from converting mana into life essence. magicbees.botania.lexicon.hiveacynth.crafting=> beesbeesbees.com +magicbees.botania.lexicon.hibeescus.0=&5Ignoble&0 bees, while exactly as useful as their &2Pristine&0 kin, have but only one flaw - after 100 generations or so, they begin to become diseased, weak, and may die off on you, right before you get that coveted mutation that'll drive your fellow Apiarists mad with envy. It seems that there is a solution to this after all, though! With enough mana, time, and the help of the very special +magicbees.botania.lexicon.hibeescus.1=&1Hibeescus&0 at your side, you can expunge the multitude of genetic weeknesses in the &5Ignoble&0 wild bees. Patience is a must, since the &1Hibeescus&0 performs its magic very slowly, up to 2 full days!
It is also recommended that you use its power sparingly, as it is incredibly mana-hungry. +magicbees.botania.lexicon.hibeescus.crafting=Only for use by Spiteful people. + magicbees.botania.lexicon.manaBooster.0=The Magic Apiary is a natural way to keep bees working quickly, but its a bit... limited. Thankfully, the properties of living stone and petals have a way of apparently energizing bees, making them produce more. Simply provide the &1Mana Apiary Booster&0 with a constant supply of mana, and it will keep the apiaries working efficiently. magicbees.botania.lexicon.manaBooster.crafting=Abuzz with mana! \ No newline at end of file diff --git a/src/main/resources/assets/magicbees/textures/blocks/hibeescus.png b/src/main/resources/assets/magicbees/textures/blocks/hibeescus.png new file mode 100644 index 0000000000000000000000000000000000000000..a235e335f812f1603ddfac5bd5279b64148879dd GIT binary patch literal 415 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL5ULAh?3y^w370~qEv>0#LT=By}Z;C1rt33 zJ=4@yqg0@w0-i38Ar}6<6Akm23jU}2k_P@|G$_cqtdl~)A7&$<*TiYcb|QJ@4==RtFx60HCZ~2%O5-B7&NgPS`F-NQ(yWMo~Z0Pu#XVkAP zbDlr$z2vC}g}-waq*?I9-(^tgV^CXj@b0VcXOGU@pMP;N*Wm_!H7y0T*rxyY6#n-X zG`YpNUA_A0u+_~6nctIqCc0n0U-AEz#B(D~Wyt~$;R$>fBcx_DOiWce)R3~kk!ixl zZ?jxBlr!7iS~0UUFKDhO$KrME<;{1FL?tbKTI|y@vo!qa+O`Yxw~E^V!;it!)z4*} HQ$iB}ZU3n^ literal 0 HcmV?d00001