{"id":19857301,"url":"https://github.com/teamgalacticraft/dynamicdimensions","last_synced_at":"2025-05-02T02:30:32.254Z","repository":{"id":54481294,"uuid":"495185892","full_name":"TeamGalacticraft/DynamicDimensions","owner":"TeamGalacticraft","description":"Library to facilitate the runtime addition and removal of minecraft dimensions.","archived":false,"fork":false,"pushed_at":"2025-04-17T14:52:27.000Z","size":596,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"minecraft/1.21","last_synced_at":"2025-04-17T17:29:04.403Z","etag":null,"topics":["fabricmc","library","minecraft"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TeamGalacticraft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-22T21:52:45.000Z","updated_at":"2025-04-17T14:52:31.000Z","dependencies_parsed_at":"2025-04-17T06:25:41.370Z","dependency_job_id":"c0b40ab9-988a-4173-ba40-3153a5ffef9a","html_url":"https://github.com/TeamGalacticraft/DynamicDimensions","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamGalacticraft%2FDynamicDimensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamGalacticraft%2FDynamicDimensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamGalacticraft%2FDynamicDimensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeamGalacticraft%2FDynamicDimensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TeamGalacticraft","download_url":"https://codeload.github.com/TeamGalacticraft/DynamicDimensions/tar.gz/refs/heads/minecraft/1.21","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251972413,"owners_count":21673600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fabricmc","library","minecraft"],"created_at":"2024-11-12T14:18:09.130Z","updated_at":"2025-05-02T02:30:32.249Z","avatar_url":"https://github.com/TeamGalacticraft.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DynamicDimensions\nLibrary to facilitate the runtime addition and removal of Minecraft dimensions.\n\n## Adding DynamicDimensions to your project\nAdd the Galacticraft maven to your project\n```groovy\nrepositories {\n    maven {\n//        url = \"https://maven.galacticraft.net/repository/maven-releases\" // currently offline\n        url = \"https://repo.terradevelopment.net/repository/maven-releases\"\n    }\n}\n```\n\nThen add the appropriate dependency:\n### Fabric\n```groovy\ndependencies {\n    modImplementation(\"dev.galacticraft.dynamicdimensions-fabric:$dyndims\")\n}\n```\n\n### NeoForge\n```groovy\ndependencies {\n    implementation(\"dev.galacticraft.dynamicdimensions-neoforge:$dyndims\")\n}\n```\n\n### Multiplatform\n```groovy\n// Common\ndependencies {\n    compileOnly(\"dev.galacticraft.dynamicdimensions-common:$dyndims\")\n}\n\n// Fabric\ndependencies {\n    modRuntimeOnly(\"dev.galacticraft.dynamicdimensions-fabric:$dyndims\")\n}\n\n// NeoForge\ndependencies {\n    runtimeOnly(\"dev.galacticraft.dynamicdimensions-neoforge:$dyndims\")\n}\n```\n\n## Using the API\nAll APIs dealing with the addition and removal of dynamic dimensions go through the\n`dev.galacticraft.dynamicdimensions.api.DynamicDimensionRegistry`\nclass.\n\nTo obtain an instance, simply call \n`DynamicDimensionRegistry#from(MinecraftServer)`\n\nNote that this library does *not* keep track of what dynamic dimensions have been created when the server restarts.\nYou will need to track this yourself and then\n[load the dimension](#loading-a-dimension-reads-or-creates-new-level-data)\nagain.\n\n### Creating a *new* dimension (overwrites level data)\nCall \n`DynamicDimensionRegistry::createDynamicDimension`\nwith the ID of your dimension, a chunk generator, and a dimension type.\n\n```java\nChunkGenerator generator;\nDimensionType type;\n\n// ... initialize chunk generator and dimension type ...\n\nDynamicDimensionRegistry registry = DynamicDimensionRegistry.from(server);\nServerLevel level = registry.createDynamicDimension(ResourceLocation.fromNamespaceAndPath(\"mymod\", \"dynamic\"), generator, type);\n\nif (level == null) {\n    // failed to create level\n} else { /*...*/ }\n```\n\nThis will create a new dimension with the given ID, discarding data from any previous dimensions with the same ID.\nIf you want world data to be loaded, see\n[the next section](#loading-a-dimension-reads-or-creates-new-level-data)\n.\n\n#### Caveats\n\n* `createDynamicDimension` will delete all previous dimension data.\n* The `DimensionType` and ID of your dimension cannot already be in use.\n* There may be a one-tick delay before the dimension is registered with the server.\n\n### Loading a dimension (reads or creates new level data)\nCall \n`DynamicDimensionRegistry::loadDynamicDimension`\nwith the ID of your dimension, a chunk generator, and a dimension type.\n```java\nChunkGenerator generator;\nDimensionType type;\n\n// ... initialize chunk generator and dimension type ...\n\nDynamicDimensionRegistry registry = DynamicDimensionRegistry.from(server);\nServerLevel level = registry.loadDynamicDimension(ResourceLocation.fromNamespaceAndPath(\"mymod\", \"dynamic\"), generator, type);\n\nif (level == null) {\n    // failed to create level\n} else { /*...*/ }\n```\n\nThis will create a dimension with the given ID, loading previous region/level data from disk.\n\n#### Caveats\n\n* The `DimensionType` and ID of your dimension cannot already be in use.\n* There may be a one-tick delay before the dimension is registered with the server.\n\n### Unloading a dimension\nCall \n`DynamicDimensionRegistry::unloadDynamicDimension`\nwith the ID of your dimension and (optionally) a callback to move connected players off-world.\n```java\nDynamicDimensionRegistry registry = DynamicDimensionRegistry.from(server);\nregistry.unloadDynamicDimension(ResourceLocation.fromNamespaceAndPath(\"mymod\", \"dynamic\"), null);\n```\nThe dimension will be saved to disk before being unloaded. You can use\n`loadDynamicDimension`\nto create the dimension again (loading the same world data).\n\n#### Caveats\n* There may be a one-tick delay before the dimension is removed from the server.\n* If no callback is provided, players will be teleported to their spawn point\n\n### Deleting a dimension\nCall \n`DynamicDimensionRegistry::deleteDynamicDimension`\nwith the ID of your dimension and (optionally) a callback to move connected players off-world.\n```java\nDynamicDimensionRegistry registry = DynamicDimensionRegistry.from(server);\nregistry.deleteDynamicDimension(ResourceLocation.fromNamespaceAndPath(\"mymod\", \"dynamic\"), null);\n```\nThe dimension will be unloaded, then all the dimension files will be deleted.\n\n#### Caveats\n\n* There may be a one-tick delay before the dimension is removed from the server.\n* Once deleted, dimension files are not recoverable\n* If no callback is provided, players will be teleported to their spawn point\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamgalacticraft%2Fdynamicdimensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteamgalacticraft%2Fdynamicdimensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteamgalacticraft%2Fdynamicdimensions/lists"}