diff --git a/MODSRC/vazkii/botania/common/core/BotaniaCreativeTab.java b/MODSRC/vazkii/botania/common/core/BotaniaCreativeTab.java index 4f19fcd1d..827c96274 100644 --- a/MODSRC/vazkii/botania/common/core/BotaniaCreativeTab.java +++ b/MODSRC/vazkii/botania/common/core/BotaniaCreativeTab.java @@ -78,6 +78,7 @@ public final class BotaniaCreativeTab extends CreativeTabs { addBlock(ModBlocks.forestDrum); addBlock(ModBlocks.forestEye); addBlock(ModBlocks.enderEye); + addItem(ModItems.enderHand); addItem(ModItems.spawnerMover); addBlock(ModBlocks.spawnerClaw); diff --git a/MODSRC/vazkii/botania/common/item/ItemEnderHand.java b/MODSRC/vazkii/botania/common/item/ItemEnderHand.java new file mode 100644 index 000000000..342b4b3ff --- /dev/null +++ b/MODSRC/vazkii/botania/common/item/ItemEnderHand.java @@ -0,0 +1,53 @@ +/** + * 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 @ [Jul 31, 2014, 7:19:26 PM (GMT)] + */ +package vazkii.botania.common.item; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import vazkii.botania.api.mana.ManaItemHandler; +import vazkii.botania.common.lib.LibItemNames; + +public class ItemEnderHand extends ItemMod { + + private static final int COST_SELF = 250; + private static final int COST_OTHER = 5000; + + public ItemEnderHand() { + setMaxDamage(1); + setUnlocalizedName(LibItemNames.ENDER_HAND); + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { + if(ManaItemHandler.requestManaExact(stack, player, COST_SELF, false)) { + player.displayGUIChest(player.getInventoryEnderChest()); + ManaItemHandler.requestManaExact(stack, player, COST_SELF, true); + world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F); + } + return stack; + } + + @Override + public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer iplayer, EntityLivingBase entity) { + if(entity instanceof EntityPlayer && ManaItemHandler.requestManaExact(stack, iplayer, COST_OTHER, false)) { + iplayer.displayGUIChest(((EntityPlayer) entity).getInventoryEnderChest()); + ManaItemHandler.requestManaExact(stack, iplayer, COST_OTHER, true); + iplayer.worldObj.playSoundAtEntity(iplayer, "mob.endermen.portal", 1F, 1F); + return true; + } + + return false; + } + +} diff --git a/MODSRC/vazkii/botania/common/item/ModItems.java b/MODSRC/vazkii/botania/common/item/ModItems.java index a6ffd7478..2c6ceb787 100644 --- a/MODSRC/vazkii/botania/common/item/ModItems.java +++ b/MODSRC/vazkii/botania/common/item/ModItems.java @@ -146,6 +146,7 @@ public final class ModItems { public static Item skyDirtRod; public static Item itemFinder; public static Item superLavaPendant; + public static Item enderHand; public static void init() { lexicon = new ItemLexicon(); @@ -228,7 +229,8 @@ public final class ModItems { skyDirtRod = new ItemSkyDirtRod(); itemFinder = new ItemItemFinder(); superLavaPendant = new ItemSuperLavaPendant(); - + enderHand = new ItemEnderHand(); + 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/lib/LibItemNames.java b/MODSRC/vazkii/botania/common/lib/LibItemNames.java index daa1ad20f..e68de2cfb 100644 --- a/MODSRC/vazkii/botania/common/lib/LibItemNames.java +++ b/MODSRC/vazkii/botania/common/lib/LibItemNames.java @@ -93,6 +93,7 @@ public final class LibItemNames { public static final String ELEMENTIUM_HELM_R = "elementiumHelmReveal"; public static final String ITEM_FINDER = "itemFinder"; public static final String SUPER_LAVA_PENDANT = "superLavaPendant"; + public static final String ENDER_HAND = "enderHand"; public static final String[] LENS_NAMES = new String[] { "lensNormal", diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index 756dc2ddc..6cab6543e 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -655,6 +655,7 @@ item.botania:terrasteelHelmReveal.name=Terrasteel Helmet of Revealing item.botania:elementiumHelmReveal.name=Elementium Helmet of Revealing item.botania:itemFinder.name=The Spectator item.botania:superLavaPendant.name=Crimson Pendant +item.botania:enderHand.name=Hand of Ender # GUI TEXT botania.gui.lexicon.header=Lexica Botania, %s Edition's Index - Pick which category you would like to study: