diff --git a/src/main/java/vazkii/botania/common/brew/ModBrews.java b/src/main/java/vazkii/botania/common/brew/ModBrews.java index e7d7f38e5..505da7c30 100644 --- a/src/main/java/vazkii/botania/common/brew/ModBrews.java +++ b/src/main/java/vazkii/botania/common/brew/ModBrews.java @@ -37,6 +37,7 @@ public class ModBrews { public static Brew emptiness; public static Brew bloodthirst; public static Brew overload; + public static Brew clear; public static Brew warpWard; @@ -61,6 +62,7 @@ public class ModBrews { emptiness = new BrewModPotion(LibBrewNames.EMPTINESS, 30000, new PotionEffect(ModPotions.emptiness.id, 7200, 0)); bloodthirst = new BrewModPotion(LibBrewNames.BLOODTHIRST, 20000, new PotionEffect(ModPotions.bloodthrst.id, 7200, 0)); allure = new BrewModPotion(LibBrewNames.ALLURE, 2000, new PotionEffect(ModPotions.allure.id, 4800, 0)); + clear = new BrewModPotion(LibBrewNames.CLEAR, 4000, new PotionEffect(ModPotions.clear.id, 0, 0)); } public static void initTC() { diff --git a/src/main/java/vazkii/botania/common/brew/ModPotions.java b/src/main/java/vazkii/botania/common/brew/ModPotions.java index 1c442b25f..f6cbffe31 100644 --- a/src/main/java/vazkii/botania/common/brew/ModPotions.java +++ b/src/main/java/vazkii/botania/common/brew/ModPotions.java @@ -16,6 +16,7 @@ import java.lang.reflect.Modifier; import net.minecraft.potion.Potion; import vazkii.botania.common.brew.potion.PotionAllure; import vazkii.botania.common.brew.potion.PotionBloodthirst; +import vazkii.botania.common.brew.potion.PotionClear; import vazkii.botania.common.brew.potion.PotionEmptiness; import vazkii.botania.common.brew.potion.PotionFeatherfeet; import vazkii.botania.common.brew.potion.PotionSoulCross; @@ -27,6 +28,7 @@ public class ModPotions { public static Potion emptiness; public static Potion bloodthrst; public static Potion allure; + public static Potion clear; public static void init() { if(Potion.potionTypes.length < 256) @@ -37,6 +39,7 @@ public class ModPotions { emptiness = new PotionEmptiness(); bloodthrst = new PotionBloodthirst(); allure = new PotionAllure(); + clear = new PotionClear(); } private static void extendPotionArray() { diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java b/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java new file mode 100644 index 000000000..0299a7063 --- /dev/null +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionClear.java @@ -0,0 +1,35 @@ +/** + * 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 the + * Botania License: http://botaniamod.net/license.php + * + * File Created @ [Jul 25, 2015, 6:08:52 PM (GMT)] + */ +package vazkii.botania.common.brew.potion; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.lib.LibPotionNames; + +public class PotionClear extends PotionMod { + + public PotionClear() { + super(ConfigHandler.potionIDClear, LibPotionNames.CLEAR, false, 0xFFFFFF, 0); + } + + @Override + public boolean isInstant() { + return true; + } + + @Override + public void affectEntity(EntityLivingBase e, EntityLivingBase e1, int t, double d) { + e1.curePotionEffects(new ItemStack(Items.milk_bucket)); + } + +} diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java b/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java index 29d26393a..6d2b77ea0 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionEmptiness.java @@ -27,7 +27,7 @@ public class PotionEmptiness extends PotionMod { private static final int RANGE = 128; public PotionEmptiness() { - super(ConfigHandler.potionIDEmptiness, LibPotionNames.EMPTINESS, false, 0xE7E7E7, 2); + super(ConfigHandler.potionIDEmptiness, LibPotionNames.EMPTINESS, false, 0xFACFFF, 2); MinecraftForge.EVENT_BUS.register(this); } diff --git a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java index 0c7cb2075..d186b91a2 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java @@ -74,6 +74,7 @@ public final class ConfigHandler { public static int potionIDEmptiness = 93; public static int potionIDBloodthirst = 94; public static int potionIDAllure = 95; + public static int potionIDClear = 96; public static void loadConfig(File configFile) { config = new Configuration(configFile); @@ -206,6 +207,7 @@ public final class ConfigHandler { potionIDEmptiness = loadPropPotionId(LibPotionNames.EMPTINESS, potionIDEmptiness); potionIDBloodthirst = loadPropPotionId(LibPotionNames.BLOODTHIRST, potionIDBloodthirst); potionIDAllure = loadPropPotionId(LibPotionNames.ALLURE, potionIDAllure); + potionIDClear = loadPropPotionId(LibPotionNames.CLEAR, potionIDClear); if(config.hasChanged()) config.save(); diff --git a/src/main/java/vazkii/botania/common/crafting/ModBrewRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModBrewRecipes.java index 878526be9..bafdb0bb5 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModBrewRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModBrewRecipes.java @@ -41,6 +41,7 @@ public class ModBrewRecipes { public static RecipeBrew emptinessBrew; public static RecipeBrew bloodthirstBrew; public static RecipeBrew allureBrew; + public static RecipeBrew clearBrew; public static RecipeBrew warpWardBrew; @@ -65,6 +66,7 @@ public class ModBrewRecipes { emptinessBrew = BotaniaAPI.registerBrewRecipe(ModBrews.emptiness, new ItemStack(Items.nether_wart), new ItemStack(Items.gunpowder), new ItemStack(Items.rotten_flesh), new ItemStack(Items.bone), new ItemStack(Items.string), new ItemStack(Items.ender_pearl)); bloodthirstBrew = BotaniaAPI.registerBrewRecipe(ModBrews.bloodthirst, new ItemStack(Items.nether_wart), new ItemStack(Items.fermented_spider_eye), new ItemStack(Items.dye, 1, 4), new ItemStack(Items.fire_charge), new ItemStack(Items.iron_ingot)); allureBrew = BotaniaAPI.registerBrewRecipe(ModBrews.allure, new ItemStack(Items.nether_wart), new ItemStack(Items.fish), new ItemStack(Items.quartz), new ItemStack(Items.golden_carrot)); + clearBrew = BotaniaAPI.registerBrewRecipe(ModBrews.clear, new ItemStack(Items.nether_wart), new ItemStack(Items.quartz), new ItemStack(Items.emerald), new ItemStack(Items.melon)); } public static void initTC() { diff --git a/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java b/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java index 8129e4ec0..239ad5b70 100644 --- a/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java +++ b/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java @@ -79,7 +79,10 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem { if(!world.isRemote) { for(PotionEffect effect : getBrew(stack).getPotionEffects(stack)) { PotionEffect newEffect = new PotionEffect(effect.getPotionID(), effect.getDuration(), effect.getAmplifier(), true); - player.addPotionEffect(newEffect); + Potion potion = Potion.potionTypes[newEffect.getPotionID()]; + if(potion.isInstant()) + potion.affectEntity(player, player, newEffect.getAmplifier(), 1F); + else player.addPotionEffect(newEffect); } if(world.rand.nextBoolean()) diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 2e2ecac26..52f4fd888 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -604,7 +604,8 @@ public final class LexiconData { complexBrews.setLexiconPages(new PageText("0"), new PageBrew(ModBrewRecipes.overloadBrew, "1a", "1b"), new PageBrew(ModBrewRecipes.soulCrossBrew, "2a", "2b"), new PageBrew(ModBrewRecipes.featherFeetBrew, "3a", "3b"), new PageBrew(ModBrewRecipes.emptinessBrew, "4a", "4b"), - new PageBrew(ModBrewRecipes.bloodthirstBrew, "5a", "5b"), new PageBrew(ModBrewRecipes.allureBrew, "6a", "6b")).setIcon(((IBrewContainer) ModItems.vial).getItemForBrew(ModBrews.jumpBoost, new ItemStack(ModItems.vial))); + new PageBrew(ModBrewRecipes.bloodthirstBrew, "5a", "5b"), new PageBrew(ModBrewRecipes.allureBrew, "6a", "6b"), + new PageBrew(ModBrewRecipes.clearBrew, "7a", "7b")).setIcon(((IBrewContainer) ModItems.vial).getItemForBrew(ModBrews.jumpBoost, new ItemStack(ModItems.vial))); incense = new BLexiconEntry(LibLexicon.DEVICE_INCENSE, categoryDevices); incense.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("5"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeIncenseStick), new PageCraftingRecipe("4", ModCraftingRecipes.recipeIncensePlate)); diff --git a/src/main/java/vazkii/botania/common/lib/LibBrewNames.java b/src/main/java/vazkii/botania/common/lib/LibBrewNames.java index 9ec87f5c2..e4219171b 100644 --- a/src/main/java/vazkii/botania/common/lib/LibBrewNames.java +++ b/src/main/java/vazkii/botania/common/lib/LibBrewNames.java @@ -32,6 +32,7 @@ public final class LibBrewNames { public static final String BLOODTHIRST = "bloodthirst"; public static final String OVERLOAD = "overload"; public static final String ALLURE = "allure"; + public static final String CLEAR = "clear"; public static final String WARP_WARD = "warpWard"; diff --git a/src/main/java/vazkii/botania/common/lib/LibPotionNames.java b/src/main/java/vazkii/botania/common/lib/LibPotionNames.java index 341f414ac..049ca9abb 100644 --- a/src/main/java/vazkii/botania/common/lib/LibPotionNames.java +++ b/src/main/java/vazkii/botania/common/lib/LibPotionNames.java @@ -17,5 +17,6 @@ public final class LibPotionNames { public static final String EMPTINESS = "emptiness"; public static final String BLOODTHIRST = "bloodthirst"; public static final String ALLURE = "allure"; + public static final String CLEAR = "clear"; } diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 25c592e5b..9a8ad0f1c 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -1463,6 +1463,7 @@ botania.brew.bloodthirst=Crimson Shade botania.brew.overload=Overload botania.brew.allure=Marine Allure botania.brew.warpWard=Sane Thoughts +botania.brew.clear=Absolution # POTION NAMES botania.potion.soulCross=Soul Cross @@ -1470,6 +1471,7 @@ botania.potion.featherFeet=Feather Feet botania.potion.emptiness=Emptiness botania.potion.bloodthirst=Bloodthirst botania.potion.allure=Allure +botania.potion.clear=Absolution # GUI TEXT botania.gui.lexicon.header=Lexica Botania, %s Edition Table of Contents @@ -2123,15 +2125,17 @@ botania.page.complexBrews0=Apart from the standard, run of the mill &1Brews&0 th botania.page.complexBrews1a=A brew that applies both positive and negative effects. Taking it leaves the affected individual in a state of power, but also vulnerability. botania.page.complexBrews1b=96 Herblore botania.page.complexBrews2a=An entity affected with this brew's effect will regain HP whenever they slay any other creature. -botania.page.complexBrews2b=killy killy JOKER +botania.page.complexBrews2b=It predates the set botania.page.complexBrews3a=An entity affected with this brew's effect will be completely immune to any fall damage. botania.page.complexBrews3b=And I call it magic botania.page.complexBrews4a=This brew casts an aura of emptiness around any entity that has its effect. In a 128 block radius, mobs will not be allowed to spawn naturally. -botania.page.complexBrews4b=50$ for a common!? +botania.page.complexBrews4b=Close the floodgates botania.page.complexBrews5a=This brew casts an aura of emptiness around any entity that has its effect. In a 64 block radius, mobs will be allowed to spawn regardless of light or other conditions. This won't work with &1Emptiness&0. botania.page.complexBrews5b=Shall we pray for a miracle? botania.page.complexBrews6a=A player affected with this brew's effect will have much higher proficiency at fishing and will catch fish and other loot twice as fast. botania.page.complexBrews6b=Maybe you'll catch a Chris +botania.page.complexBrews7a=When drank, this brew will clear all potion effects on the player, negative or otherwise. +botania.page.complexBrews7b=Absolute sooooooul # -- BREW INCENSES botania.entry.incense=Brew Incenses