diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-26 01:51:30 +0200 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2013-12-26 01:51:30 +0200 |
| commit | 1b240121e2865f78d3884549cc9465db7c62d5e7 (patch) | |
| tree | 551c08d1a25d723e8b64661071b1f434b48f8f89 /common | |
| parent | 1a3455b24d90b0def912c28467cbc51662d660e0 (diff) | |
Fixed a bug?
Diffstat (limited to 'common')
3 files changed, 17 insertions, 10 deletions
diff --git a/common/darkknight/jewelrycraft/item/ItemList.java b/common/darkknight/jewelrycraft/item/ItemList.java index d099836..1f623fb 100644 --- a/common/darkknight/jewelrycraft/item/ItemList.java +++ b/common/darkknight/jewelrycraft/item/ItemList.java @@ -21,8 +21,8 @@ public class ItemList { thiefGloves = new ItemThiefGloves(ConfigHandler.idThiefGloves - 256).setUnlocalizedName("Jewelrycraft.thiefGloves").setTextureName("jewelrycraft:thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); shadowIngot = new Item(ConfigHandler.idShadowIngot - 256).setUnlocalizedName("Jewelrycraft.ingotShadow").setTextureName("jewelrycraft:ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); - molds = new ItemMolds(ConfigHandler.idMolds - 256).setUnlocalizedName("Jewelrycraft.mold").setTextureName("mold").setCreativeTab(JewelrycraftMod.jewelrycraft); - clayMolds = new ItemClayMolds(ConfigHandler.idClayMolds - 256).setUnlocalizedName("Jewelrycraft.mold").setTextureName("mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + molds = new ItemMolds(ConfigHandler.idMolds - 256).setUnlocalizedName("Jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); + clayMolds = new ItemClayMolds(ConfigHandler.idClayMolds - 256).setUnlocalizedName("Jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); ring = new ItemRing(ConfigHandler.idRing - 256).setUnlocalizedName("Jewelrycraft.ring").setTextureName("jewelrycraft:ring").setCreativeTab(JewelrycraftMod.jewelrycraft); isInitialized = true; diff --git a/common/darkknight/jewelrycraft/item/ItemMolds.java b/common/darkknight/jewelrycraft/item/ItemMolds.java index 25ebe70..93b30e1 100644 --- a/common/darkknight/jewelrycraft/item/ItemMolds.java +++ b/common/darkknight/jewelrycraft/item/ItemMolds.java @@ -17,7 +17,7 @@ public class ItemMolds extends Item public static final String[] moldsItemNames = new String[] { "ingot", "ring" }; @SideOnly(Side.CLIENT) private Icon[] moldsIcons; - + public ItemMolds(int par1) { super(par1); @@ -25,7 +25,7 @@ public class ItemMolds extends Item this.setMaxDamage(0); this.setMaxStackSize(1); } - + @SideOnly(Side.CLIENT) /** * Gets an icon index based on an item's damage value @@ -35,7 +35,7 @@ public class ItemMolds extends Item int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1); return this.moldsIcons[j]; } - + /** * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different names based on * their damage or NBT. @@ -45,7 +45,7 @@ public class ItemMolds extends Item int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, moldsItemNames.length - 1); return super.getUnlocalizedName() + "." + moldsItemNames[i]; } - + @SuppressWarnings({ "unchecked", "rawtypes" }) @SideOnly(Side.CLIENT) /** @@ -58,15 +58,22 @@ public class ItemMolds extends Item par3List.add(new ItemStack(par1, 1, j)); } } - + @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.moldsIcons = new Icon[moldsItemNames.length]; - + for (int i = 0; i < moldsItemNames.length; ++i) { this.moldsIcons[i] = par1IconRegister.registerIcon("jewelrycraft:" + moldsItemNames[i] + this.getIconString()); } } + + @Override + public Item setUnlocalizedName(String name) + { + Item r = super.setUnlocalizedName(name); + return r.setTextureName(name.toLowerCase().replaceAll("\\.", ":")); + } } diff --git a/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java b/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java index c9480ce..4ff6415 100644 --- a/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java +++ b/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java @@ -59,7 +59,7 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer GL11.glScalef(1.25F, 1.0F, 1.25F); GL11.glRotatef(90F, 1F, 0F, 0f); RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + if(entityitem != null) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderItem.renderInFrame = false; GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); @@ -75,7 +75,7 @@ public class TileEntityMolderRender extends TileEntitySpecialRenderer GL11.glScalef(1.25F, 1.0F, 1.25F); GL11.glRotatef(90F, 1F, 0F, 0f); RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); + if(entityitem != null) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); RenderItem.renderInFrame = false; GL11.glColor4f(1, 1F, 1F, 1.0F); GL11.glEnable(GL11.GL_LIGHTING); |
