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

忽略大小写匹配

This commit is contained in:
Catnies
2025-06-27 03:16:17 +08:00
parent 2b4ed81b72
commit d09a632804

View File

@@ -93,8 +93,7 @@ public final class SNBTReader extends DefaultStringReader {
// 检查接下来的2个非空格字符, 确认是否要走数组解析.
if (canRead()) {
setMarker(cursor); // 记录指针, 尝试解析数组.
char typeChar = peek();
if (typeChar < 'a') typeChar = (char) (typeChar + 32); // 强制转小写进行匹配.
char typeChar = Character.toLowerCase(peek());
if (typeChar == BYTE_ARRAY || typeChar == INT_ARRAY || typeChar == LONG_ARRAY) {
skip();
skipWhitespace();
@@ -253,7 +252,7 @@ public final class SNBTReader extends DefaultStringReader {
if (tokenLength > 1) {
// 至少有1个字符给了后缀的可能性
char lastChar = charAt(tokenStart + tokenLength - 1);
if (lastChar < 'a') lastChar = (char) (lastChar + 32); // 强制转小写进行匹配.
lastChar = Character.toLowerCase(lastChar); // 强制转小写进行匹配.
try {
switch (lastChar) {
case BYTE_SUFFIX -> {