Skip to content

Commit

Permalink
Allow empty arrays in certain codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
apple502j committed Apr 9, 2024
1 parent a431beb commit 733e03a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public record AllModsLoadedResourceCondition(List<String> modIds) implements ResourceCondition {
public static final MapCodec<AllModsLoadedResourceCondition> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codecs.nonEmptyList(Codec.STRING.listOf()).fieldOf("values").forGetter(AllModsLoadedResourceCondition::modIds)
Codec.STRING.listOf().fieldOf("values").forGetter(AllModsLoadedResourceCondition::modIds)
).apply(instance, AllModsLoadedResourceCondition::new));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public record AnyModsLoadedResourceCondition(List<String> modIds) implements ResourceCondition {
public static final MapCodec<AnyModsLoadedResourceCondition> CODEC = RecordCodecBuilder.mapCodec(instance -> instance.group(
Codecs.nonEmptyList(Codec.STRING.listOf()).fieldOf("values").forGetter(AnyModsLoadedResourceCondition::modIds)
Codec.STRING.listOf().fieldOf("values").forGetter(AnyModsLoadedResourceCondition::modIds)
).apply(instance, AnyModsLoadedResourceCondition::new));

@Override
Expand Down

0 comments on commit 733e03a

Please sign in to comment.