Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-30 18:10:12 +01:00
Fix unquoted string being parsed as double
Dieser Commit ist enthalten in:
Ursprung
8104b96b8c
Commit
52457ea749
@ -47,7 +47,6 @@ import java.util.stream.LongStream;
|
|||||||
// - Use OpenNBT tags
|
// - Use OpenNBT tags
|
||||||
// - Small byteArray() optimization
|
// - Small byteArray() optimization
|
||||||
// - acceptLegacy = true by default
|
// - acceptLegacy = true by default
|
||||||
// - Don't parse value as DoubleTag when possiblyNumeric
|
|
||||||
final class TagStringReader {
|
final class TagStringReader {
|
||||||
private static final int MAX_DEPTH = 512;
|
private static final int MAX_DEPTH = 512;
|
||||||
private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
|
private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
|
||||||
@ -306,7 +305,13 @@ final class TagStringReader {
|
|||||||
try {
|
try {
|
||||||
return new IntTag(Integer.parseInt(built));
|
return new IntTag(Integer.parseInt(built));
|
||||||
} catch (final NumberFormatException ex) {
|
} catch (final NumberFormatException ex) {
|
||||||
// Via - don't try to parse as DoubleTag her
|
if (built.indexOf('.') != -1) {
|
||||||
|
try {
|
||||||
|
return new DoubleTag(Double.parseDouble(built));
|
||||||
|
} catch (final NumberFormatException ex2) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren