9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

改进SNBTReader, 数字类型后缀b,s,l,f,d忽略大小写.

This commit is contained in:
Catnies
2025-06-26 07:01:50 +08:00
parent 0cb3b0e489
commit adf83a67a6

View File

@@ -161,6 +161,7 @@ public final class SNBTReader extends DefaultStringReader {
if (tokenLength > 1) { if (tokenLength > 1) {
// 至少有1个字符给了后缀的可能性 // 至少有1个字符给了后缀的可能性
char lastChar = charAt(tokenStart + tokenLength - 1); char lastChar = charAt(tokenStart + tokenLength - 1);
if (lastChar < 'a') lastChar = (char) (lastChar + 32); // 强制转小写进行匹配.
try { try {
switch (lastChar) { switch (lastChar) {
case BYTE_SUFFIX -> { case BYTE_SUFFIX -> {