Skip to content

Commit

Permalink
Fixing missing tools missing textures
Browse files Browse the repository at this point in the history
  • Loading branch information
Otho committed Jan 4, 2015
1 parent cfe756a commit 67d1980
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
9 changes: 9 additions & 0 deletions src/main/java/me/otho/customItems/registry/ItemRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 67d1980

Please sign in to comment.