diff --git a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java index bff0b4dd9..18ccd8665 100644 --- a/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java +++ b/MODSRC/vazkii/botania/common/block/subtile/functional/SubTileVinculotus.java @@ -11,15 +11,19 @@ */ package vazkii.botania.common.block.subtile.functional; +import java.util.ArrayList; import java.util.Collections; +import java.util.List; import java.util.Set; import java.util.WeakHashMap; import net.minecraft.entity.monster.EntityEnderman; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.EnderTeleportEvent; +import vazkii.botania.api.lexicon.LexiconEntry; import vazkii.botania.api.subtile.SubTileFunctional; import vazkii.botania.common.core.helper.MathHelper; +import vazkii.botania.common.lexicon.LexiconData; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class SubTileVinculotus extends SubTileFunctional { @@ -40,6 +44,11 @@ public class SubTileVinculotus extends SubTileFunctional { } } + @Override + public boolean acceptsRedstone() { + return true; + } + @Override public int getColor() { return 0x0A6051; @@ -50,6 +59,11 @@ public class SubTileVinculotus extends SubTileFunctional { return 500; } + @Override + public LexiconEntry getEntry() { + return LexiconData.vinculotus; + } + public static class EndermanIntercepter { @SubscribeEvent @@ -61,21 +75,31 @@ public class SubTileVinculotus extends SubTileFunctional { int range = 64; if(event.entity instanceof EntityEnderman) { + List possibleFlowers = new ArrayList(); for(SubTileVinculotus flower : existingFlowers) { - if(flower.mana <= cost) + if(flower.redstoneSignal > 0 || flower.mana <= cost || flower.supertile.getWorldObj() != event.entity.worldObj || flower.supertile.getWorldObj().getTileEntity(flower.supertile.xCoord, flower.supertile.yCoord, flower.supertile.zCoord) != flower.supertile) continue; double x = flower.supertile.xCoord + 0.5; double y = flower.supertile.yCoord + 1.5; double z = flower.supertile.zCoord + 0.5; - if(MathHelper.pointDistanceSpace(x, y, z, event.targetX, event.targetY, event.targetZ) < range) { - event.targetX = x + Math.random() * 3 - 1; - event.targetY = y; - event.targetZ = z + Math.random() * 3 - 1; - flower.mana -= cost; - flower.sync(); - } + if(MathHelper.pointDistanceSpace(x, y, z, event.targetX, event.targetY, event.targetZ) < range) + possibleFlowers.add(flower); + } + + if(!possibleFlowers.isEmpty()) { + SubTileVinculotus flower = possibleFlowers.get(event.entity.worldObj.rand.nextInt(possibleFlowers.size())); + + double x = flower.supertile.xCoord + 0.5; + double y = flower.supertile.yCoord + 1.5; + double z = flower.supertile.zCoord + 0.5; + + event.targetX = x + Math.random() * 3 - 1; + event.targetY = y; + event.targetZ = z + Math.random() * 3 - 1; + flower.mana -= cost; + flower.sync(); } } } diff --git a/MODSRC/vazkii/botania/common/crafting/ModPetalRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModPetalRecipes.java index 6576d01a3..425cbd433 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModPetalRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModPetalRecipes.java @@ -61,6 +61,7 @@ public final class ModPetalRecipes { public static RecipePetals clayconiaRecipe; public static RecipePetals looniumRecipe; public static RecipePetals daffomillRecipe; + public static RecipePetals vinculotusRecipe; public static void init() { pureDaisyRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), white, white, white, white); @@ -95,7 +96,8 @@ public final class ModPetalRecipes { clayconiaRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_CLAYCONIA), gray, lightGray, lightGrayMana, lightGrayMana, grayMana, cyan, runeEarth); looniumRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_LOONIUM), green, green, greenMana, greenMana, gray, grayMana, runeSloth, runeGluttony, runeEnvy, redstoneRoot); 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); + ItemStack stack = new ItemStack(Items.skull, 1, 3); ItemNBTHelper.setString(stack, "SkullOwner", "Vazkii"); Object[] inputs = new Object[16]; diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java index f19c32f99..f9c084828 100644 --- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java +++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java @@ -100,6 +100,7 @@ public final class LexiconData { public static LexiconEntry entropinnyum; public static LexiconEntry kekimurus; public static LexiconEntry daffomill; + public static LexiconEntry vinculotus; public static LexiconEntry pistonRelay; public static LexiconEntry pylon; @@ -307,9 +308,12 @@ public final class LexiconData { loonium = new BLexiconEntry(LibLexicon.FFLOWER_LOONIUM, categoryFunctionalFlowers); loonium.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.looniumRecipe)); - daffomill = new BLexiconEntry(LibLexicon.GFLOWER_DAFFOMILL, categoryFunctionalFlowers); + daffomill = new BLexiconEntry(LibLexicon.FFLOWER_DAFFOMILL, categoryFunctionalFlowers); daffomill.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.daffomillRecipe)); + vinculotus = new BLexiconEntry(LibLexicon.FFLOWER_VINCULOTUS, categoryFunctionalFlowers); + vinculotus.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.vinculotusRecipe)); + // 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/MODSRC/vazkii/botania/common/lib/LibLexicon.java b/MODSRC/vazkii/botania/common/lib/LibLexicon.java index f2e9ed729..5d639e6ea 100644 --- a/MODSRC/vazkii/botania/common/lib/LibLexicon.java +++ b/MODSRC/vazkii/botania/common/lib/LibLexicon.java @@ -65,6 +65,8 @@ public final class LibLexicon { public static final String FFLOWER_POLLIDISIAC = "pollidisiac"; public static final String FFLOWER_CLAYCONIA = "clayconia"; public static final String FFLOWER_LOONIUM = "loonium"; + public static final String FFLOWER_DAFFOMILL = "daffomill"; + public static final String FFLOWER_VINCULOTUS = "vinculotus"; public static final String GFLOWER_INTRO = "gIntro"; public static final String GFLOWER_DAYBLOOM = "daybloom"; @@ -76,7 +78,6 @@ public final class LibLexicon { public static final String GFLOWER_MUNCHDEW = "munchdew"; public static final String GFLOWER_ENTROPINNYUM = "entropinnyum"; public static final String GFLOWER_KEKIMURUS = "kekimurus"; - public static final String GFLOWER_DAFFOMILL = "daffomill"; public static final String DEVICE_PISTON_RELAY = "pistonRelay"; public static final String DEVICE_PYLON = "pylon"; diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index f3e776a4a..5994dec78 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -895,6 +895,11 @@ botania.entry.daffomill=Daffomill botania.page.daffomill0=The &1Daffomill&0 works as a fan of sorts. It pushes, at the cost of a small amount of &4Mana&0, any items found in front of it.
Shift-right clicking it with a &1Wand of the Forest&0 changes the orientation. Where it's currently facing can be seen via the subtle wind particles it emits. 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 + # - GENERATING FLOWERS # -- AN INTRODUCTION TO GENERATION botania.entry.gIntro=An Introduction to Generation