Jump to content

[1.19.2] Generate dimensions with code.


Master_J

Recommended Posts

Hi, I have managed to create dimensions using

public static final ResourceKey<Level> NG_MOON = ResourceKey.create(Registry.DIMENSION_REGISTRY, new ResourceLocation(NeutronGalaxy.MODID, "ng_moon"));
public static final ResourceKey<DimensionType> NG_MOON_TYPE = ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, new ResourceLocation(NeutronGalaxy.MODID, "ng_moon"));

and these two json files

{
  "type": "neutrongalaxy:ng_moon",
  "generator": {
    "type": "minecraft:noise",
    "seed": -485105919,
    "settings": "minecraft:overworld",
    "biome_source": {
      "type": "minecraft:fixed",
      "biome": "minecraft:plains"
    }
  }
}

 

{
  "ultrawarm": false,
  "natural": true,
  "piglin_safe": false,
  "respawn_anchor_works": false,
  "bed_works": false,
  "has_raids": true,
  "has_skylight": true,
  "has_ceiling": false,
  "coordinate_scale": 1,
  "ambient_light": 0,
  "logical_height": 384,
  "effects": "minecraft:overworld",
  "infiniburn": "#minecraft:infiniburn_overworld",
  "min_y": -64,
  "height": 384,
  "monster_spawn_light_level": {
    "type": "minecraft:uniform",
    "value": {
      "min_inclusive": 0,
      "max_inclusive": 7
    }
  },
  "monster_spawn_block_light_limit": 0
}

But I would like to know if it is possible to create the dimensions using code instead of json files, or generate the json files like the loot table and recipe data generators.

  • Thanks 1
Link to comment
Share on other sites

I had a look at the forge repo, but when I switched the branch to 1.19.2, there was no dimension data generator, but I did find this comment:

/*
TODO: Make this a data gen:
data/dimension_settings_test/dimension/test_overworld.json
{
  "#comment": [
    "This is an example Dimension showing how it can be configured to use a custom",
    "DimensionSettings that possess similar generation settings to overworld but",
    "has independently configurable structure settings.",
    "",
    "See the 'settings' field below"
  ],
  "type": "minecraft:overworld",
  "generator": {
    "type": "minecraft:noise",
    "seed": 12345,
    "settings": "dimension_settings_test:test_overworld",
    "biome_source": {
      "preset": "minecraft:overworld",
      "type": "minecraft:multi_noise"
    }
  }
}
*/

 

I would also like to know how to use multiple biomes in this dimension json file like the overworld, instead of making everything the plains biome:

{
  "type": "neutrongalaxy:ng_moon",
  "generator": {
    "type": "minecraft:noise",
    "seed": -485105919,
    "settings": "minecraft:overworld",
    "biome_source": {
      "type": "minecraft:fixed",
      "biome": "minecraft:plains"
    }
  }
}

 

Link to comment
Share on other sites

8 hours ago, Master_J said:

I had a look at the forge repo, but when I switched the branch to 1.19.2, there was no dimension data generator, but I did find this comment:

That's what the DatapackBuiltinEntriesProvider is for. It doesn't show the specific dimension, but it can handle any dynamic registry object. I'm guessing that comment is just something nobody bothered to do, which is fair since it affect nothing for dev or production.

8 hours ago, Master_J said:

I would also like to know how to use multiple biomes in this dimension json file like the overworld, instead of making everything the plains biome:

Probably minecraft:noise.

Link to comment
Share on other sites

I used multiple biomes by setting the type to minecraft:multi_noise.

The dimension is working fine now, but I was wondering if there is a way to supress this warning when creating a new world:

Warning! These settings are using experimental features. These settings are experimental and could one day stop working. Do you wish to proceed?

Link to comment
Share on other sites

9 hours ago, Warren Tode said:

This mod does it, so you could try looking at their code to get an idea of how they do it.

I had a look at their code using sponge powered mixins, and used sponge powered's mixins to supress all the experimental warnings including the warning when you create a new world, which that mod does not do.

 

Thanks for the help.

Link to comment
Share on other sites

51 minutes ago, Master_J said:

I had a look at their code using sponge powered mixins, and used sponge powered's mixins to supress all the experimental warnings including the warning when you create a new world, which that mod does not do.

 

Thanks for the help.

Oh I'm sorry, I thought it would be helpful but I'm glad you got something figured it out.

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.

Guest
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.