From e528d6911b6f5d9ed72ce7165573a6e65a74fe47 Mon Sep 17 00:00:00 2001 From: Jeremy Diamond Date: Sat, 22 Nov 2014 21:06:13 -0800 Subject: [PATCH] Bloodthorn added --- .../forbidden/compat/ForbiddenBotany.java | 25 +++++++ .../forbidden/tiles/SubTileBloodthorn.java | 69 ++++++++++++++++++ .../assets/forbidden/lang/en_US.lang | 5 +- .../forbidden/textures/blocks/bloodthorn.png | Bin 0 -> 1320 bytes 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 src/main/java/fox/spiteful/forbidden/tiles/SubTileBloodthorn.java create mode 100644 src/main/resources/assets/forbidden/textures/blocks/bloodthorn.png diff --git a/src/main/java/fox/spiteful/forbidden/compat/ForbiddenBotany.java b/src/main/java/fox/spiteful/forbidden/compat/ForbiddenBotany.java index 8e4567d..00d6f26 100644 --- a/src/main/java/fox/spiteful/forbidden/compat/ForbiddenBotany.java +++ b/src/main/java/fox/spiteful/forbidden/compat/ForbiddenBotany.java @@ -1,10 +1,12 @@ package fox.spiteful.forbidden.compat; +import WayofTime.alchemicalWizardry.api.altarRecipeRegistry.AltarRecipeRegistry; import cpw.mods.fml.common.registry.GameRegistry; import fox.spiteful.forbidden.Config; import fox.spiteful.forbidden.DarkResearchItem; import fox.spiteful.forbidden.LogHandler; import fox.spiteful.forbidden.items.ForbiddenItems; +import fox.spiteful.forbidden.tiles.SubTileBloodthorn; import fox.spiteful.forbidden.tiles.SubTileEuclidaisy; import fox.spiteful.forbidden.tiles.SubTileTainthistle; import fox.spiteful.forbidden.tiles.SubTileWhisperweed; @@ -113,6 +115,29 @@ public class ForbiddenBotany { InfusionRecipe thistlecraft = ThaumcraftApi.addInfusionCraftingRecipe("TAINTHISTLE", tainthistle, 4, (new AspectList()).add(Aspect.TAINT, 8).add(Aspect.HUNGER, 4).add(Aspect.AIR, 4).add(Aspect.WATER, 4), new ItemStack(ConfigItems.itemResource, 1, 12), new ItemStack[] { new ItemStack(petal, 1, 10), new ItemStack(manaPetal, 1, 10), new ItemStack(manaPetal, 1, 10), new ItemStack(rune, 1, 10), new ItemStack(rune, 1, 8)}); (new DarkResearchItem("TAINTHISTLE", "FORBIDDEN", "[B]", (new AspectList()).add(Aspect.PLANT, 8).add(Aspect.TAINT, 10).add(Aspect.MAGIC, 4), -8, 4, 8, tainthistle)).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.TAINTHISTLE.1"), new ResearchPage(thistlecraft) }).setParents(new String[] { "INFAUXSION" }).setConcealed().registerResearchItem(); + if(Compat.bm){ + BotaniaAPI.registerSubTile("bloodthorn", SubTileBloodthorn.class); + BotaniaAPI.registerSubTileSignature(SubTileBloodthorn.class, new DarkSignature("bloodthorn")); + BotaniaAPI.addSubTileToCreativeMenu("bloodthorn"); + + SubTileBloodthorn.lexicon = new ForbiddenLexicon("bloodthorn", functional){ + @Override + public String getSubtitle(){ + return "[Forbidden Magic][Blood Magic]"; + } + }; + + SubTileBloodthorn.lexicon.addPage(BotaniaAPI.internalHandler.textPage("forbidden.lexicon.bloodthorn.0")); + + ItemStack bloodthorn = getFlower("bloodthorn"); + try{ + AltarRecipeRegistry.registerAltarRecipe(bloodthorn, new ItemStack(flower, 1, 14), 4, 15000, 25, 50, false); + } + catch(Throwable e){ + LogHandler.log(Level.INFO, e, "Forbidden Magic tried to do some Blood Magic, but bled out."); + } + } + ThaumcraftApi.registerObjectTag(GameRegistry.findItemStack("Botania", "specialFlower", 1), (new AspectList()).add(Aspect.PLANT, 4).add(Aspect.MAGIC, 1)); } catch (Throwable e) { diff --git a/src/main/java/fox/spiteful/forbidden/tiles/SubTileBloodthorn.java b/src/main/java/fox/spiteful/forbidden/tiles/SubTileBloodthorn.java new file mode 100644 index 0000000..d20e659 --- /dev/null +++ b/src/main/java/fox/spiteful/forbidden/tiles/SubTileBloodthorn.java @@ -0,0 +1,69 @@ +/** + * This class based on a class created by . + * + * It was distributed as part of the Botania Mod. + * Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under a + * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License + * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * + * File Created @ [May 15, 2014, 4:47:41 PM (GMT)] + */ + +package fox.spiteful.forbidden.tiles; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.EnumCreatureAttribute; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.subtile.SubTileFunctional; + +import java.util.List; + +public class SubTileBloodthorn extends SubTileFunctional { + public static LexiconEntry lexicon; + + @Override + public void onUpdate() { + super.onUpdate(); + if(redstoneSignal > 0) + return; + final int range = 6; + final int cost = 40; + List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + range, supertile.zCoord + range)); + for(EntityLivingBase entity : entities) { + if(!(entity instanceof EntityPlayer) && entity.getActivePotionEffect(Potion.weakness) == null && mana >= cost && !entity.worldObj.isRemote) { + entity.addPotionEffect(new PotionEffect(Potion.weakness.id, 60, 2)); + mana -= cost; + } + } + } + @Override + public boolean acceptsRedstone() { + return true; + } + @Override + public int getColor() { + return 0x7D0600; + } + @Override + public int getMaxMana() { + return 360; + } + @Override + public LexiconEntry getEntry() { + return lexicon; + } + + @Override + public IIcon getIcon(){ + return BotaniaAPI.getSignatureForName("bloodthorn").getIconForStack(null); + } +} \ No newline at end of file diff --git a/src/main/resources/assets/forbidden/lang/en_US.lang b/src/main/resources/assets/forbidden/lang/en_US.lang index 609b86c..ddca2cf 100644 --- a/src/main/resources/assets/forbidden/lang/en_US.lang +++ b/src/main/resources/assets/forbidden/lang/en_US.lang @@ -89,6 +89,7 @@ tile.blackRoseBush.name=Umbral Rose Bush darkflower.euclidaisy.name=Euclidaisy darkflower.whisperweed.name=Whisperweed darkflower.tainthistle.name=Tainthistle +darkflower.bloodthorn.name=Bloodthorn # # Enchantments enchantment.cluster=Fiery Core @@ -301,4 +302,6 @@ forbidden.lexicon.euclidaisy.0=The eerie, pink &1Euclidaisy&0 is an oddity. It u forbidden.lexicon.whisperweed=Whisperweed forbidden.lexicon.whisperweed.0=The &1Whisperweed&0 is an unpleasant plant that whispers secrets into the ears of anyone who'll listen. There doesn't seem to be much point to the plant, since the secrets aren't even relevant to botany.
&oMore secrets than Wan Shi Tong&r forbidden.lexicon.tainthistle=Tainthistle -forbidden.lexicon.tainthistle.0=The disgusting &1Tainthistle&0 derives sustenance from the tainted runoff of magical experiments. It'll suck up any such substance it can find and try to turn it into mana. Since Botany is an environmentally friendly practice, there doesn't seem to be much point to it.
&oMore intrusive than a Spirit Vine&r \ No newline at end of file +forbidden.lexicon.tainthistle.0=The disgusting &1Tainthistle&0 derives sustenance from the tainted runoff of magical experiments. It'll suck up any such substance it can find and try to turn it into mana. Since Botany is an environmentally friendly practice, there doesn't seem to be much point to it.
&oMore intrusive than a Spirit Vine&r +forbidden.lexicon.bloodthorn=Bloodthorn +forbidden.lexicon.bloodthorn.0=The results of some sick, twisted Blood Mage's experiments, the &1Bloodthorn&0 is a red mystical flower that has been steeped in blood until it developed a taste for the life force of all things. It uses mana to inflict an extreme level of Weakness on surrounding creatures that is unmatched by any conventional alchemy.
&oYakone's legacy&r \ No newline at end of file diff --git a/src/main/resources/assets/forbidden/textures/blocks/bloodthorn.png b/src/main/resources/assets/forbidden/textures/blocks/bloodthorn.png new file mode 100644 index 0000000000000000000000000000000000000000..cbc361b8ab7f2f730e3a9bc4039c0fec5f3d4cd3 GIT binary patch literal 1320 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Lb6AYF9SoBDg#49GXulV|3LaB z14F3+1H-EX1_rAc3=HD=lj4uMF)%PQ1o(uw0`)M2GSsp$Fic@!SjDiIfnhZR!zKoX zr}r3MKVf+L3?x4aMnhn@hQQgItClh_Ffx<``33(U*?=MVJ3Fx4VBjq9h%9Dc;5!7u zjG`J|4M0Ju64!{5;QX|b^2DN4hJeJ(yb?V>*ARs=V?9$nLqqq^PUb*W1)eUBAsWG@ zz1(~)1{|zQBe?GT-*>(}Wb;jzU!D?d79Yfqi=VhN)lA0Y`SBf&>o^t%t>~R|S;yF{ zVEfK%Z!~uw?eXLE_m0}S$Jpiqb6m26pnbMt6#HXCzgC0Gn-5;7Y6;NV8dedh^Oj9Z eAaI#i8~2ABEBt00uxkX`&EV