DataFixerUpper Documentation

repository·master·Indexed 23 days ago

https://github.com/mojang/datafixerupper

A set of utilities for incrementally building, merging, and optimizing data transformations, originally created for Minecraft: Java Edition. Includes core concepts such as Schema, DataFix, DataFixerBuilder, and a DSL for constructing type definitions and rewrite rules.

Tokens
480
Snippets
2
Records
3
Agent score
30%

What's inside DataFixerUpper

  1. Core concepts of DataFixerUpper

    master

    DataFixerUpper is built around several key abstractions for managing data transformations:

    • Schema: A set of type definitions that specify the data types the system is interested in and how they relate to each other.
    • DataFix: A rewrite rule that defines a transformation between two types.
    • DataFixerBuilder: A builder that takes a list of Schema objects and DataFix rules to create an optimized converter between the types described in those schemas.
    • DSL: A class containing building blocks used to construct both Schema and DataFix objects.
  2. Install DataFixerUpper via Maven

    master

    To use DataFixerUpper in a Maven project, add the minecraft-libraries repository to your pom.xml, then add the datafixerupper dependency. Replace (the latest version) with the current version of the library.

    <repository>
      <id>minecraft-libraries</id>
      <name>Minecraft Libraries</name>
      <url>https://libraries.minecraft.net</url>
    </repository>
    
    <dependency>
        <groupId>com.mojang</groupId>
        <artifactId>datafixerupper</artifactId>
        <version>(the latest version)</version>
    </dependency>
  3. Install DataFixerUpper via Gradle

    master

    To use DataFixerUpper in a Gradle project, first add the Minecraft libraries repository to your repositories block, then add the datafixerupper dependency. Replace (the latest version) with the current version of the library.

    maven {
        url "https://libraries.minecraft.net"
    }
    
    // Then use the library
    compile 'com.mojang:datafixerupper:(the latest version)'