Jump to content

[1.18.1] Biome tree generation crash


Aecht_Rob

Recommended Posts

I am in 1.18.1 and trying to get a tree to generate at worldgen.

I have a functioning ConfiguredFeature tree (saplings work properly) at "ModConfiguredFeatures.LEPIDODENDRON". When I add this to generation, on loading a world, the world crashes (the error is incorrect - the loot tables work perfectly without adding trees to worldgen). Is there a resource-loading issue here, with the tree placer trying to register something that does not exist to register yet?

My placer definition in "ModPlacements":
public static final PlacedFeature LEPIDODENDRON_TREE = PlacementUtils.register("lepidodendron_tree_placement", ModConfiguredFeatures.LEPIDODENDRON.placed(RarityFilter.onAverageOnceEvery(12), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_WORLD_SURFACE, BiomeFilter.biome()));

My worldgen:
@SubscribeEvent public static void biomeLoadingEvent(final BiomeLoadingEvent event) {  event.getGeneration().addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, ModPlacements.LEPIDODENDRON_TREE);

Error:
https://pastebin.com/KUZ5gRYC

Repository:https://github.com/AechtRob/Prehistoric_Nature

Edited by Aecht_Rob
Editing URL for repository
Link to comment
Share on other sites

As I mentioned in the original post there is seems to be no error in the loot table and this seems to be a false diagnostic result. I think this because commenting out the worldgen everything runs perfectly, loot tables load fine and behave properly in-game; uncommenting the worldgen makes it error again with this error. (Also if I remove all loot tables entirely the game still falls over).

(It is as if providing the reference to the tree in the worldgen forces it to go looking for things which are not yet registered at that moment in time?)

I have re-synched the repository, to include all assets now (sorry).

Edited by Aecht_Rob
Link to comment
Share on other sites

Here you go. These are from the IntelliJ dev launcher environment:

(1) This is a log from starting a new world: https://pastebin.com/8j23PUEW

(2) This is from entering a world which was created previously without the mod: https://pastebin.com/31G1ma49

(3) And this is from entering the same world as (2) but with the single line of code in ModWorldEvents:biomeLoadingEvent commented out: https://pastebin.com/qnCLqM5T

It feels like something is not registered properly somehow?

Link to comment
Share on other sites

After two days of almost literally random trial-and-error I think I have it working. The bug was something to do with passing a ConfiguredFeature where a PlacedfFeature was wanted. I don't fully understand why what I have done works, but it works and that is good for me. My repository is linked above in case there is stuff in there to help anyone else.

Link to comment
Share on other sites

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



×
×
  • Create New...

Important Information

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