Add Charged item tag if there's charged projectiles

Closes ViaVersion/ViaBackwards#787
This commit is contained in:
Nassim Jahnke 2024-06-16 21:58:07 +02:00
parent 1c281abf65
commit b367caa4b2
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -218,7 +218,12 @@ public final class StructuredDataConverter {
}
});
register(StructuredDataKey.BASE_COLOR, (data, tag) -> getBlockEntityTag(tag).putInt("Base", data));
register(StructuredDataKey.CHARGED_PROJECTILES1_20_5, (connection, data, tag) -> convertItemList(connection, data, tag, "ChargedProjectiles"));
register(StructuredDataKey.CHARGED_PROJECTILES1_20_5, (connection, data, tag) -> {
convertItemList(connection, data, tag, "ChargedProjectiles");
if (data.length != 0) {
tag.putBoolean("Charged", true);
}
});
register(StructuredDataKey.BUNDLE_CONTENTS1_20_5, (connection, data, tag) -> convertItemList(connection, data, tag, "Items"));
register(StructuredDataKey.LODESTONE_TRACKER, (data, tag) -> {
tag.putBoolean("LodestoneTracked", data.tracked());