Jump to content

Managing ore generation


Recommended Posts



I am trying to prevent ore generation on a per block basis. I looked into OreGenEvent, but there does not seem to be a way to find out what is being generated from the WorldGenerator instance, other than guessing from the class name.


My thought would be to "intercept" or look for calls to World#setBlockState that happen in WorldGenerator#generate, check the BlockState being set and use that to cancel the ore generation.

Of course, that looks like massive hackery from the deepest pits of coremodding, and I have no clue where to start about that.


Any thoughts?

Link to comment
Share on other sites

That's an option, although it reduces even more the number of mods that I will be able to handle, since they have to both fire the event and extend WorldGenMinable (even vanilla's BiomeHills$EmeraldGenerator is just a WorldGenerator)

Link to comment
Share on other sites

And I suppose an improper way to do this would include hacking into world#setBlockState and checking if the call stack contains WorldGenerator#generate, which I presume would make a lot of things laggy AF and crash the others  :-\

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.

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.


  • Create New...

Important Information

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