mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-06-24 13:44:42 +02:00
Fix unquoted string being parsed as double
This commit is contained in:
parent
8104b96b8c
commit
52457ea749
|
@ -47,7 +47,6 @@ import java.util.stream.LongStream;
|
|||
// - Use OpenNBT tags
|
||||
// - Small byteArray() optimization
|
||||
// - acceptLegacy = true by default
|
||||
// - Don't parse value as DoubleTag when possiblyNumeric
|
||||
final class TagStringReader {
|
||||
private static final int MAX_DEPTH = 512;
|
||||
private static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
|
||||
|
@ -306,7 +305,13 @@ final class TagStringReader {
|
|||
try {
|
||||
return new IntTag(Integer.parseInt(built));
|
||||
} 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user