Skip to content

Commit

Permalink
Correctly serialize CopyComponents
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenStack committed Aug 29, 2024
1 parent 919b7ff commit c9fb10c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/net/goldenstack/loot/LootFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -611,16 +611,16 @@ record CopyComponents(@NotNull List<LootPredicate> predicates, @NotNull Relevant
public static final @NotNull BinaryTagSerializer<CopyComponents> SERIALIZER = Template.template(
"conditions", Serial.lazy(() -> LootPredicate.SERIALIZER).list().optional(List.of()), CopyComponents::predicates,
"source", RelevantTarget.SERIALIZER, CopyComponents::source,
"include", Template.<DataComponent<?>>todo("data components").list().optional(), CopyComponents::include,
"exclude", Template.<DataComponent<?>>todo("data components").list().optional(), CopyComponents::exclude,
"include", Serial.KEY.<DataComponent<?>>map(ItemComponent::fromNamespaceId, DataComponent::namespace).list().optional(), CopyComponents::include,
"exclude", Serial.KEY.<DataComponent<?>>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<DataComponentMap> for blocks.");
}
}

Expand Down

0 comments on commit c9fb10c

Please sign in to comment.