From eac9ddaa20688405f3f312bc33b3c539f41bb24b Mon Sep 17 00:00:00 2001 From: Lizbeth Rika Date: Tue, 27 Jan 2015 21:37:00 +0000 Subject: [PATCH] Added the Medumone flower. --- .../common/block/BlockSpecialFlower.java | 1 + .../botania/common/block/ModBlocks.java | 2 + .../subtile/functional/SubTileMedumone.java | 66 +++++++++++++++++++ .../common/crafting/ModPetalRecipes.java | 4 +- .../botania/common/lexicon/LexiconData.java | 4 ++ .../vazkii/botania/common/lib/LibLexicon.java | 1 + .../resources/assets/botania/lang/en_US.lang | 11 +++- 7 files changed, 86 insertions(+), 3 deletions(-) create mode 100644 src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java diff --git a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java index b6665042c..4325a8ccc 100644 --- a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java @@ -83,6 +83,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid LibBlockNames.SUBTILE_TANGLEBERRIE, LibBlockNames.SUBTILE_JIYUULIA, LibBlockNames.SUBTILE_HYACIDUS, + LibBlockNames.SUBTILE_MEDUMONE, LibBlockNames.SUBTILE_POLLIDISIAC, LibBlockNames.SUBTILE_CLAYCONIA, LibBlockNames.SUBTILE_LOONIUM, diff --git a/src/main/java/vazkii/botania/common/block/ModBlocks.java b/src/main/java/vazkii/botania/common/block/ModBlocks.java index abaea7e3e..4488f3d8d 100644 --- a/src/main/java/vazkii/botania/common/block/ModBlocks.java +++ b/src/main/java/vazkii/botania/common/block/ModBlocks.java @@ -73,6 +73,7 @@ import vazkii.botania.common.block.subtile.functional.SubTileHyacidus; import vazkii.botania.common.block.subtile.functional.SubTileJadedAmaranthus; import vazkii.botania.common.block.subtile.functional.SubTileJiyuulia; import vazkii.botania.common.block.subtile.functional.SubTileLoonuim; +import vazkii.botania.common.block.subtile.functional.SubTileMedumone; import vazkii.botania.common.block.subtile.functional.SubTilePollidisiac; import vazkii.botania.common.block.subtile.functional.SubTileRannuncarpus; import vazkii.botania.common.block.subtile.functional.SubTileSpectranthemum; @@ -347,6 +348,7 @@ public final class ModBlocks { BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DAFFOMILL, SubTileDaffomill.class); BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_VINCULOTUS, SubTileVinculotus.class); BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_SPECTRANTHEMUM, SubTileSpectranthemum.class); + BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MEDUMONE, SubTileMedumone.class); } private static void registerTile(Class clazz, String key) { diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java new file mode 100644 index 000000000..fd32c77af --- /dev/null +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileMedumone.java @@ -0,0 +1,66 @@ +/** + * This class was created by . It's 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 @ [Jan 27, 2015, 7:33:17 PM (GMT)] + */ +package vazkii.botania.common.block.subtile.functional; + +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.AxisAlignedBB; +import vazkii.botania.api.lexicon.LexiconEntry; +import vazkii.botania.api.subtile.SubTileFunctional; +import vazkii.botania.common.lexicon.LexiconData; + +public class SubTileMedumone extends SubTileFunctional { + + @Override + public void onUpdate() { + super.onUpdate(); + + final int range = 6; + + if(mana > 0) { + List entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range)); + + for(EntityLivingBase entity : entities) + if(!(entity instanceof EntityPlayer)) { + entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 100)); + mana--; + if(mana == 0) + return; + } + } + } + + @Override + public boolean acceptsRedstone() { + return true; + } + + @Override + public int getColor() { + return 0x3D2204; + } + + @Override + public int getMaxMana() { + return 4000; + } + + @Override + public LexiconEntry getEntry() { + return LexiconData.medumone; + } + +} diff --git a/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java index 76a4a77ff..52e72247d 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModPetalRecipes.java @@ -64,7 +64,8 @@ public final class ModPetalRecipes { public static RecipePetals daffomillRecipe; public static RecipePetals vinculotusRecipe; public static RecipePetals spectranthemumRecipe; - + public static RecipePetals medumoneRecipe; + public static void init() { pureDaisyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), white, white, white, white); manastarRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MANASTAR), lightBlueMana, greenMana, redMana, cyanMana); @@ -101,6 +102,7 @@ public final class ModPetalRecipes { daffomillRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAFFOMILL), white, whiteMana, brown, yellowMana, runeAir, redstoneRoot); vinculotusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_VINCULOTUS), purpleMana, purpleMana, lime, black, blackMana, black, runeWater, runeSloth, runeLust, redstoneRoot); spectranthemumRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_SPECTRANTHEMUM), whiteMana, whiteMana, white, white, cyan, runeEnvy, runeWater, redstoneRoot, pixieDust); + medumoneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MEDUMONE), brown, brown, brownMana, gray, grayMana, runeEarth, redstoneRoot); ItemStack stack = new ItemStack(Items.skull, 1, 3); ItemNBTHelper.setString(stack, "SkullOwner", "Vazkii"); diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 1c48472b9..d753ed587 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -92,6 +92,7 @@ public final class LexiconData { public static LexiconEntry daffomill; public static LexiconEntry vinculotus; public static LexiconEntry spectranthemum; + public static LexiconEntry medumone; public static LexiconEntry generatingIntro; public static LexiconEntry daybloom; @@ -393,6 +394,9 @@ public final class LexiconData { spectranthemum = new ALexiconEntry(LibLexicon.FFLOWER_SPECTRANTHEMUN, categoryFunctionalFlowers); spectranthemum.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PagePetalRecipe("3", ModPetalRecipes.spectranthemumRecipe)); + medumone = new BLexiconEntry(LibLexicon.FFLOWER_MEDUMONE, categoryFunctionalFlowers); + medumone.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.medumoneRecipe)); + // GENERATING FLOWERS ENTRIES generatingIntro = new BLexiconEntry(LibLexicon.GFLOWER_INTRO, categoryGenerationFlowers); generatingIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2")); diff --git a/src/main/java/vazkii/botania/common/lib/LibLexicon.java b/src/main/java/vazkii/botania/common/lib/LibLexicon.java index ddd83aa84..ff402e10b 100644 --- a/src/main/java/vazkii/botania/common/lib/LibLexicon.java +++ b/src/main/java/vazkii/botania/common/lib/LibLexicon.java @@ -73,6 +73,7 @@ public final class LibLexicon { public static final String FFLOWER_DAFFOMILL = "daffomill"; public static final String FFLOWER_VINCULOTUS = "vinculotus"; public static final String FFLOWER_SPECTRANTHEMUN = "spectranthemum"; + public static final String FFLOWER_MEDUMONE = "medumone"; public static final String GFLOWER_INTRO = "gIntro"; public static final String GFLOWER_DAYBLOOM = "daybloom"; diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 2cb3bfa73..f8e13ace0 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -583,6 +583,8 @@ tile.botania:flower.vinculotus.name=Vinculotus tile.botania:flower.vinculotus.reference=Totally an Extra Utils ripoff tile.botania:flower.spectranthemum.name=Spectranthemum tile.botania:flower.spectranthemum.reference=In the shell +tile.botania:flower.medumone.name=Medumone +tile.botania:flower.medumone.reference='Twas Hades all along # ITEM NAMES item.botania:lexicon.name=Lexica Botania @@ -1201,14 +1203,19 @@ botania.page.daffomill1=&oWind Turbines? I'm a big fan&r. # -- VINCULOTUS botania.entry.vinculotus=Vinculotus botania.page.vinculotus0=The &1Vinculotus&0 has the power to create a disturbance among any &4Enderman&0's teleportation powers within a fairly large radius around it. For a cost of &4Mana&0, whenever an &4Enderman&0 would teleport anywhere, instead, they're teleported to the location of the &1Vinculotus&0. -botania.page.vinculotus1=Touch this black lotus with your fingers +botania.page.vinculotus1=&oTouch this black lotus with your fingers&r. # -- SPECTRANTHEMUM botania.entry.spectranthemum=Spectranthemum botania.page.spectranthemum0=Transporting items a long distance can be an arduous task. Water channels and &1Daffomills&0 won't cut it forever.
The &1Spectranthemum&0, at the cost of &4Mana&0 wraps the fabric of reality of any dropped items around it, teleporting them somewhere else in the world. botania.page.spectranthemum1=In order to specify where the items go, one would use a &1Wand of the Forest&0 in bind mode and bind the flower to a block somewhere, similarly to binding it to a pool.
In order to view what block the flower is bound to rather than the pool it's pulling &4Mana&0, one would sneak while looking at it with a wand. botania.page.spectranthemum2=This flower is governed by the &4axiom of chunkloading&0, by which it'll not function on chunks not loaded. This topic is not addressed in full extent this lexicon.
&oRecommended Reading: "Chunks and Chicken", "Anchors of the World". -botania.page.spectranthemum3=(n)spooky(n+2)me +botania.page.spectranthemum3=&o(n)spooky(n+2)me&r. + +# -- MEDUMONE +botania.entry.medumone=Medumone +botania.page.medumone0=The &1Medumone&0 is a flower with the ability to completely halt a creature's movement.
While it receives &4Mana&0, it'll halt any nearby entities in their tracks with a powerful slowness effect, provided they are not players. +botania.page.medumone1=&oThose credits look fake&r... # - GENERATING FLOWERS # -- AN INTRODUCTION TO GENERATION