{"id":17015229,"url":"https://github.com/lclpyt/mcchunktransform","last_synced_at":"2025-07-19T16:12:29.098Z","repository":{"id":105887850,"uuid":"457966943","full_name":"LCLPYT/MCChunkTransform","owner":"LCLPYT","description":"A simple Minecraft chunk transformer API","archived":false,"fork":false,"pushed_at":"2022-12-04T15:58:04.000Z","size":368,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T14:42:34.730Z","etag":null,"topics":["fabricmc","lclpserver5","minecraft","minecraft-data","minecraft-mod","minecraft-tool","minecraft-world"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LCLPYT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2022-02-10T22:23:22.000Z","updated_at":"2022-02-11T01:32:47.000Z","dependencies_parsed_at":"2023-06-25T22:55:42.639Z","dependency_job_id":null,"html_url":"https://github.com/LCLPYT/MCChunkTransform","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":"LCLPYT/fabric-mod-boilerplate","purl":"pkg:github/LCLPYT/MCChunkTransform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCLPYT%2FMCChunkTransform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCLPYT%2FMCChunkTransform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCLPYT%2FMCChunkTransform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCLPYT%2FMCChunkTransform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LCLPYT","download_url":"https://codeload.github.com/LCLPYT/MCChunkTransform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCLPYT%2FMCChunkTransform/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260689612,"owners_count":23047043,"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","lclpserver5","minecraft","minecraft-data","minecraft-mod","minecraft-tool","minecraft-world"],"created_at":"2024-10-14T06:27:59.237Z","updated_at":"2025-06-19T04:38:33.851Z","avatar_url":"https://github.com/LCLPYT.png","language":"Java","readme":"# MCChunkTransform\n[![Gradle Publish](https://github.com/LCLPYT/MCChunkTransform/actions/workflows/gradle-publish.yml/badge.svg)](https://github.com/LCLPYT/MCChunkTransform/actions/workflows/gradle-publish.yml)\n\nA simple Minecraft chunk transformer API.\n\n## What it does\nMCChunkTransform is a simple Fabric client modification for applying transformations to your Minecraft worlds programmatically.\nThough the mod is written for Fabric, it can also transform worlds created in Forge or Vanilla, without making them incompatible.\n\nIn your singleplayer world selection screen, if you edit the world, you will find a new button:\n![Edit world screen](https://raw.githubusercontent.com/LCLPYT/MCChunkTransform/main/img/edit_world.jpg)\n\nClick this button to start the transformation process.\nBy it's own, this mod does not apply any modifications to your world; it only reads all chunks one by another.\n\n![Transformation progress](https://github.com/LCLPYT/MCChunkTransform/raw/main/img/transform.jpg)\n\n## Create custom transformers\nIn order to apply custom transformation to your world, you need to register a `ChunkTransformer` in your mod.\nIf you have no mod yet, you can create one as described in the [Fabric wiki](https://fabricmc.net/wiki/tutorial:introduction).\n\n### Gradle dependency\nAfter you have everything set up, add MCCT (MCChunkTransform) as a Gradle dependency:\n```gradle\nrepositories {\n    // add the LCLPNetwork maven repository\n    maven {\n        url \"https://repo.lclpnet.work/repository/internal\"\n    }\n}\n\ndependencies {\n    // your other dependencies ...\n    modImplementation \"work.lclpnet.mods:mcct:\u003cversion\u003e\"\n}\n```\n\nYou can lookup all available versions [here](https://repo.lclpnet.work/#artifact/work.lclpnet.mods/mcct).\n\n### Implementation\nIn your ModInitializer or ClientInitializer, register a new transformer by calling `MCCT::registerTransformer`:\n```java\npublic class ExampleMod implements ModInitializer {\n    @Override\n    public void onInitialize() {\n        MCCT.registerTransformer(new ChunkTransformer.Builder().addTransformation((ctx, transformer) -\u003e {\n            CompoundTag chunkData = ctx.getCompound();\n            // read and write chunkData here...\n            // if you modified the data, remember to call ctx.markDirty() so that your changes get written to disk.\n        }).create());\n    }\n}\n```\nYou can use the `ChunkTransformer.Builder` to configure your chunk transformer.\nFor the sake of simplicity, we only register a single chunk transformation with no further configuration.\nHowever, you can add multiple transformers by chaining the `addTransformation()` calls.\nThe transformations will be applied in the order they have been submitted to the builder.\n\nBy default, every transformation is called once for every chunk of every region of every dimension.\nHowever, you can also configure your `ChunkTransformer` to filter dimensions `targetDimensions()`, regions `targetRegions()` and chunks `targetChunks()`:\n```java\npublic class ExampleMod implements ModInitializer {\n    @Override\n    public void onInitialize() {\n        MCCT.registerTransformer(new ChunkTransformer.Builder()\n                .addTransformation((ctx, transformer) -\u003e {\n                    CompoundTag chunkData = ctx.getCompound();\n                    // read and write chunkData here...\n                    // if you modified the data, remember to call ctx.markDirty() so that your changes get written to disk.\n                })\n                .targetDimension(World.OVERWORLD::equals)\n                .targetRegions(region -\u003e Math.abs(region.x) \u003c 2 \u0026\u0026 Math.abs(region.y) \u003c 2)\n                .targetChunks((chunkPos, region) -\u003e chunkPos.x % 2 == 0 \u0026\u0026 chunkPos.z % 2 == 0)\n                .create());\n    }\n}\n```\nThis transformer in this example only targets chunks with even coordinates, located in one of the region files `[r.[-1,0,1].[-1,0,1].mca` of the overworld.\n\n### Example\nThe following example transformer will replace every diamond block in a world with a gold block.\n```java\npublic class ExampleMod implements ModInitializer {\n    @Override\n    public void onInitialize() {\n        MCCT.registerTransformer(new ChunkTransformer.Builder().addTransformation((ctx, transformer) -\u003e {\n            CompoundTag chunkData = ctx.getCompound();\n            if (!chunkData.contains(\"Level\", NbtType.COMPOUND)) return;\n\n            CompoundTag level = chunkData.getCompound(\"Level\");\n            if (!level.contains(\"Sections\", NbtType.LIST)) return;\n\n            ListTag sections = level.getList(\"Sections\", NbtType.COMPOUND);\n            sections.forEach(sectionTag -\u003e {\n                if (!(sectionTag instanceof CompoundTag)) return;\n\n                CompoundTag section = (CompoundTag) sectionTag;\n                if (!section.contains(\"Palette\", NbtType.LIST)) return;\n\n                ListTag palette = section.getList(\"Palette\", NbtType.COMPOUND);\n                palette.forEach(paletteEntryTag -\u003e {\n                    if (!(paletteEntryTag instanceof CompoundTag)) return;\n\n                    CompoundTag paletteEntry = (CompoundTag) paletteEntryTag;\n                    if (!paletteEntry.contains(\"Name\", NbtType.STRING)) return;\n\n                    String blockId = paletteEntry.getString(\"Name\");\n                    if (!\"minecraft:diamond_block\".equals(blockId)) return;\n\n                    paletteEntry.putString(\"Name\", \"minecraft:gold_block\");\n                    ctx.markDirty();\n                });\n            });\n        }).create());\n    }\n}\n```\n\n## Helpful tools\n- [NBTExplorer](https://github.com/jaquadro/NBTExplorer) - a GUI programm that shows you the nbt structure of `.mca` or `.dat` files\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flclpyt%2Fmcchunktransform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flclpyt%2Fmcchunktransform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flclpyt%2Fmcchunktransform/lists"}