mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-29 13:36:16 +01:00
Fix reading of explicit int array entries
See https://github.com/KyoriPowered/adventure/pull/460
This commit is contained in:
parent
0bcaf3e422
commit
68c63d20ed
@ -265,13 +265,15 @@ final class TagStringReader {
|
||||
Tag result = null;
|
||||
try {
|
||||
switch (Character.toLowerCase(current)) { // try to read and return as a number
|
||||
// case Tokens.TYPE_INTEGER: // handled below, ints are ~special~
|
||||
case Tokens.TYPE_BYTE:
|
||||
result = new ByteTag(Byte.parseByte(builder.toString()));
|
||||
break;
|
||||
case Tokens.TYPE_SHORT:
|
||||
result = new ShortTag(Short.parseShort(builder.toString()));
|
||||
break;
|
||||
case Tokens.TYPE_INT:
|
||||
result = new IntTag(Integer.parseInt(builder.toString()));
|
||||
break;
|
||||
case Tokens.TYPE_LONG:
|
||||
result = new LongTag(Long.parseLong(builder.toString()));
|
||||
break;
|
||||
|
@ -35,6 +35,7 @@ public class NBTTagTest {
|
||||
readString("{id:[I;1,2, 3, 4,5]}"); // >=1.11
|
||||
readString("{id:1b,b:true}");
|
||||
readString("{id:[L;1l,2L,3L]}"); // >=1.11
|
||||
readString("{id:[I;1i,2I,3I]}");
|
||||
readString("{id:'minecraft:stone'}"); // >=1.13
|
||||
readString("{id:1,id:2}");
|
||||
readString("{id:-20b,test:3.19f}");
|
||||
@ -47,7 +48,6 @@ public class NBTTagTest {
|
||||
|
||||
//TODO fix legacy < 1.12
|
||||
// readString("{id:minecraft:stone}");
|
||||
// readString("{id:[I;1i,2I,3I]}");
|
||||
// readString("{id:[1,2, 3, 4,5]}");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user