Conversation
intercept ArgumentTypeRegistry.registerArgumentType()
|
It ought to be known that non-ASCII character is not allowed to appear in command line unless it is content of a string. An anti-pattern modification will not be merged in master branch because it conflicts with the coding standards. If quotes are not enforced, when players input some invisible characters or special Unicode space characters (e.g. Ideographic Space, It seems to say that why I have to type I understand that non-native English speakers might be more inclined to use their native language rather than English when naming a waypoint, but this non-ASCII name has to be an explicit string enclosed in quotes. The only time it is fixed is when Mojang supports multi-language parsing. If I consider adding a multi-language version, I will reconsider your pr, but it will never be merged in master branch. Thanks for your contribution. |
|
I should inform you that I fully support the use of UTF-8/UTF-32 encoding. However, Mojang/Fabric doesn't support then I don't support. This ought to be implemented by Mojang/Fabric official or any other mod rather than me. This is a technology boundary that we have to adhere to. In the total design of this mod, I did not enforce the use of ASCII. Instead, as you can see, I prefer UTF-8 to deal with my waypoint name's storage and make an effort to do some i18n. I wish the Unicode support can be implemented asap so all mods can deal with non-ASCII characters easily. About the "anti-pattern": This does not mean a pattern that goes against modern CLI design. It just goes against Mojang/Fabric's design. I ‘m in favor of phasing out this outdated pattern but this is not something that this mod should do. BTW, why don't you design a mod that mix in this brigadier? It must be popular among non-English speaking players especially Chinese players. You can refer Unicode-Arguments to check out. |
|
Mojang or Microsoft just don't give a care about community Mojang/brigadier#145 . |
Brigadier 的
StringArgumentType.string()在解析非引号字符串时只允许[0-9A-Za-z_\-.+],无引号的中文字符不在允许范围内。因此在本pr之前
/setwarp 你好会导致错误。我创建了一个工具类更换了参数解析器,让此语法合法