Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-27 08:30:10 +01:00
Properly write properties
Dieser Commit ist enthalten in:
Ursprung
91193cf602
Commit
fd43ca56d7
@ -210,28 +210,25 @@ public final class BlockItemPacketRewriter1_20_5 extends BackwardsStructuredItem
|
|||||||
skullOwnerTag.put("Id", idTag);
|
skullOwnerTag.put("Id", idTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Tag propertiesListTag = profileTag.remove("properties");
|
final ListTag<CompoundTag> propertiesListTag = profileTag.getListTag("properties", CompoundTag.class);
|
||||||
if (!(propertiesListTag instanceof ListTag<?>)) {
|
if (propertiesListTag == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final CompoundTag propertiesTag = new CompoundTag();
|
final CompoundTag propertiesTag = new CompoundTag();
|
||||||
for (final Tag propertyTag : ((ListTag<?>) propertiesListTag)) {
|
for (final CompoundTag propertyTag : propertiesListTag) {
|
||||||
if (!(propertyTag instanceof CompoundTag)) {
|
final String property = propertyTag.getString("name", "");
|
||||||
continue;
|
final String value = propertyTag.getString("value", "");
|
||||||
}
|
final String signature = propertyTag.getString("signature");
|
||||||
|
|
||||||
final CompoundTag propertyCompoundTag = (CompoundTag) propertyTag;
|
|
||||||
final String property = propertyCompoundTag.getString("name", "");
|
|
||||||
final String value = propertyCompoundTag.getString("value", "");
|
|
||||||
final String signature = propertyCompoundTag.getString("signature");
|
|
||||||
|
|
||||||
|
final ListTag<CompoundTag> list = new ListTag<>(CompoundTag.class);
|
||||||
final CompoundTag updatedPropertyTag = new CompoundTag();
|
final CompoundTag updatedPropertyTag = new CompoundTag();
|
||||||
updatedPropertyTag.putString("Value", value);
|
updatedPropertyTag.putString("Value", value);
|
||||||
if (signature != null) {
|
if (signature != null) {
|
||||||
updatedPropertyTag.putString("Signature", signature);
|
updatedPropertyTag.putString("Signature", signature);
|
||||||
}
|
}
|
||||||
propertiesTag.put(property, updatedPropertyTag);
|
list.add(updatedPropertyTag);
|
||||||
|
propertiesTag.put(property, list);
|
||||||
}
|
}
|
||||||
skullOwnerTag.put("Properties", propertiesTag);
|
skullOwnerTag.put("Properties", propertiesTag);
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren