Add in proper language support. Submit translations as pull requests!

This commit is contained in:
Christian 2013-07-09 16:40:47 -04:00
parent e9a9bcb46b
commit 4aaec43ac5
4 changed files with 19 additions and 7 deletions

View File

@ -72,13 +72,8 @@ public class IronChest {
for (IronChestType typ : IronChestType.values()) for (IronChestType typ : IronChestType.values())
{ {
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest."+typ.name(), typ.name()); GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest."+typ.name(), typ.name());
LanguageRegistry.instance().addStringLocalization(typ.name() + ".name", "en_US", typ.friendlyName);
proxy.registerTileEntitySpecialRenderer(typ); proxy.registerTileEntitySpecialRenderer(typ);
} }
for (ChestChangerType typ : ChestChangerType.values())
{
LanguageRegistry.instance().addStringLocalization("item." + typ.itemName + ".name", "en_US", typ.descriptiveName);
}
IronChestType.registerBlocksAndRecipes(ironChestBlock); IronChestType.registerBlocksAndRecipes(ironChestBlock);
ChestChangerType.generateRecipes(); ChestChangerType.generateRecipes();
NetworkRegistry.instance().registerGuiHandler(instance, proxy); NetworkRegistry.instance().registerGuiHandler(instance, proxy);

View File

@ -31,7 +31,7 @@ public class ItemChestChanger extends Item {
super(id); super(id);
setMaxStackSize(1); setMaxStackSize(1);
this.type = type; this.type = type;
setUnlocalizedName(type.itemName); setUnlocalizedName("ironchest:"+type.name());
setCreativeTab(CreativeTabs.tabMisc); setCreativeTab(CreativeTabs.tabMisc);
} }

View File

@ -31,6 +31,6 @@ public class ItemIronChest extends ItemBlock {
@Override @Override
public String getUnlocalizedName(ItemStack itemstack) public String getUnlocalizedName(ItemStack itemstack)
{ {
return IronChestType.values()[itemstack.getItemDamage()].name(); return "tile.ironchest:"+IronChestType.values()[itemstack.getItemDamage()].name();
} }
} }

View File

@ -0,0 +1,17 @@
tile.ironchest:IRON.name=Iron Chest
tile.ironchest:GOLD.name=Gold Chest
tile.ironchest:DIAMOND.name=Diamond Chest
tile.ironchest:COPPER.name=Copper Chest
tile.ironchest:SILVER.name=Silver Chest
tile.ironchest:CRYSTAL.name=Crystal Chest
tile.ironchest:OBSIDIAN.name=Obsidian Chest
item.ironchest:IRONGOLD.name=Iron to Gold Chest Upgrade
item.ironchest:GOLDDIAMOND.name=Gold to Diamond Chest Upgrade
item.ironchest:COPPERSILVER.name=Copper to Silver Chest Upgrade
item.ironchest:SILVERGOLD.name=Silver to Gold Chest Upgrade
item.ironchest:COPPERIRON.name=Copper to Iron Chest Upgrade
item.ironchest:DIAMONDCRYSTAL.name=Diamond to Crystal Chest Upgrade
item.ironchest:WOODIRON.name=Wood to Iron Chest Upgrade
item.ironchest:WOODCOPPER.name=Wood to Copper Chest Upgrade
item.ironchest:DIAMONDOBSIDIAN.name=Diamond to Obsidian Chest Upgrade