Jump to content

[1.14.4] Retrogen, how to make ores spawn in already generated chunks.


Recommended Posts

Posted

Hey guys, beginner programmer here who's made an ores mod.

 

When people download the mod, the ores don't spawn in already generated chunks, they only spawn as the world expands and generates fresh chunks from player movement.

 

I would like for my mod to spawn in already generated chunks so the player doesn't have to travel arbitrarily far to find the ores. I looked into it, and apparently there are some mods from 1.12 that have retrogen capabilities; however, I found no open-source mods for 1.14.4. I have no idea where to start.  Any suggestions?

Posted

There might be some built-in capability for this, in which case you can ignore me, but this wouldn't be difficult to do "from scratch," so to speak.

You could fairly simply store a boolean for each chunk, whether or not it's been affected by your ore generation, and do some block replacement logic on the chunk if not (then toggle the boolean, naturally).

You would only need to run this check when a chunk was loaded, so you could use the event that fires when a chunk is loaded (I'm not sure what it's called in 1.14. From a brief search, it seems to be ChunkEvent.Load, but don't quote me on that).

I haven't done world generation yet, so I can't advise you on keeping runaway chunk generation from happening, but you should look into that if you haven't already.

  • Thanks 1

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

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.