From a51234bf851a4249b6d884a63b0cfa8bfea6bc0c Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Mon, 16 Dec 2013 19:14:29 +0200 Subject: Minor changes --- .../jewelrycraft/item/ItemThiefGloves.java | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'common/darkknight/jewelrycraft/item') diff --git a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java index 3621dae..5e43010 100644 --- a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java +++ b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java @@ -1,9 +1,14 @@ package darkknight.jewelrycraft.item; import java.util.Iterator; +import java.util.List; import java.util.Random; +import org.lwjgl.input.Keyboard; + +import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.ReflectionHelper; +import cpw.mods.fml.relauncher.Side; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; @@ -11,6 +16,7 @@ import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.village.MerchantRecipe; import net.minecraft.village.MerchantRecipeList; @@ -21,6 +27,7 @@ public class ItemThiefGloves extends ItemBase { super(par1); this.setCreativeTab(CreativeTabs.tabTools); + this.setMaxStackSize(1); } @Override @@ -61,5 +68,34 @@ public class ItemThiefGloves extends ItemBase return super.itemInteractionForEntity(par1ItemStack, par2EntityPlayer, par3EntityLivingBase); } } + @SuppressWarnings("unchecked") + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) + { + if(!shouldAddAdditionalInfo()) list.add(EnumChatFormatting.GRAY + additionalInfoInstructions()); + else{ + list.add(EnumChatFormatting.GRAY + "Right click with the gloves,"); + list.add(EnumChatFormatting.GRAY + "while sneaking, on a villager"); + list.add(EnumChatFormatting.GRAY + "to steal his stuff."); + } + } + + public static boolean shouldAddAdditionalInfo() + { + if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) + { + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) + { + return true; + } + } + return false; + } + + + public static String additionalInfoInstructions() + { + String message = "§oPress §b§7§o for more information."; + return message; + } } -- cgit v1.2.3