From c9fb10c22773c61d96908edd9f8b315077b733a1 Mon Sep 17 00:00:00 2001 From: GoldenStack Date: Thu, 29 Aug 2024 13:50:16 -0500 Subject: [PATCH] Correctly serialize CopyComponents --- src/main/java/net/goldenstack/loot/LootFunction.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/goldenstack/loot/LootFunction.java b/src/main/java/net/goldenstack/loot/LootFunction.java index 210688f..98bbe38 100644 --- a/src/main/java/net/goldenstack/loot/LootFunction.java +++ b/src/main/java/net/goldenstack/loot/LootFunction.java @@ -611,16 +611,16 @@ record CopyComponents(@NotNull List predicates, @NotNull Relevant public static final @NotNull BinaryTagSerializer SERIALIZER = Template.template( "conditions", Serial.lazy(() -> LootPredicate.SERIALIZER).list().optional(List.of()), CopyComponents::predicates, "source", RelevantTarget.SERIALIZER, CopyComponents::source, - "include", Template.>todo("data components").list().optional(), CopyComponents::include, - "exclude", Template.>todo("data components").list().optional(), CopyComponents::exclude, + "include", Serial.KEY.>map(ItemComponent::fromNamespaceId, DataComponent::namespace).list().optional(), CopyComponents::include, + "exclude", Serial.KEY.>map(ItemComponent::fromNamespaceId, DataComponent::namespace).list().optional(), CopyComponents::exclude, CopyComponents::new ); @Override public @NotNull ItemStack apply(@NotNull ItemStack input, @NotNull LootContext context) { if (!LootPredicate.all(predicates, context)) return input; - - throw new UnsupportedOperationException("Minestom currently does not support data components on blocks."); + + throw new UnsupportedOperationException("TODO: Implement Tag for blocks."); } }