mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-04 15:41:38 +00:00
修复三元导致的类型强转问题.
This commit is contained in:
@@ -238,7 +238,9 @@ public final class SNBTReader extends DefaultStringReader {
|
|||||||
if (hexDigits.isEmpty()) return fullString; // 没值了代表这是个字符串.
|
if (hexDigits.isEmpty()) return fullString; // 没值了代表这是个字符串.
|
||||||
long value = Long.parseLong(hexDigits, 16);
|
long value = Long.parseLong(hexDigits, 16);
|
||||||
if (negativeHex) value = -value;
|
if (negativeHex) value = -value;
|
||||||
return (value >= Integer.MIN_VALUE && value <= Integer.MAX_VALUE) ? (int) value : value; // 默认返回的还是Int类型的喵.
|
// 默认返回的还是Int类型的, 三元坑我喵.
|
||||||
|
if (value >= Integer.MIN_VALUE && value <= Integer.MAX_VALUE) return (int) value;
|
||||||
|
else return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 布尔值检查
|
// 布尔值检查
|
||||||
|
|||||||
Reference in New Issue
Block a user