maruohon / justenoughdimensions

A simple Minecraft mod to register custom dimensions to the game
GNU General Public License v3.0
12 stars 7 forks source link

dimension naming is not what the json file names it #51

Open Wrsaith opened 4 years ago

Wrsaith commented 4 years ago

so I've created several dimensions but none of them are named in the loaded/registered list by the name in the json file instead they all have JED surface 0 or JED surface Loaded 0. with type id 0.

{
  "dim": 3,
  "dimensiontype": {
    "id": 3,
    "name": "Minerworld",
    "suffix": "dim3",
    "keeploaded": true,
    "worldprovider": "WorldProviderSurfaceJED"
  },
  "worldinfo": {},
  "worldinfo_onetime": {
    "RandomSeed": "dragonsrock"
  }
},

this is the dim setup. when using the /jed reload it does not give any errors, when I do the dimbuild command it shows the same. but the load/register list show

[09:59:08] [Server thread/INFO] [justenoughdimensions]: | 4 | 0 | JED Surface 0 | false | WorldProviderSurfaceJED | true | [09:59:08] [Server thread/INFO] [justenoughdimensions]: | 3 | 0 | JED Surface Loaded 0 | true | WorldProviderSurfaceJED | false |

justenoughdimensions-1.12.2-1.6.0-dev.20200416.184714 forge 2854

maruohon commented 4 years ago

You have to set the "require_exact_match": true option inside the dimensiontype object, forcing JED to use the exact values you set, including the name. Example: https://pastebin.com/MnKw48fg

The reason for that option is that in 1.12.2 and below the vanilla DimensionType is a Java enum which normally would never be edited at run time, and thus registering new values to it sometimes causes problems. Especially if they are registered "too late" so that something has already queried the values() method of that enum enough for the JIT to optimize it away, at which point any newly added entries won't be visible there anymore... This caused issues in the past at least with Optifine. So by default JED pre-registers a few entries on game launch and re-uses those, if none of the actually important values are different (world provider type, and should load spawn option mostly).

Also in your config the empty worldinfo object is not needed, if you already have a worldinfo_onetime (which is what you usually want to use, except for the generatorName and generatorOptions values if you run a server with Sponge).

Wrsaith commented 4 years ago

Ok I will try that once im home, the empty world info I am going to use the custom world colors and sky colors but toom them out during testing.

maruohon commented 4 years ago

None of the custom colors or other JED options go inside the worldinfo object anymore in 1.6.0+. Refer to this list of config changes and additions in the 1.6.0 versions since 1.5.x: https://pastebin.com/raw/28jeWZyv And there are a lot of examples of various things here: https://pastebin.com/u/masa- such as one of my testing configs: https://pastebin.com/d3EZzDY3

Wrsaith commented 4 years ago

aah ok then i'll look at these new ones and figure out!

ghost commented 4 years ago

I've got a similar issue with overrided dimensions. The custom name works fine for the dimensions I made myself, but I also want to rename dim 0 and the others that come with my mod. I have used both "require_exact_match": true and "override": true, but it still shows the general names. Any idea why?

This is Dim 0, which doesn't inherit its custom name:

{ "dim": 0, "dimensiontype": { "id": 0, "name": "Spawn Superflat", "suffix": "_dim0", "keeploaded": true, "worldprovider": "WorldProviderSurface", "require_exact_match": true, "override": true }, "worldinfo_onetime": { "generatorName": "flat", "generatorOptions": "3;minecraft:air;127;", "BorderSize": 2048, "BorderSizeLerpTarget": 2048, "SpawnX": 0, "SpawnY": 64, "SpawnZ": 0 } },

This is Dim 100 that I created which does inherit its custom name:

{ "dim": 100, "dimensiontype": { "id": 100, "name": "BOP Overworld", "suffix": "_dim100", "keeploaded": false, "worldprovider": "WorldProviderSurface", "require_exact_match": true }, "worldinfo_onetime": { "generatorName": "BIOMESOP", "BorderSize": 16384, "BorderSizeLerpTarget": 16384, "SpawnX": 0, "SpawnY": 72, "SpawnZ": 0 } },

maruohon commented 4 years ago

To override dimensions you need to also enable the dimensions overriding option in the JED main config. And the "override": true option doesn't go inside the dimensiontype object.

