summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/item
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-16 16:34:17 +0200
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2013-12-16 16:34:17 +0200
commit26d28c9b93133a6cfc5d2544c662e9d77955b6f5 (patch)
treeba4a4cb9829a14db82e67af26e2e21fc59571ead /common/darkknight/jewelrycraft/item
parent1f718427162fa59a22c08a32e68e133fb411aa37 (diff)
Rings and molder
Diffstat (limited to 'common/darkknight/jewelrycraft/item')
-rw-r--r--common/darkknight/jewelrycraft/item/ItemList.java2
-rw-r--r--common/darkknight/jewelrycraft/item/ItemMolds.java9
-rw-r--r--common/darkknight/jewelrycraft/item/ItemRing.java46
3 files changed, 52 insertions, 5 deletions
diff --git a/common/darkknight/jewelrycraft/item/ItemList.java b/common/darkknight/jewelrycraft/item/ItemList.java
index 261fa9e..5418c52 100644
--- a/common/darkknight/jewelrycraft/item/ItemList.java
+++ b/common/darkknight/jewelrycraft/item/ItemList.java
@@ -10,6 +10,7 @@ public class ItemList
public static Item thiefGloves;
public static Item shadowIngot;
public static Item molds;
+ public static Item ring;
private static boolean isInitialized = false;
@@ -20,6 +21,7 @@ public class ItemList
thiefGloves = new ItemThiefGloves(ConfigHandler.idThiefGloves).setUnlocalizedName("jewelrycraft.thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft);
shadowIngot = new ItemBase(ConfigHandler.idShadowIngot).setUnlocalizedName("jewelrycraft.ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft);
molds = new ItemMolds(ConfigHandler.idMolds).setUnlocalizedName("jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ ring = new ItemRing(ConfigHandler.idRing).setUnlocalizedName("jewelrycraft.ring").setCreativeTab(JewelrycraftMod.jewelrycraft);
}
}
}
diff --git a/common/darkknight/jewelrycraft/item/ItemMolds.java b/common/darkknight/jewelrycraft/item/ItemMolds.java
index 9beb03a..090d53a 100644
--- a/common/darkknight/jewelrycraft/item/ItemMolds.java
+++ b/common/darkknight/jewelrycraft/item/ItemMolds.java
@@ -14,7 +14,7 @@ import net.minecraft.util.MathHelper;
public class ItemMolds extends Item
{
/** List of molds color names */
- public static final String[] moldsItemNames = new String[] {"ingot", "ring", "necklace"};
+ public static final String[] moldsItemNames = new String[] {"ingot", "ring"};
@SideOnly(Side.CLIENT)
private Icon[] moldsIcons;
@@ -24,7 +24,6 @@ public class ItemMolds extends Item
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setMaxStackSize(1);
- this.setCreativeTab(CreativeTabs.tabMaterials);
}
@SideOnly(Side.CLIENT)
@@ -34,7 +33,7 @@ public class ItemMolds extends Item
*/
public Icon getIconFromDamage(int par1)
{
- int j = MathHelper.clamp_int(par1, 0, 2);
+ int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1);
return this.moldsIcons[j];
}
@@ -44,7 +43,7 @@ public class ItemMolds extends Item
*/
public String getUnlocalizedName(ItemStack par1ItemStack)
{
- int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 2);
+ int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, moldsItemNames.length - 1);
return super.getUnlocalizedName() + "." + moldsItemNames[i];
}
@@ -56,7 +55,7 @@ public class ItemMolds extends Item
*/
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
{
- for (int j = 0; j < 3; ++j)
+ for (int j = 0; j < moldsItemNames.length; ++j)
{
par3List.add(new ItemStack(par1, 1, j));
}
diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java
new file mode 100644
index 0000000..155261c
--- /dev/null
+++ b/common/darkknight/jewelrycraft/item/ItemRing.java
@@ -0,0 +1,46 @@
+package darkknight.jewelrycraft.item;
+
+import java.util.List;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.util.EnumChatFormatting;
+
+public class ItemRing extends ItemBase
+{
+ public ItemStack ingot;
+ public PotionEffect effect;
+
+ public ItemRing(int par1)
+ {
+ super(par1);
+ this.setMaxStackSize(1);
+ }
+
+ public ItemRing(int par1, ItemStack ingot)
+ {
+ this(par1);
+ this.ingot = ingot;
+ }
+
+ public ItemRing(int par1, ItemStack ingot, PotionEffect effect)
+ {
+ this(par1, ingot);
+ this.effect = effect;
+ }
+
+ public int getColor(ItemStack par1ItemStack)
+ {
+ return 65535;
+ }
+
+ /**
+ * allows items to add custom lines of information to the mouseover description
+ */
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
+ {
+ if(ingot != null) list.add(EnumChatFormatting.GRAY + ingot.getDisplayName());
+ if(effect != null) list.add(EnumChatFormatting.GREEN + effect.getEffectName());
+ }
+}