Jump to content

[1.17.1] Error when creating custom biome


Goosey

Recommended Posts

I've been trying to implement a custom biome and I've run across an error that crashes my game when trying to create a new world and disallows me to enter any existing worlds.

I followed this tutorial for making biomes (with one or two changes to class names and method names).

My code looks like this

Spoiler

 

public static final ResourceKey<Biome> MAPLE_BIOME = ResourceKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(GooseMod.MODID, "maple_forest"));

private void setup(final FMLCommonSetupEvent event) {
   	event.enqueueWork(() -> {
        ModWorldGeneration.registerConfiguredFeatures();
        BiomeManager.addAdditionalOverworldBiomes(MAPLE_BIOME);
    });
}

@SubscribeEvent(priority = EventPriority.HIGH)
  public static void onBiomeLoad(BiomeLoadingEvent event) {
  ResourceKey<Biome> eventBiomeKey = ResourceKey.create(Registry.BIOME_REGISTRY, event.getName());
  if (eventBiomeKey == MAPLE_BIOME)
  {
    event.getGeneration().getFeatures(GenerationStep.Decoration.VEGETAL_DECORATION).add(() -> ORANGE_MAPLE);
    event.getGeneration().getFeatures(GenerationStep.Decoration.VEGETAL_DECORATION).add(() -> RED_MAPLE);
    event.getGeneration().getFeatures(GenerationStep.Decoration.VEGETAL_DECORATION).add(() -> YELLOW_MAPLE);
  }
}
}

 

and the exception is this

Spoiler

java.lang.IllegalStateException: Missing: ResourceKey[minecraft:worldgen/biome / goosemod:maple_forest]
    at net.minecraft.core.Registry.getOrThrow(Registry.java:476) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading}
    at net.minecraft.world.level.biome.OverworldBiomeSource.lambda$new$5(OverworldBiomeSource.java:36) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading}
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?] {}
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?] {}
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[?:?] {}
    at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) ~[?:?] {}
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?] {}
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?] {}
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[?:?] {}
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {}
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[?:?] {}
    at net.minecraft.world.level.biome.BiomeSource.<init>(BiomeSource.java:29) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading}
    at net.minecraft.world.level.biome.OverworldBiomeSource.<init>(OverworldBiomeSource.java:34) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading}
    at net.minecraft.client.gui.screens.worldselection.WorldPreset$1.generator(WorldPreset.java:36) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading}
    at net.minecraft.client.gui.screens.worldselection.WorldPreset.create(WorldPreset.java:166) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.lambda$create$0(CreateWorldScreen.java:120) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at java.util.Optional.map(Optional.java:260) ~[?:?] {}
    at net.minecraft.client.gui.screens.worldselection.CreateWorldScreen.create(CreateWorldScreen.java:120) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.screens.worldselection.SelectWorldScreen.lambda$init$4(SelectWorldScreen.java:58) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.components.Button.onPress(Button.java:29) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.components.AbstractButton.onClick(AbstractButton.java:17) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.components.AbstractWidget.mouseClicked(AbstractWidget.java:111) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.components.events.ContainerEventHandler.mouseClicked(ContainerEventHandler.java:28) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.MouseHandler.lambda$onPress$0(MouseHandler.java:87) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.gui.screens.Screen.wrapScreenError(Screen.java:530) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.MouseHandler.onPress(MouseHandler.java:85) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.client.MouseHandler.lambda$setup$4(MouseHandler.java:181) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at net.minecraft.util.thread.BlockableEventLoop.execute(BlockableEventLoop.java:90) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:accesstransformer:B}
    at net.minecraft.client.MouseHandler.lambda$setup$5(MouseHandler.java:180) ~[forge-1.17.1-37.0.104_mapped_official_1.17.1-recomp.jar%2375!:?] {re:classloading,pl:runtimedistcleaner:A}
    at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar%2354!:build 10] {}

What exactly am I missing? I understand that the tutorial is for 1.16, but I couldn't find anything for 1.17 and so far it hasn't been that difficult to implement it into my project. Did they add a step in 1.17?

Link to comment
Share on other sites

  • 2 weeks later...
On 11/12/2021 at 4:09 PM, Luis_ST said:

sorry my mistake, did not see that the tutorial is for 1.16 and ResourceKey#get in 1.17 has been removed
i would recommend you to use the ResourceLocations instead,
one location you can get from the Event the other from your ResourceKey via ResourceKey#location

I've implemented this, but I am still getting errors when trying to add my custom biome

Link to comment
Share on other sites

21 hours ago, Luis_ST said:

post updated code

Spoiler
public static final ResourceKey<Biome> MAPLE_BIOME = ResourceKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(GooseMod.MODID, "maple_forest"));

private void setup(final FMLCommonSetupEvent event) {
  event.enqueueWork(() -> {
    BiomeManager.addAdditionalOverworldBiomes(MAPLE_BIOME);
  });
}
  
  @SubscribeEvent(priority = EventPriority.HIGH)
  public static void onBiomeLoad(BiomeLoadingEvent event) {
    if (event.getName().equals(MAPLE_BIOME.location())) {
      event.getGeneration().getFeatures(GenerationStep.Decoration.VEGETAL_DECORATION).add(() -> ORANGE_MAPLE);
      event.getGeneration().getFeatures(GenerationStep.Decoration.VEGETAL_DECORATION).add(() -> RED_MAPLE);
      event.getGeneration().getFeatures(GenerationStep.Decoration.VEGETAL_DECORATION).add(() -> YELLOW_MAPLE);
    }
  }

 

 

Link to comment
Share on other sites

  • 2 weeks later...

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • Let me try and help you with love spells, traditional healing, native healing, fortune telling, witchcraft, psychic readings, black magic, voodoo, herbalist healing, or any other service your may desire within the realm of african native healing, the spirits and the ancestors. I am a sangoma and healer. I could help you to connect with the ancestors , interpret dreams, diagnose illness through divination with bones, and help you heal both physical and spiritual illness. We facilitate the deepening of your relationship to the spirit world and the ancestors. Working in partnership with one\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\’s ancestors is a gift representing a close link with the spirit realm as a mediator between the worlds.*   Witchdoctors, or sorcerers, are often purveyors of mutis and charms that cause harm to people. we believe that we are here for only one purpose, to heal through love and compassion.*   African people share a common understanding of the importance of ancestors in daily life. When they have lost touch with their ancestors, illness may result or bad luck. Then a traditional healer, or sangoma, is sought out who may prescribe herbs, changes in lifestyle, a career change, or changes in relationships. The client may also be told to perform a ceremony or purification ritual to appease the ancestors.*   Let us solve your problems using powerful African traditional methods. We believe that our ancestors and spirits give us enlightenment, wisdom, divine guidance, enabling us to overcome obstacles holding your life back. Our knowledge has been passed down through centuries, being refined along the way from generation to generation. We believe in the occult, the paranormal, the spirit world, the mystic world.*   The services here are based on the African Tradition Value system/religion,where we believe the ancestors and spirits play a very important role in society. The ancestors and spirits give guidance and counsel in society. They could enable us to see into the future and give solutions to the problems affecting us. We use rituals, divination, spells, chants and prayers to enable us tackle the task before us.*   I have experience in helping and guiding many people from all over the world. My psychic abilities may help you answer and resolve many unanswered questions
    • I ended up removing both balm-forge and waystones, and it worked! Tysm for your help!
  • Topics

×
×
  • Create New...

Important Information

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