(And a tip, for code blocks use triple ticks instead of single ticks, so it doesn't destroy the line breaks.)

ghost commented 4 years ago

That setting has been true from the first time I checked the config. Also by triple ticks do you mean the spaces before each indentation? They aren't single in my file, that's just how the code is changed in the code block on github apparently....

Edit: Config & Dimensions I know that override is currently only with Dim 0, but that's where I've been testing if that actually changes the name. I had it with all dimensions and it still changed nothing.

maruohon commented 4 years ago

Basically you want the override option like this:

{
    "dim": 0,
    "override": true,
    "dimensiontype": {
        "id": 0,
        "name": "Spawn Superflat",
        "suffix": "_dim0",
        "keeploaded": true,
        "worldprovider": "WorldProviderSurface",
        "require_exact_match": true
    },
    "worldinfo_onetime": {
        "generatorName": "flat",
        "generatorOptions": "3;minecraft:air;127;",
        "BorderSize": 2048,
        "BorderSizeLerpTarget": 2048,
        "SpawnX": 0,
        "SpawnY": 64,
        "SpawnZ": 0
    }
},

And triple ticks like this ``` test 123 ```

make it like:

test
123
ghost commented 4 years ago

Ah, so override was in the wrong location. Will test that in a minute. In the meanwhile, where exactly in the config would I put ''' because I don't see ' anywhere. Thanks for your quick responses!

ghost commented 4 years ago

I just tested the dimensions with override on true, and the naming now works. However, while previously the correct worldproviders were listed for nether, twilight forest and spectre, they have now all turned into WorldProviderSurfaceJED, even though those are not the ones specified in dimensions.json. Any idea where that came from?

maruohon commented 4 years ago

That triple tick stuff was just for the github comments here, to get proper code blocks.

Do you mean the /jed list-registered-dimensions now shows the wrong WorldProvider for those dimensions? If you go to those dimensions, do they also generate wrong, and does /jed debug also how the Surface provider there now?

ghost commented 4 years ago

List registered dimensions now shows WorldProviderSurfaceJED instead of WorldProviderBOPHell, WorldProviderTwilightForest & SpectreWorldProvider. On a sidenote, it might be an idea to add to the mod description that in single player the 'console' is the latest log file, because that had me really confused for a moment. I haven't tested jed debug yet, will do that and let you know!

maruohon commented 4 years ago

Oh wait I see, I didn't look at your full config before. Yeah those short hand names won't work for those providers, only the vanilla and JED providers have the shorthand names. For any modded/other WorldProviders you need to use the fully qualified class name, which you can get with /jed debug while in such a dimension (or with /jed list-registered-dimensions I think, provided that you haven't overridden them yet). That's why it's now falling back to the JED provider because it can't find those modded providers by the class name alone without the full package name.

maruohon commented 4 years ago

You can also enable the console in the launcher vanilla: https://imgur.com/KDq0WYG MultiMC: https://imgur.com/oswu2hF

ghost commented 4 years ago

Ah, that was slightly confusing as without the override it lists the shorthand versions in the jed list. How do I find the full provider name in that case? And thanks for the console tip, that is very useful! Maybe you can add that to the mod description too!

maruohon commented 4 years ago

You can see the full name with the /jed debug command when you run it inside each dimension, such as inside a Twilight Forest dimension.

You'll need to disable the JED overrides while doing that, for example by renaming the dimension config file to something else, restarting the game and starting a new temporary test world(s). You only need to restart the game in this case because you have overridden the normal dimension entries, and the only way to properly undo that in 1.12 is to restart the game.

Normally other JED dimension config changes can be applied simply by save & exit to the main menu, edit the config, and then reload the world or create a new test world, depending on what kind of things you change in the config. Mostly just getting rid of overrides or extra registered dimensiontypes are things that require a game restart, due to the vanilla DimensionType being a Java enum in 1.12 so things that are added once can't be removed without a restart.

ghost commented 4 years ago

I usually test my dimension config by editing the json outside of my .minecraft folder, and then copying the "fresh" save back to the saves folder, after removing the previous test save from it. That way I can test a lot of things without a restart! I will check the debug info, thanks for the help!

ghost commented 4 years ago

It works! Thanks a lot! This is how it's set up now:

dimensions.json => Click Console screenshot => Click