Skip to content

Commit

Permalink
Merge branch '1.19.3' into 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Treetrain1 committed Jul 15, 2023
2 parents 4cabab1 + c0dcf73 commit f4b6943
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

package net.frozenblock.lib.worldgen.surface.api;

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.levelgen.SurfaceRules;

Expand All @@ -26,4 +28,11 @@
* The ResourceLocation denotes the dimension to be modified, and the RuleSource are the rules to be applied to it.
*/
public record FrozenDimensionBoundRuleSource(ResourceLocation dimension, SurfaceRules.RuleSource ruleSource) {

public static final Codec<FrozenDimensionBoundRuleSource> CODEC = RecordCodecBuilder.create(instance ->
instance.group(
ResourceLocation.CODEC.fieldOf("dimension").forGetter(FrozenDimensionBoundRuleSource::dimension),
SurfaceRules.RuleSource.CODEC.fieldOf("rule_source").forGetter(FrozenDimensionBoundRuleSource::ruleSource)
).apply(instance, FrozenDimensionBoundRuleSource::new)
);
}

0 comments on commit f4b6943

Please sign in to comment.