Posted September 11, 201213 yr Hello everyone. I'm having some problems with addStringLocalizations with multiname blocks. When I'm adding localizations I use something like this: public void build(){ for(int i = 0; i < names.length; i++){ String buildedname = new StringBuilder() .append(MyMod.id) .append(".") .append(prefix) .append(".") .append(names[i].replace(' ', '_').toLowerCase()) .append(".name") .toString(); LanguageRegistry.instance().addStringLocalization(buildedname, "en_US", names[i]); } } Where prefix e MyMod.id are Strings and names is an array of Strings containing block names. In the ItemBlock I'm using something like this: @Override public String getItemNameIS(ItemStack is){ String buildedname = new StringBuilder() .append(MyMod.id) .append(".ore.") .append(MyMod.instance.oreItemNames[is.getItemDamage()].replace(' ', '_').toLowerCase()) .append(".name") .toString(); return buildedname; } The problem is that minecraft won't display names. I've already checked if the builded localizations are equals and if the ItemBlock is actually used. Also my game is running in English. Thank you all.
September 14, 201213 yr as far as i can see you missed the "tile." notation heres a bsp from my code (without your stringbuilder just for reference) for(int i = 1; i < 8; ++i) { LanguageRegistry.instance().addStringLocalization("tile.testblock.sub"+i+".name", "Maschine V"+(i+1)); } and this part is taken from my itemblock: @Override public String getItemNameIS(ItemStack itemstack) { return getItemName() + ".sub" + itemstack.getItemDamage(); } your problem seems to be the mymod.id and prefix. instead you have to use the blockname. (testblock in my case) Garbage Collection In Progress <|||| >
September 15, 201213 yr Author Ok, I've fixed it, thank you a lot. Basically you always have to add ".name" to the string when registering it. You don't have to put it when building the string in getItemNameIS.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.