ReikaKalseki / Reika_Mods_Issues

The issue tracker for all of my mods - RotaryCraft, its addons, ChromatiCraft, and everything else.
46 stars 13 forks source link

Minecraft crashed when RotaryCraft V10b loading its xml localization files of the handbook #517

Closed GWYOG closed 8 years ago

GWYOG commented 8 years ago

It seems that there is a problem with the loading of xml localization files of RotaryCraft's handbook.

When I use Chinese language (i.e. “简体中文(中国)”) to startup MC, it crashs. However, if I use English(US) or just delete the “Resources/zh_CN/” folder, MC can startup normally with RotaryCraft. The crash-report says that MC crashs because RotaryCraft failed to load these xml files. Also, when I use the Spanish to start MC, it crashs either. (There are Spanish xml files of the handbooks too.)

Using DragonAPI V10c and RotaryCraft V10b Crash-report: http://pastebin.com/STQyH3Tp Fml-client-latest log: http://pastebin.com/VqiFGG7N

zemerick commented 8 years ago

Current recommended forge is 1558, please try installing it.

GWYOG commented 8 years ago

Actually, it's not caused by low version of forge, because the same crash happens with forge 1558. Also, without these xml files, RotaryCraft runs well with forge 1448.

Crash-report with forge 1558: http://pastebin.com/uaFmfx27 Fml-client-latest with forge 1558: http://pastebin.com/XBczcBea

ReikaKalseki commented 8 years ago

The w3c DOM XML parser is vomiting when being fed non-English characters. This has already happened with 'ñ' in the Spanish localization.

ljfa-ag commented 8 years ago

Maybe it helps if you specify the encoding in the <?xml ?> declaration?

ReikaKalseki commented 8 years ago

??

ljfa-ag commented 8 years ago

Having <?xml version="1.0" encoding="UTF-8" ?> at the beginning of the files. But I think UTF-8 is the default anyway.

But actually I just spotted a typo in machines.xml: The last tag is </machies> rather than </machines>. That's what the error message translated from Chinese says as well.

GWYOG commented 8 years ago

Yep, there is a missing "n" in "Resources/zh_CN/machines.xml"'s tag. But the same Exception thrown again after adding the letter "n" back. Moreover, when switching the language to Spanish, error message still comes from path at "Resources/es_ES/machines.xml"

Really weird this happens.... Hoping to see it fixed in the next release, otherwise most of the Chinese players probably would be unable to enjoy RoC V10.

ReikaKalseki commented 8 years ago

So...no solutions thus far? Fixing the typo changed nothing.

3TUSK commented 8 years ago

Do those xml files have to be added by @ReikaKalseki yourself? cause I heard about that the RoC jar is signed and the signature is protecting the jar from being modified. I have never tested the validity of this speaking, so I may be wrong.

ReikaKalseki commented 8 years ago

Yes, they would need to be added by me.

3TUSK commented 8 years ago

Then I probably find the reason--- in order to test in game, localizer usually choose to put the language file(s) into the jar directly. Can we implement these xml files via a resourcepack?

ReikaKalseki commented 8 years ago

My XML loading system does not go through the resource packs, no, because I do not want resource packs to be able to change the handbook text.

3TUSK commented 8 years ago

@ReikaKalseki Any progress here? But I want to point out that there is a pull request that attempts to update the Chinese translation: ReikaKalseki/RotaryCraft#30

ReikaKalseki commented 8 years ago

I have not yet had the chance, no.

3TUSK commented 8 years ago

@GWYOG Have you ever tried thew new xml files here? If those xml files work then we will have the solution.

GWYOG commented 8 years ago

@3TUSK I tried them just now, but still failed to start MC due to the same Exception. I think this issue may be explained by what you have said, namely we can't simply add these xml files into Roc's .jar file due to the SHA-256-Digest ROC uses. Sorry, but I have no idea on how to test these xml files properly :(

3TUSK commented 8 years ago

@ReikaKalseki Just curious, how can translators test their xml files in-game? I acknowledge that you are trying to keep people from modifying your mods, but such a protection also gives translators no chance to test translations in order to proofread and make sure that there is nothing wrong. Seriously, testing translation should be a good habit for every translator; otherwise, here is an example: MightyPirates/TIS-3D#44, translation froze the game at first until several workarounds from both sides appeared.

Edit: Both #654 and #655 point to Resources/zh_CN/trans.xml. But I see no problem?

Edit 2nd: Notice that in Resources/zh_CN/trans.xml, there is a white space at beginning of 1st line. Is that origin of crash? At least I don't think so, but that is the only difference I can find between trans.xml and other xml files.

~~Edit 3rd: Any comment on this pull request?~~

Edit 4th: See my comments below.

ReikaKalseki commented 8 years ago

There are ways to defeat the jar signing, though I will not publicly say how. Outside of that, I am not sure if you have any options aside from downloading the mod as source.

3TUSK commented 8 years ago

@ReikaKalseki Finally I found another problem: there are several %s appeared immediately before \n, which causes the following crash:

---- Minecraft Crash Report ----
// This doesn't make any sense!

Time: 3/28/16 11:33 AM
Description: Initializing game

java.util.UnknownFormatConversionException: Conversion = '
'
    at java.util.Formatter.checkText(Formatter.java:2579)
    at java.util.Formatter.parse(Formatter.java:2555)
    at java.util.Formatter.format(Formatter.java:2501)
    at java.util.Formatter.format(Formatter.java:2455)
    at java.lang.String.format(String.java:2940)
    at Reika.RotaryCraft.Auxiliary.RotaryDescriptions.loadData(RotaryDescriptions.java:319)
    at Reika.RotaryCraft.RotaryCraft.load(RotaryCraft.java:348)
(omitted rest part)

Obviously the solution is to use %% instead. After I replace all %\n with %%\n, game stopped crash and manual got translated. (If you wonder how can I test xml in-game: my friend helped me to "disable" protection temporarily and privately. I swear that this build is only used by myself for testing translation.)

Therefore, I will upload the fixed translation soon or later, and you may mark this issue with "User's fault" anyway.

3TUSK commented 8 years ago

@GWYOG Alright, here is the final result: Fixed manual files for RotaryCraft currently locate at here; also a copy of updated zh_CN.lang for RotaryCraft locates at here. Would you @ReikaKalseki mind including them in next release?

ReikaKalseki commented 8 years ago

I will do that.

3TUSK commented 8 years ago

Appreciate! Also I apologize for bothering you a lot.