public static final Codec<HeightProvider> CODEC = CONSTANT_OR_DISPATCH_CODEC.xmap(
15
either -> either.map(ConstantHeight::of, f -> (HeightProvider)f),
16
f -> f.getType() == HeightProviderType.CONSTANT ? Either.left(((ConstantHeight)f).getValue()) : Either.right(f)
17
);
18
19
public abstract int sample(final RandomSource random, final WorldGenerationContext heightAccessor);
20
21
public abstract HeightProviderType<?> getType();
22
}
23
Decompiled Minecraft 26.3 source of HeightProvider (net/minecraft/world/level/levelgen/heightproviders/HeightProvider.java) with Mojang official mappings, stored verbatim on the site.