Giter VIP home page Giter VIP logo

Comments (8)

pspupsp avatar pspupsp commented on June 3, 2024

把lang选项改为zh_CN后,输入neverlag出现异常:(,服务端paperclip 1.12.1

neverlag
[17:12:26 WARN]: Unexpected exception while parsing console command "neverlag"
org.bukkit.command.CommandException: Unhandled exception executing command 'neverlag' in plugin NeverLag v2.0-SNAPSHOT
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[patched_1.12.1.jar:git-Paper-1196]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151) ~[patched_1.12.1.jar:git-Paper-1196]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:672) ~[patched_1.12.1.jar:git-Paper-1196]
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchServerCommand(CraftServer.java:635) [patched_1.12.1.jar:git-Paper-1196]
at net.minecraft.server.v1_12_R1.DedicatedServer.aP(DedicatedServer.java:462) [patched_1.12.1.jar:git-Paper-1196]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:425) [patched_1.12.1.jar:git-Paper-1196]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:767) [patched_1.12.1.jar:git-Paper-1196]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:665) [patched_1.12.1.jar:git-Paper-1196]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152-ea]
Caused by: java.lang.UnsupportedOperationException
at cn.jiongjionger.neverlag.command.CommandDispatcher.onCommand(CommandDispatcher.java:29) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[patched_1.12.1.jar:git-Paper-1196]
... 8 more

from neverlag.

andylizi avatar andylizi commented on June 3, 2024

唔语言文件部分是我写的。如果出错默认使用中文那就失去多语言的意义了,不过我会考虑使用其他方法解决这个问题,感谢建议。

由于插件还没开发完成,很多逻辑没有完成的部分都被暂时实现为抛出 UnsupportedOperationException ,也就是 “不支持的操作”。如果你看到错误中包含了这个名称,你可以理解为 “你要执行的功能还没被实现”。

from neverlag.

andylizi avatar andylizi commented on June 3, 2024

具体到“输入 neverlag 指令出现异常”这个情况,这里是因为当用户不带任何参数执行主命令时,插件应该显示帮助信息,而我还没完成帮助信息。

其实目前大部分的指令的 “正常情况下的逻辑” 都已经完成了,只不过缺少 “出错情况下的逻辑” 而已(也就是“错误提示信息”)。因此如果你执行的指令没有任何错误,于是就不需要执行 “出错情况下的逻辑”,于是大部分指令还是能成功执行的。例如 /neverlag clear dropitem 这样的没有任何错误的命令。
(希望我解释明白了 ;)

from neverlag.

pspupsp avatar pspupsp commented on June 3, 2024

嗯,你可以补上缺少的语言文本,但是如果出错了之后你不使用原可用的语言文本代替不可用的,那么插件无法运行,着就成为一个漏洞,这只是个建议,谢谢!

from neverlag.

andylizi avatar andylizi commented on June 3, 2024

并不是只要出错就是漏洞的…漏洞指的是开发者未预期的行为,而 “找不到语言文件插件就不能运行“ 这个行为没问题啊,如果没语言文件还怎么运行。只不过这个直接抛错的行为对用户的确不太友好,我要着手改进的是这个 ”不太友好“ 的部分。

from neverlag.

arnesacnussem avatar arnesacnussem commented on June 3, 2024

加个如果不能载入语言文件则默认使用英文就好了,另外,/neverlag这个指令是真的没有反馈还是我的配置有误看不到反馈..?

from neverlag.

andylizi avatar andylizi commented on June 3, 2024

都不是。是这个插件还没完成,所以你指的”反馈“部分还没完成。

from neverlag.

andylizi avatar andylizi commented on June 3, 2024

最后,找不到语言文件时的报错信息看起来像是这样的:

[23:05:13 INFO]: [NeverLag] Enabling NeverLag v2.0-SNAPSHOT
[23:05:13 INFO]: [NeverLag] Language file en_GB.yml not found, trying en.yml ...
[23:05:13 INFO]: [NeverLag] 找不到指定的语言文件 en_GB, 插件无法正常加载! 请在配置文件中更改 lang 选项
[23:05:13 ERROR]: Error occurred while enabling NeverLag v2.0-SNAPSHOT (Is it up to date?)
java.lang.RuntimeException: Language file en.yml not found!
        at cn.jiongjionger.neverlag.NeverLag.onEnable(NeverLag.java:77)

中英双语提示应该能覆盖到有可能使用到这个插件的绝大多数人群。

from neverlag.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.