Skip to content

Commit

Permalink
Fixed holder set codecs
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Jul 6, 2024
1 parent c77bccc commit d613cc5
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 @@ -22,7 +22,7 @@
public class NamespaceHolderSet<T> extends HolderSet.ListBacked<T> implements ICustomHolderSet<T> {
public static <T> MapCodec<NamespaceHolderSet<T>> codec(ResourceKey<? extends Registry<T>> registryKey, Codec<Holder<T>> holderCodec, boolean forceList) {
return RecordCodecBuilder.mapCodec(instance -> instance.group(
RegistryOps.retrieveRegistryLookup(registryKey).fieldOf("registry").forGetter(s -> s.registryLookup),
RegistryOps.retrieveRegistryLookup(registryKey).forGetter(s -> s.registryLookup),
Codec.STRING.fieldOf("namespace").forGetter(s -> s.namespace)
).apply(instance, NamespaceHolderSet::new));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class RegExHolderSet<T> extends HolderSet.ListBacked<T> implements ICustomHolderSet<T> {
public static <T> MapCodec<RegExHolderSet<T>> codec(ResourceKey<? extends Registry<T>> registryKey, Codec<Holder<T>> holderCodec, boolean forceList) {
return RecordCodecBuilder.mapCodec(instance -> instance.group(
RegistryOps.retrieveRegistryLookup(registryKey).fieldOf("registry").forGetter(s -> s.registryLookup),
RegistryOps.retrieveRegistryLookup(registryKey).forGetter(s -> s.registryLookup),
RegExpKJS.CODEC.fieldOf("pattern").forGetter(s -> s.pattern)
).apply(instance, RegExHolderSet::new));
}
Expand Down

0 comments on commit d613cc5

Please sign in to comment.