Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Fix reading of explicit int array entries
See https://github.com/KyoriPowered/adventure/pull/460
Dieser Commit ist enthalten in:
Ursprung
0bcaf3e422
Commit
68c63d20ed
@ -265,13 +265,15 @@ final class TagStringReader {
|
|||||||
Tag result = null;
|
Tag result = null;
|
||||||
try {
|
try {
|
||||||
switch (Character.toLowerCase(current)) { // try to read and return as a number
|
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:
|
case Tokens.TYPE_BYTE:
|
||||||
result = new ByteTag(Byte.parseByte(builder.toString()));
|
result = new ByteTag(Byte.parseByte(builder.toString()));
|
||||||
break;
|
break;
|
||||||
case Tokens.TYPE_SHORT:
|
case Tokens.TYPE_SHORT:
|
||||||
result = new ShortTag(Short.parseShort(builder.toString()));
|
result = new ShortTag(Short.parseShort(builder.toString()));
|
||||||
break;
|
break;
|
||||||
|
case Tokens.TYPE_INT:
|
||||||
|
result = new IntTag(Integer.parseInt(builder.toString()));
|
||||||
|
break;
|
||||||
case Tokens.TYPE_LONG:
|
case Tokens.TYPE_LONG:
|
||||||
result = new LongTag(Long.parseLong(builder.toString()));
|
result = new LongTag(Long.parseLong(builder.toString()));
|
||||||
break;
|
break;
|
||||||
|
@ -35,6 +35,7 @@ public class NBTTagTest {
|
|||||||
readString("{id:[I;1,2, 3, 4,5]}"); // >=1.11
|
readString("{id:[I;1,2, 3, 4,5]}"); // >=1.11
|
||||||
readString("{id:1b,b:true}");
|
readString("{id:1b,b:true}");
|
||||||
readString("{id:[L;1l,2L,3L]}"); // >=1.11
|
readString("{id:[L;1l,2L,3L]}"); // >=1.11
|
||||||
|
readString("{id:[I;1i,2I,3I]}");
|
||||||
readString("{id:'minecraft:stone'}"); // >=1.13
|
readString("{id:'minecraft:stone'}"); // >=1.13
|
||||||
readString("{id:1,id:2}");
|
readString("{id:1,id:2}");
|
||||||
readString("{id:-20b,test:3.19f}");
|
readString("{id:-20b,test:3.19f}");
|
||||||
@ -47,7 +48,6 @@ public class NBTTagTest {
|
|||||||
|
|
||||||
//TODO fix legacy < 1.12
|
//TODO fix legacy < 1.12
|
||||||
// readString("{id:minecraft:stone}");
|
// readString("{id:minecraft:stone}");
|
||||||
// readString("{id:[I;1i,2I,3I]}");
|
|
||||||
// readString("{id:[1,2, 3, 4,5]}");
|
// readString("{id:[1,2, 3, 4,5]}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren