Just Enough Dimensions

Just Enough Dimensions

4M Downloads

[FEATURE REQUEST] Save-defined spawn dimension

ZotyDev opened this issue ยท 6 comments

commented

It would be awesome to have that!

Why?

Currently (to my knowledge) it is impossible to make a save-defined spawn dimension, and that would make for a huge feature combined with Default World Generator.
I want to use Default World Generator to provide the players of my modpack with a choice for initial planet, so that when they select the world type the default spawn dimension gets set before the world is generated.

Is that possible?

commented

Ohh, that worked perfectly!
Thank you very much!!

commented

By spawn dimension do you mean just the initial spawn dimension, or also the respawn dimension when no bed spawn is set (and other respawn related shenanigans... i.e. the death dimension not allowing respawns).

I'm not really familiar with Default World Generator. How does it work, what/where does it set/configure when the choice is made? Does it select a bunch of configs from somewhere, or is it similar to the vanilla world type selection and it just selects the world type and generator settings and whatnot?

Basically I don't really understand yet where/how JED should read something to see what it should do... and what it should actually do.

commented

Oh, I mean the initial spawn dimension, would it be possible to make a per-save (not per-dimension) config to define the initial spawn dimension?
Default World Generator (the port) lets you define multiple starting worlds, when selecting a world it is possible to have some custom values set, including commands and a folder that will be copied to the preset. i.e. if you define a preset called earth, you can define defaults that will be copied only for this preset, but sadly I couldn't find any way of using that for what I intended.
But JED, already having the initial spawn dimension feature, could be more useful for this, currently JED lets you define a global initial spawn dimension (which makes sense due to how minecraft behaves).
I started thinking about how to do it, and while exploring the source I found out that its not a limitation of minecraft itself, but there was no reason to even implement it.
Having this functionality on JED would be awesome! Just a config at /saves/<save>/jed.cfg or a similar path, that is capable of defining the initial spawn dimension is enough!

Thanks for answering me! I would kindly ask you for this feature, and if you don't think its necessary to the mod, please let me try my best at implementing it and sending a PR :D.

commented

Just to clarify why.
That would allow me to define multiple default worlds like: mars, earth, moon, asteroid belt, etc, making it possible for players to select a starting dimension.

commented

image
Image for reference on how that looks like

commented

Okay I had to go and read some of the code as I couldn't remember how things work anymore... But it looks like this might be possible already. JED already has support for per-world (i.e. per-save) configs. So if you can copy the config directory to the save (early enough) using Default World Generator, then it might work. The per-world path for the JED "main config" is at <worldname>/data/justenoughdimensions/justenoughdimensions.cfg. That directory/file would then come from your DWG profile, and in that file you could set the initial spawn dimension ID.

For these per-world configs to get loaded, you will then also need to enable the B:usePerWorldMainConfig=true option in the global JED main config in the config directory.

So give this a try. Also enable the JED verbose logging option while you test things, so that you can see which config file JED loads and when in relation to other things. One problem might be if JED's world load event handler runs before DWG copies the configs to the world, I have no idea how that's implemented in DWG.