joshiejack / Harvest-Festival

65 stars 35 forks source link

Chinese formatting crash on dedicated servers #200

Open LuZWCHA opened 6 years ago

LuZWCHA commented 6 years ago

when talking to blacksmith game crashed,version:Harvest-Festival-1.10.2-0.6.0-219,follow the log: TranslatableComponent{key='disconnect.genericReason', args=[Internal Exception: java.io.IOException: Error while read(...): Connection reset by peer], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}(at a dedicated server); and the log: at java.util.Formatter.checkText(Unknown Source) at java.util.Formatter.parse(Unknown Source) at java.util.Formatter.format(Unknown Source) at java.util.Formatter.format(Unknown Source) at java.lang.String.format(Unknown Source) at joshie.harvest.npcs.gui.GuiNPCChat.format(GuiNPCChat.java:37) at joshie.harvest.npcs.gui.GuiNPCChat.buildScript(GuiNPCChat.java:53) at joshie.harvest.npcs.gui.GuiNPCChat.drawOverlay(GuiNPCChat.java:76) at joshie.harvest.npcs.gui.GuiNPCBase.drawForeground(GuiNPCBase.java:139) at joshie.harvest.core.base.gui.GuiBase.func_73863_a(GuiBase.java:85) at joshie.harvest.npcs.gui.GuiNPCBase.func_73863_a(GuiNPCBase.java:145) at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:382) at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at Reflector.callVoid(Reflector.java:512) at net.minecraft.client.renderer.EntityRenderer.func_181560_a(EntityRenderer.java:1398) at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1076) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:371) at net.minecraft.client.main.Main.main(SourceFile:124) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)(at client),using chinese translate version. sorry,this is the whole crash report,I can't update the primary one.

LuZWCHA commented 6 years ago

it is the (Chinese)translation-bug,I'm sure .wish to fix it soon.

GirafiStudios commented 6 years ago

@LuZWCHA do you use Chinese Traditional or Chinese Simplified?

FallDark commented 6 years ago

i play with my friends and we have the same problem we are using Simplified Chinese here is my client crash report https://pastebin.com/fCvMjb73

GirafiStudios commented 6 years ago

Thanks for the information @FallDark! I have tried to reproduce this myself on a dedicated server, with the client being on both Simplified Chinese and Traditional Chinese. Is your Windows in Simplified Chinese too?

FallDark commented 6 years ago

yes my Windows is Simplified Chinese too

GirafiStudios commented 6 years ago

Any chance I could get you to join the Harvest Festival Discord? I have no way of testing this, without somehow getting a Chinese version of Windows.

FallDark commented 6 years ago

the crash is randomly i try to talking with NPC a lot of time and sometimes it will crash the game https://pastebin.com/u8jKi6Gz

GirafiStudios commented 6 years ago

As I said, there is not much I can do, without anybody being willingly to test for me.

3TUSK commented 6 years ago

https://github.com/PenguinSquad/Harvest-Festival/blob/ec02a24612cbb82ab619cdde2ca1be46e69b9c39/src/main/resources/assets/harvestfestival/lang/zh_CN.lang#L1927

...当百分比条达到100%就可以把工具带给我。...

That % should have been %% to make sure Java doesn't treat %就 as a format mark (like %d, %s, %t)

Further reading: https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html#format-java.lang.String-java.lang.Object...- https://docs.oracle.com/javase/8/docs/api/java/util/UnknownFormatFlagsException.html