diff --git a/src/main/java/me/otho/customItems/mod/items/tools/CustomSword.java b/src/main/java/me/otho/customItems/mod/items/tools/CustomSword.java index 35e0c4b..2784397 100644 --- a/src/main/java/me/otho/customItems/mod/items/tools/CustomSword.java +++ b/src/main/java/me/otho/customItems/mod/items/tools/CustomSword.java @@ -14,6 +14,12 @@ public CustomSword(ToolMaterial mat) { @SideOnly(Side.CLIENT) @Override public void registerIcons(IIconRegister iconRegister) { - itemIcon = iconRegister.registerIcon(ModReference.MOD_ID.toLowerCase() + ":" + this.iconString); + if(this.iconString == null) + { + itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".")+1)); + }else + { + itemIcon = iconRegister.registerIcon(ModReference.MOD_ID.toLowerCase() + ":" + this.iconString); + } } } diff --git a/src/main/java/me/otho/customItems/registry/ItemRegistry.java b/src/main/java/me/otho/customItems/registry/ItemRegistry.java index 02d85bc..efcded7 100644 --- a/src/main/java/me/otho/customItems/registry/ItemRegistry.java +++ b/src/main/java/me/otho/customItems/registry/ItemRegistry.java @@ -51,6 +51,7 @@ public static boolean registerAxe(Cfg_axe data){ Registry.itemsList.add(axe); Registry.itemsList.add(data.creativeTab); + axe.setTextureName(data.textureName); GameRegistry.registerItem(axe, registerName); axe.setUnlocalizedName(Registry.mod_id.toLowerCase()+":"+data.textureName); LanguageRegistry.instance().addStringLocalization(axe.getUnlocalizedName()+".name","en_US",data.name.substring(0, 1).toUpperCase()+data.name.substring(1)); @@ -90,6 +91,7 @@ public static boolean registerBoots(Cfg_boots data){ Registry.itemsList.add(armor); Registry.itemsList.add(data.creativeTab); + armor.setTextureName(data.textureName); GameRegistry.registerItem(armor, registerName); armor.setUnlocalizedName(Registry.mod_id.toLowerCase()+":"+data.name); LanguageRegistry.instance().addStringLocalization(armor.getUnlocalizedName()+".name","en_US",data.name.substring(0, 1).toUpperCase()+data.name.substring(1)); @@ -128,6 +130,7 @@ public static boolean registerChestplate(Cfg_chestplate data){ Registry.itemsList.add(armor); Registry.itemsList.add(data.creativeTab); + armor.setTextureName(data.textureName); GameRegistry.registerItem(armor, registerName); armor.setUnlocalizedName(Registry.mod_id.toLowerCase()+":"+data.name); LanguageRegistry.instance().addStringLocalization(armor.getUnlocalizedName()+".name","en_US",data.name.substring(0, 1).toUpperCase()+data.name.substring(1)); @@ -212,6 +215,7 @@ public static boolean registerHelmet(Cfg_helmet data){ Registry.itemsList.add(armor); Registry.itemsList.add(data.creativeTab); + armor.setTextureName(data.textureName); GameRegistry.registerItem(armor, registerName); armor.setUnlocalizedName(Registry.mod_id.toLowerCase()+":"+data.name); LanguageRegistry.instance().addStringLocalization(armor.getUnlocalizedName()+".name","en_US",data.name.substring(0, 1).toUpperCase()+data.name.substring(1)); @@ -252,6 +256,7 @@ public static boolean registerHoe(Cfg_hoe data){ Registry.itemsList.add(hoe); Registry.itemsList.add(data.creativeTab); + hoe.setTextureName(data.textureName); GameRegistry.registerItem(hoe, registerName); hoe.setUnlocalizedName(Registry.mod_id.toLowerCase()+":"+data.textureName); LanguageRegistry.instance().addStringLocalization(hoe.getUnlocalizedName()+".name","en_US",data.name.substring(0, 1).toUpperCase()+data.name.substring(1)); @@ -323,6 +328,7 @@ public static boolean registerLeggings(Cfg_leggings data){ Registry.itemsList.add(armor); Registry.itemsList.add(data.creativeTab); + armor.setTextureName(data.textureName); GameRegistry.registerItem(armor, registerName); armor.setUnlocalizedName(Registry.mod_id.toLowerCase()+":"+data.name); LanguageRegistry.instance().addStringLocalization(armor.getUnlocalizedName()+".name","en_US",data.name.substring(0, 1).toUpperCase()+data.name.substring(1)); @@ -360,6 +366,7 @@ public static boolean registerPickaxe(Cfg_pickaxe data){ CustomPickaxe pickaxe = new CustomPickaxe(material); + pickaxe.setTextureName(data.textureName); Registry.itemsList.add(pickaxe); Registry.itemsList.add(data.creativeTab); @@ -400,6 +407,7 @@ public static boolean registerShovel(Cfg_shovel data){ CustomShovel shovel = new CustomShovel(material); + shovel.setTextureName(data.textureName); Registry.itemsList.add(shovel); Registry.itemsList.add(data.creativeTab); @@ -440,6 +448,7 @@ public static boolean registerSword(Cfg_sword data){ CustomSword sword = new CustomSword(material); + sword.setTextureName(data.textureName); Registry.itemsList.add(sword); Registry.itemsList.add(data.creativeTab);