Better structure generation for Nether type dimensions

Status
Fixed
Issue description

The possibility of adding structures to a mod by using a vanilla structure block is awesome. You can  control many options in the element editor, like the frequency, the biomes it spawns on and more.

But I think there still is a limit.

I think there should be an option like "check if there is enough space (air) for structure" or something similar. This would be extremely useful when adding a structure to a Nether-like dimension because it either spawns buried underground or floating in the air, never actually on the ground.

This would solve the structure spawning hidden underground or floating in the air, but I am not too sure about how does the structure find "ground" so it might spawn above bedrock. So I think there should also be an option to choose the height at which the structure will spawn or an option to blacklist some blocks so the structure won't spawn on them.

 

I'm sorry for my bad English

 

Issue comments

The issue with checking for space is that:

  1. Currently, we can only check for the outer square bounds of the structure
  2. This can significantly reduce the probability of spawning as there are rarely good places for the structure to spawn when iterating through chunks. Checking each position would take too much time and cpu power

If these two limitations are acceptable, we can add this.

Then how could we prevent the structure from spawning underground?

 

You should add a kind of "Mini procedure" which will be a Condition for Structure Generation or even Block Generation

Like if i want to generate Stalagtites in Caves, I can make this Block generate instead of Air (not stone)

And if i want it to generate under stone, The condition procedure is here: Start Block

Generating Condition --> Get block at X Y+1 Z = Stone   AND Get block at X Y-1 Z = Air

 

For a Stalagtite, i would do something like that

We plan to add new mod element type condition that could be reused by many mod elements, and at this point this will be resolved the way loic described.

Wow, I was just going to suggest a "call condition" block but it seems you have already planned it XD