Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 00:00:28 +01:00
Ursprung
ec2397472d
Commit
1656ad45a0
@ -408,7 +408,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
|
||||
addComponentType(jsonObject, tag);
|
||||
return tag;
|
||||
} else if (element.isJsonArray()) {
|
||||
return convertJsonArray(element);
|
||||
return convertJsonArray(element.getAsJsonArray());
|
||||
} else if (element.isJsonPrimitive()) {
|
||||
final JsonPrimitive primitive = element.getAsJsonPrimitive();
|
||||
if (primitive.isString()) {
|
||||
@ -461,11 +461,11 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
|
||||
}
|
||||
}
|
||||
|
||||
private static ListTag convertJsonArray(final JsonElement element) {
|
||||
private static ListTag convertJsonArray(final JsonArray array) {
|
||||
// TODO Number arrays?
|
||||
final ListTag listTag = new ListTag();
|
||||
boolean singleType = true;
|
||||
for (final JsonElement entry : element.getAsJsonArray()) {
|
||||
for (final JsonElement entry : array) {
|
||||
final Tag convertedEntryTag = convertToTag(entry);
|
||||
if (listTag.getElementType() != null && listTag.getElementType() != convertedEntryTag.getClass()) {
|
||||
singleType = false;
|
||||
@ -482,7 +482,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
|
||||
// Generally, vanilla-esque serializers should not produce this format, so it should be rare
|
||||
// Lists are only used for lists of components ("extra" and "with")
|
||||
final ListTag processedListTag = new ListTag();
|
||||
for (final JsonElement entry : element.getAsJsonArray()) {
|
||||
for (final JsonElement entry : array) {
|
||||
final Tag convertedTag = convertToTag(entry);
|
||||
if (convertedTag instanceof CompoundTag) {
|
||||
processedListTag.add(convertedTag);
|
||||
@ -496,7 +496,7 @@ public final class Protocol1_20_3To1_20_2 extends AbstractProtocol<ClientboundPa
|
||||
compoundTag.put("text", new StringTag());
|
||||
compoundTag.put("extra", convertedTag);
|
||||
} else {
|
||||
compoundTag.put("text", new StringTag(convertedTag.toString()));
|
||||
compoundTag.put("text", new StringTag(convertedTag.asRawString()));
|
||||
}
|
||||
processedListTag.add(compoundTag);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ adventure = "4.14.0"
|
||||
gson = "2.10.1"
|
||||
fastutil = "8.5.12"
|
||||
flare = "2.0.1"
|
||||
vianbt = "3.2.1"
|
||||
vianbt = "3.3.0"
|
||||
|
||||
# Common provided
|
||||
netty = "4.0.20.Final"
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren