Natural Nether Portals

Natural Nether Portals

435k Downloads

Minimum distance between portals

Closed this issue ยท 4 comments

commented

I'm not sure if it's the noise algorithm used to choose portal positions, or some other quirk, but I've noticed that portals tend to generate in clusters, even when the rarity is set to 1/800 chunks (which is what I had it at). I don't know whether it's a fluke of the random map seeds I happen to get when testing, but it'd be nice to have a config option to set the minimum distance between generated portals to avoid these clusters and more evenly distribute portals (if/when desired).

commented

Yeah, the portal generation uses just a stupid random, nothing more.

I really don't know how to do that but I'll try

commented

Would it be possible to get the portal coordinates from map data, cache them on chunk load (and uncache them on chunk unload), and when attempting to generate a new portal check the cached list for other portals within the config setting distance and deny the spawn if any are found? I'm sure that wouldn't catch every possible scenario, but it would reduce clustering a great deal. I also don't know enough about how easy or efficient it is to read map data to determine block coordinates, or whether portal location is something that MC stores in a more accessible list, so I don't know whether it's practical to do.

commented

Would it be possible to get the portal coordinates from map data, cache them on chunk load, and when attempting to generate a new portal check the distance between the selected location and all other cached portal locations and deny the spawn if the distance isn't greater than or equal to the hypothetical config setting

That's what I'll try to do. But by saving every portal that I spawn in the world files and then check them back when spawning a new one. There might be a better solution since this one will be slower the more world you generate. Until this solution will be found, I'll try to do this.

commented

I've updated my suggestion with what I hope is something that wouldn't take longer and longer the bigger the map gets.