From 232a9cbf1ff8a434b4f644de1c88e0de4ccf612e Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sun, 27 Apr 2014 21:13:47 +0100 Subject: [PATCH] Added the Golden Laurel Crown. --- .../common/core/BotaniaCreativeTab.java | 1 + .../vazkii/botania/common/item/ModItems.java | 5 +- .../equipment/bauble/ItemGoldenLaurel.java | 55 ++++++++++++++++++ .../botania/common/lib/LibItemNames.java | 1 + resources/assets/botania/lang/en_US.lang | 4 +- .../botania/textures/items/goldenLaurel.png | Bin 0 -> 310 bytes 6 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 MODSRC/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java create mode 100644 resources/assets/botania/textures/items/goldenLaurel.png diff --git a/MODSRC/vazkii/botania/common/core/BotaniaCreativeTab.java b/MODSRC/vazkii/botania/common/core/BotaniaCreativeTab.java index 51d14fce1..73e25d3ed 100644 --- a/MODSRC/vazkii/botania/common/core/BotaniaCreativeTab.java +++ b/MODSRC/vazkii/botania/common/core/BotaniaCreativeTab.java @@ -97,6 +97,7 @@ public final class BotaniaCreativeTab extends CreativeTabs { addItem(ModItems.knockbackBelt); addItem(ModItems.icePendant); addItem(ModItems.lavaPendant); + addItem(ModItems.goldLaurel); addItem(ModItems.manaTablet); addItem(ModItems.manaMirror); diff --git a/MODSRC/vazkii/botania/common/item/ModItems.java b/MODSRC/vazkii/botania/common/item/ModItems.java index c49929d30..b5ea5332b 100644 --- a/MODSRC/vazkii/botania/common/item/ModItems.java +++ b/MODSRC/vazkii/botania/common/item/ModItems.java @@ -24,6 +24,7 @@ import vazkii.botania.common.item.equipment.armor.ItemTerrasteelChest; import vazkii.botania.common.item.equipment.armor.ItemTerrasteelHelm; import vazkii.botania.common.item.equipment.armor.ItemTerrasteelLegs; import vazkii.botania.common.item.equipment.bauble.ItemAuraRing; +import vazkii.botania.common.item.equipment.bauble.ItemGoldenLaurel; import vazkii.botania.common.item.equipment.bauble.ItemGreaterAuraRing; import vazkii.botania.common.item.equipment.bauble.ItemGreaterManaRing; import vazkii.botania.common.item.equipment.bauble.ItemIcePendant; @@ -84,6 +85,7 @@ public final class ModItems { public static Item knockbackBelt; public static Item icePendant; public static Item lavaPendant; + public static Item goldLaurel; public static void init() { lexicon = new ItemLexicon(); @@ -128,7 +130,8 @@ public final class ModItems { knockbackBelt = new ItemKnockbackBelt(); icePendant = new ItemIcePendant(); lavaPendant = new ItemLavaPendant(); - + goldLaurel = new ItemGoldenLaurel(); + OreDictionary.registerOre(LibOreDict.LEXICON, lexicon); for(int i = 0; i < 16; i++) { OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i)); diff --git a/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java new file mode 100644 index 000000000..3f5fad594 --- /dev/null +++ b/MODSRC/vazkii/botania/common/item/equipment/bauble/ItemGoldenLaurel.java @@ -0,0 +1,55 @@ +/** + * 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 @ [Apr 27, 2014, 8:49:01 PM (GMT)] + */ +package vazkii.botania.common.item.equipment.bauble; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.living.LivingDeathEvent; +import vazkii.botania.common.lib.LibItemNames; +import baubles.api.BaubleType; +import baubles.common.lib.PlayerHandler; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public class ItemGoldenLaurel extends ItemBauble { + + public ItemGoldenLaurel() { + super(LibItemNames.GOLDEN_LAUREL); + MinecraftForge.EVENT_BUS.register(this); + } + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onPlayerDeath(LivingDeathEvent event) { + if(event.entity instanceof EntityPlayer) { + EntityPlayer player = (EntityPlayer) event.entity; + ItemStack amulet = PlayerHandler.getPlayerBaubles(player).getStackInSlot(0); + + if(amulet != null && amulet.getItem() == this) { + event.setCanceled(true); + player.setHealth(player.getMaxHealth()); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, 300, 6)); + player.addChatMessage(new ChatComponentTranslation("botaniamisc.savedByLaurel")); + player.worldObj.playSoundAtEntity(player, "random.levelup", 1F, 0.3F); + PlayerHandler.getPlayerBaubles(player).setInventorySlotContents(0, null); + } + } + } + + @Override + public BaubleType getBaubleType(ItemStack itemstack) { + return BaubleType.AMULET; + } +} diff --git a/MODSRC/vazkii/botania/common/lib/LibItemNames.java b/MODSRC/vazkii/botania/common/lib/LibItemNames.java index 2ebe5a1ba..e87036d29 100644 --- a/MODSRC/vazkii/botania/common/lib/LibItemNames.java +++ b/MODSRC/vazkii/botania/common/lib/LibItemNames.java @@ -57,6 +57,7 @@ public final class LibItemNames { public static final String KNOCKBACK_BELT = LibResources.PREFIX_MOD + "knockbackBelt"; public static final String ICE_PENDANT = LibResources.PREFIX_MOD + "icePendant"; public static final String LAVA_PENDANT = LibResources.PREFIX_MOD + "lavaPendant"; + public static final String GOLDEN_LAUREL = LibResources.PREFIX_MOD + "goldenLaurel"; public static final String[] LENS_NAMES = new String[] { LibResources.PREFIX_MOD + "lensNormal", diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index bc3d3e89a..dbea1facb 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -23,6 +23,7 @@ botaniamisc.filter1=Pickup only items not in Frames botaniamisc.filter2=Pickup any items botaniamisc.creativePool0=Creative Mana Pool, has infinite Mana botaniamisc.creativePool1=Worthy of an Egoist +botaniamisc.savedByLaurel=Your Golden Laurel Crown shatters, as it saves you from death. # COLORS botania.color0=White @@ -301,6 +302,7 @@ item.botania:knockbackBelt.name=Tectonic Girdle item.botania:icePendant.name=Snowflake Pendant item.botania:lavaPendant.name=Pyroclast Pendant item.botania:lifeEssence.name=Essence of Eternal Life +item.botania:goldenLaurel.name=Golden Laurel Crown # GUI TEXT botania.gui.lexicon.header=Lexica Botania Index - Pick which category you would like to study: @@ -383,7 +385,7 @@ botania.entry.terrasteel=Terrasteel botania.page.terrasteel0=&1Terrasteel&0 is a powerful metal infused with the magic of nature.
Creating this metal proves to not be a short order, in order to create it, toss a &1Manasteel Ingot&0, a &1Mana Pearl&0 and a &1Mana Diamond&0 on top of an &4Active &1Beacon&0. A &1Mana Pool&0 must be present nearby, being at least half full. The infusion will create a single &1Terrasteel Ingot&0. botania.page.terrasteel1=Creating &1Terrasteel&0 botania.page.terrasteel2=By combining the &1Terrasteel&0 with a &1Nether Star&0 and &1Blaze Powder&0, it's possible to artificially create a small extract of &1Essence of Eternal Life&0, a very powerful component in the creation of magical flora and natural instruments. -botania.page.terrasteel3=An extract of &1Essence of Eternal Life&0 +botania.page.terrasteel3=These come not from Kyubey # - MANA # -- AN INTRODUCTION TO MANA diff --git a/resources/assets/botania/textures/items/goldenLaurel.png b/resources/assets/botania/textures/items/goldenLaurel.png new file mode 100644 index 0000000000000000000000000000000000000000..6ac063ed12db68acc8325c0bd361d17c6353ac1e GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0gN_s>q|KvhdUT^vI!{P#|@!>4Ct_7YsJC zpKy4td%@xPpNqz^1<_NS&X+jm9z4V@eWH8Hq5bA7{vY(8_p$Pk(#*`c1?A#z6qD|& zNH2W3ZRTv987j`c62UT+TA6v90yy7a68YV@fyq;f|EKT