Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello everyone,

I currently have a class to create a BiomeSource to test my dimension. I want to use vanilla biomes in this dimension. The problem is that everytime I try to get a Biome and execute runData I get the following error :
 

[minecraft/RegistriesDatapackGenerator]: Couldn't serialize element /home/maxime/Programming/Java/Deepworld/src/generated/resources/data/deepworld/dimension/deepworld_dimension.json: Unknown registry element in ResourceKey[minecraft:root / minecraft:worldgen/biome_source]:RecordCodec[UnitDecoder[fr.dwightstudio.deepworld.common.dimension.DeepworldBiomeSource$$Lambda$4739/0x00000008016f8b18@68009f48] * Field[lush_caves: RegistryFileCodec[ResourceKey[minecraft:root / minecraft:worldgen/biome] net.minecraftforge.registries.ForgeRegistry$RegistryCodec@ac570e0]]]

So I tried several things and all of them gets into this error when trying to generate data with datagens.

If you want to take a look at my BiomeSource class here it is ( I have removed the imports ):

public class DeepworldBiomeSource extends BiomeSource {

    public static final Codec<DeepworldBiomeSource> CODEC = RecordCodecBuilder.create((instance) -> instance.group(
            Biome.CODEC.fieldOf("lush_caves").forGetter(o -> o.biome1)
    ).apply(instance, instance.stable(DeepworldBiomeSource::new)));

    private final Holder<Biome> biome1;

    public DeepworldBiomeSource(Holder<Biome> biome1) {
        System.out.printf(biome1.toString());
        this.biome1 = biome1;
    }

    public static BiomeSource create(HolderGetter<Biome> biomes) {
        return new DeepworldBiomeSource(biomes.getOrThrow(Biomes.LUSH_CAVES));
    }

    @Override
    protected @NotNull Codec<? extends BiomeSource> codec() {
        return CODEC;
    }

    @Override
    protected @NotNull Stream<Holder<Biome>> collectPossibleBiomes() {
        return Stream.of(this.biome1);
    }

    @Override
    public @NotNull Set<Holder<Biome>> possibleBiomes() {
        return Set.of(this.biome1);
    }

    @Override
    public @NotNull Holder<Biome> getNoiseBiome(int x, int y, int z, Climate.@NotNull Sampler sampler) {
        return this.biome1;
    }
}

If you need any additional informations, ask me.

 

Thank you very much,
Maxime

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.