### Parchment Mapping File Format Example Source: https://context7.com/parchmentmc/parchment/llms.txt This is an example of the Enigma mapping format used by Parchment. It includes class, method, parameter, and javadoc information. ```mapping CLASS net/minecraft/world/entity/Entity METHOD (Lnet/minecraft/world/entity/EntityType;Lnet/minecraft/world/level/Level;)V ARG 1 entityType ARG 2 level METHOD distanceTo (Lnet/minecraft/world/entity/Entity;)F COMMENT Returns the distance to the entity. ARG 1 entity METHOD teleportTo (DDD)V COMMENT Sets the position of the entity and updates the 'last' variables ARG 1 x ARG 3 y ARG 5 z ``` -------------------------------- ### Add Javadoc Comments in Enigma Source: https://context7.com/parchmentmc/parchment/llms.txt This example shows how to add Javadoc comments to mapping data using the Enigma tool. The format is demonstrated within a .mapping file. ```mapping CLASS net/minecraft/world/level/block/Block METHOD animateTick (Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/util/RandomSource;)V COMMENT Called periodically clientside on blocks near the player to show effects (like furnace fire particles). ARG 1 state ARG 2 level ARG 3 pos ARG 4 random ``` -------------------------------- ### Run Enigma Mapping Tool via Gradle Source: https://context7.com/parchmentmc/parchment/llms.txt Use this Gradle command to launch the Enigma tool for editing mappings. Follow the in-tool instructions to rename parameters and add Javadocs. ```bash ./gradlew enigma ``` -------------------------------- ### Migrate Mappings Between Minecraft Versions Source: https://context7.com/parchmentmc/parchment/llms.txt Use the Gradle command-line interface to migrate mappings to a target Minecraft version. This process automatically handles intermediate versions and uses JAMMER for method matching. After migration, run 'sanitizeData' and 'validateData'. ```bash # Migrate mappings to a target Minecraft version ./gradlew -Pmigration-targetVersion="1.21" migrateData # Or configure in build.gradle: # compass { # migration { # targetVersion = '1.21' # } # } # After migration, validate and sanitize the data ./gradlew sanitizeData ./gradlew validateData # Promote staging data to production ./gradlew promoteStagingToProduction # The migration system automatically: # - Steps through intermediate versions # - Uses JAMMER for method matching # - Excludes April Fools versions by default ``` -------------------------------- ### Publish All Exports with Gradle Source: https://context7.com/parchmentmc/parchment/llms.txt Execute this Gradle task to publish all generated mapping export artifacts. This command handles the publication to configured Maven repositories. ```bash ./gradlew publishExport ``` -------------------------------- ### Publish Mappings to Local Repository with Gradle Source: https://context7.com/parchmentmc/parchment/llms.txt This Gradle command publishes the mapping artifacts to your project's local Maven repository. The output indicates the location where the artifacts are stored. ```bash ./gradlew publishExportPublicationToProjectLocalRepository ``` -------------------------------- ### Generate Staging Export Artifacts with Gradle Source: https://context7.com/parchmentmc/parchment/llms.txt This Gradle task generates a ZIP archive of the staging export, intended for testing purposes. ```bash ./gradlew officialStagingExportZip ``` -------------------------------- ### Configure Migration Target Version via Project Property Source: https://github.com/parchmentmc/parchment/blob/versions/1.21.x/docs/mgirating_data.md Set the target Minecraft version for data migration using the 'migration-targetVersion' project property. This can be done in 'gradle.properties' or via the command line. Command-line configuration takes precedence. ```sh ./gradlew -Pmigration-targetVersion="1.19.4" migrateData ``` -------------------------------- ### Configure Compass Gradle Plugin Source: https://context7.com/parchmentmc/parchment/llms.txt Configure the Compass Gradle plugin in your 'build.gradle' file to specify the target Minecraft version. The plugin provides tasks for data validation, sanitization, export generation, and more. ```groovy plugins { id 'org.parchmentmc.compass' version '0.10.0' } compass { // Target Minecraft version version = '1.21' } // Available tasks: // - validateData: Check mapping data for errors // - sanitizeData: Remove invalid entries // - generateOfficialExport: Create JSON export // - migrateData: Migrate to new MC version (when configured) // - downloadClientJar: Download Minecraft client JAR // - remapJar: Remap JAR with Mojang mappings // Output locations: // - data/: Production mapping files (.mapping) // - staging/: Staging data directory // - build/exports/: Generated export files ``` -------------------------------- ### Generate Official Export Artifacts with Gradle Source: https://context7.com/parchmentmc/parchment/llms.txt These Gradle tasks are used to build the mapping export files for distribution. 'generateOfficialExport' creates parchment.json, and 'officialExportZip' creates a ZIP archive. ```bash ./gradlew generateOfficialExport ``` ```bash ./gradlew officialExportZip ``` -------------------------------- ### Configure ForgeGradle with Parchment Mappings Source: https://context7.com/parchmentmc/parchment/llms.txt Integrate Parchment mappings into your Minecraft Forge Gradle project by applying the necessary plugins and configuring the 'minecraft' block. Ensure the ParchmentMC Maven repository is added. ```groovy plugins { id 'net.minecraftforge.gradle' version '6.+' id 'org.parchmentmc.librarian.forgegradle' version '1.+' } minecraft { // Use Parchment mappings with Mojang official names mappings channel: 'parchment', version: '2024.06.16-1.21' } repositories { maven { name = 'ParchmentMC' url = 'https://maven.parchmentmc.org/' } } // The 'checked' export prefixes parameters with 'p' (e.g., pBlock) // to avoid conflicts with local variables in recompiled code ``` -------------------------------- ### Configure Migration Target Version in Gradle Source: https://github.com/parchmentmc/parchment/blob/versions/1.21.x/docs/mgirating_data.md Set the target Minecraft version for data migration using the 'targetVersion' property within the 'migration' extension of the 'compass' project extension. This method overrides project property configuration. ```gradle compass { migration { targetVersion = '1.19.4' } } ``` -------------------------------- ### Generate Sanitized Export Artifacts with Gradle Source: https://context7.com/parchmentmc/parchment/llms.txt Use these tasks to generate a sanitized export of the mappings, suitable for recompilable code. 'generateSanitizedExport' creates the data, and 'officialSanitizedExportZip' creates a ZIP archive. ```bash ./gradlew generateSanitizedExport ``` ```bash ./gradlew officialSanitizedExportZip ``` -------------------------------- ### Sanitize Mapping Data with Gradle Source: https://context7.com/parchmentmc/parchment/llms.txt If validation errors occur, use this Gradle task to automatically remove synthetic methods, invalid mapping entries, and duplicates from your data. ```bash ./gradlew sanitizeData ``` -------------------------------- ### Validate Mapping Data with Gradle Source: https://context7.com/parchmentmc/parchment/llms.txt Run this Gradle task to validate the integrity of your mapping data. It checks for common errors like synthetic methods or invalid entries. ```bash ./gradlew validateData ``` -------------------------------- ### Parchment Mapping Parameter Naming Conventions Source: https://context7.com/parchmentmc/parchment/llms.txt Follow these conventions when contributing mappings to Parchment. Parameters assigned to fields use the field name. Copy constructors, equals, and compareTo use 'other'. Standard abbreviations are encouraged for common types like BlockPos and BlockState. ```plaintext # Parameter Naming Conventions: # 1. Parameters assigned to fields use the field name METHOD setLevel (Lnet/minecraft/world/level/Level;)V ARG 1 level # Same as field name # 2. Copy constructors, equals, compareTo use "other" METHOD equals (Ljava/lang/Object;)Z ARG 1 other METHOD compareTo (Lnet/minecraft/world/entity/Entity;)I ARG 1 other # 3. Standard abbreviations: # BlockPos -> pos # BlockState -> state # DynamicOps -> ops # Example mapping with conventions: CLASS net/minecraft/world/level/block/Block METHOD setPlacedBy (Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/item/ItemStack;)V COMMENT Called by BlockItem after this block has been placed. ARG 1 level ARG 2 pos # BlockPos abbreviated to pos ARG 3 state # BlockState abbreviated to state ARG 4 placer ARG 5 stack ``` -------------------------------- ### Configure Maven Repositories for Parchment Artifacts Source: https://context7.com/parchmentmc/parchment/llms.txt Configure your Maven 'pom.xml' to include the ParchmentMC Maven repositories for accessing release and snapshot artifacts. Specify the dependency for Parchment mappings, including its group ID, artifact ID, version, and type. ```xml parchmentmc ParchmentMC https://maven.parchmentmc.org/ parchmentmc-snapshots ParchmentMC Snapshots https://ldtteam.jfrog.io/artifactory/parchmentmc-snapshots/ org.parchmentmc.data parchment-1.21 2024.06.16 zip ``` -------------------------------- ### PR Validation Workflow Source: https://context7.com/parchmentmc/parchment/llms.txt This GitHub Actions workflow runs on pull requests to validate mapping data, check sanitization, and build export artifacts. ```yaml name: PR Validation on: [pull_request] jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up JDK 17 uses: actions/setup-java@v4 with: java-version: '17' distribution: 'temurin' - name: Validate mapping data run: ./gradlew validateData - name: Check sanitization run: ./gradlew sanitizeData --dry-run - name: Build export run: ./gradlew officialExportZip ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.