Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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.

  • Author

Im still getting names like tile.sand.name with getLocalizedName(), with or without the StatCollector.translateToLocal.

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.

  • 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

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.

  • 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.

  • 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.

  • Author

Yet, it's not. :P

 

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.