Jump to content

[1.8] Tooltip formatting breaks after the mod has been built


Recommended Posts

Posted

I've been using the section sign (§) to make my item tooltips a bit more colorful. I've been doing this using Item#addInformation. The formatting works perfectly in the development environment, but whenever I build the mod and use it in the actual game, it bugs out and seems to replace all the section signs with another unintelligible symbol, resulting in no formatting taking place. What's wrong?

Posted

You need to make Gradle compile your code as UTF-8 by adding this to build.gradle:

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted

Like diesieben07 said, it will work if you use UTF-8 everywhere. I assumed that your code was already saved as UTF-8, I didn't realise that the section sign is also present in older encodings like Windows-1252.

 

You can see an example of this here (lang file is here). It looks like this in the obfuscated client.

 

Edit: Added missing closing tag

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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