summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/item
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-16 19:14:29 +0200
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-16 19:14:29 +0200
commita51234bf851a4249b6d884a63b0cfa8bfea6bc0c (patch)
tree673f67ef726079fef89e267b3eafc4e75ce36706 /common/darkknight/jewelrycraft/item
parentf9d492fbb509e9e2b4b3a2fcf1ab04e322940bf2 (diff)
Minor changes
Diffstat (limited to 'common/darkknight/jewelrycraft/item')
-rw-r--r--common/darkknight/jewelrycraft/item/ItemThiefGloves.java36
1 files changed, 36 insertions, 0 deletions
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<SHIFT>§7§o for more information.";
+ return message;
+ }
}