Posted September 23, 201510 yr 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?
September 23, 201510 yr 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.
September 23, 201510 yr Author I added that to the end of the file (since you didn't specify a location), but it's just replaced the unintelligible character with a '?' in a white square.
September 23, 201510 yr Type '\u00a7' instead of the section sign. Java doesn't like symbols, so it's best to pass the unicode index from the JVM to the system.
September 23, 201510 yr 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.