Posted April 13, 201510 yr So, in addInformation, I'm trying to get a block's translated name. This is what I've been trying: list.add(StatCollector.translateToLocal("Bound Block: " + StatCollector.translateToLocal(Block.getBlockById(stack.stackTagCompound.getInteger(tagID)).getUnlocalizedName()))); But this is still returning tile.xxx.name, and getLocalizeName just subtracts the ".name". What is the correct method for doing this?
April 14, 201510 yr Use Block#getLocalizedName(). I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
April 14, 201510 yr Author Im still getting names like tile.sand.name with getLocalizedName(), with or without the StatCollector.translateToLocal.
April 14, 201510 yr That should return the correct localized name. (Don't use StatCollector for that; It is already localized) It seems that forge couldn't find your lang file or your lang file does not contain the exact name. So please post where your lang files are, and the contents of them. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
April 14, 201510 yr Author src\main\resources\assets\filltool\lang\en_US.lang itemGroup.FillTab=Fill Tool item.fillTool.name=Fill Tool I don't see how my lang file is the issue here, shouldn't that be an issue with Minecraft's lang file since we're talking about vanilla blocks? Woah that's weird, yeah guess there is some issue in the dev workspace, I just put it on my server, and it translates fine
April 14, 201510 yr Oh it was vanilla block. What block do you want to show? And please post your current code of the item. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
April 14, 201510 yr Author Any block the player right clicks on. Like I said though, it was only failing to translate in the dev workspace, it works fine after it's built.
April 14, 201510 yr For client, there's I18n. Use format() with unlocalized name... Check out my mods: BTAM Armor sets Avoid Exploding Creepers Tools compressor Anti Id Conflict Key bindings overhaul Colourfull blocks Invisi Zones
April 14, 201510 yr Author IntelliJ, I add idea { module { inheritOutputDirs = true } } sourceSets { main { output.resourcesDir = output.classesDir } } to the end of the build.gradle, import it, run setupDecompWorkspace inside IntelliJ, then run gradlew gIR from a command prompt. PS I should also note, it's giving me translated names for some blocks, and not others in the dev workspace, like sand and dirt are never translated, but grass and leaves are.
April 14, 201510 yr Author Yet, it's not. I have both because the second one's left over from the first tutorial I read on the setup.
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.