Easy Data Fix 图标

Easy Data Fix

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.2.0+mc26.1-neoforge
本资源为搬运资源,原资源地址: https://modrinth.com/mod/easy-data-fix
资源信息

Minecraft 版本: 26.1 26.1.1 26.1.2 26.2

平台: neoforge

标签: library utility

资源介绍

easy data fix icon

A library that enables modders to register custom data fixers.

[Download on Modrinth](https://modrinth.com/mod/easy-data-fix/versions) | [Download from Releases](https://github.com/VoxelBill/easy-data-fix/releases)

About The Project

Easy Data Fix is a small library mod that aids in creation of data fixers for mods, allowing custom mod game data to be converted between different versions of the game safly. The mod wraps the builtin DataFixerUpper classes which are as Mojang says "a set of utilities designed for incremental building, merging, and optimization of data transformations"

Use

  1. Download easy_data_fix-<loader>-x.x.x+mc26.1 from on of the places at the top of this README.
  2. Copy the downloaded jar file to your mods folder.

Using The Library In Development

To setup data fixers for your mod you first need to add the library as a dependency in your build.gradle file, then you just need to register them on pre-launch using Easy Data Fix's API. See example below.

build.gradle

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

dependencies {
    ...

    // Replace <Tag> with the release tag string from the Releases page
    implementation "com.github.VoxelBill:easy-data-fix:<Tag>"
}

ExampleFix.java

public class ExampleFix implements PreLaunchEntrypoint {
    @Override
    public void onPreLaunch() {
        DataFixerRegistry.addDataFix("Description of data fixer", builder -> {
            // dataVersion = The Minecraft data version used in the version your upgrading to.
            // SchemaVersion = The builtin schema class that goes with the data version.
            // Example: (4773, V4771::new) = 26.1 full release
            Schema schema = builder.addSchema(dataVersion, V[SchemaVersion]::new);
            builder.addFixer(BlockRenameFix.create(schema, "Fixer Name", DataFixerAPI.createRenamer("example_mod:mod_block", "example_mod:new_mod_block")));
            builder.addFixer(ItemRenameFix.create(schema, "Fixer Name", DataFixerAPI.createRenamer("example_mod:mod_item", "example_mod:new_mod_item")));
        });
        // You may also have multiple DataFixerRegistry here to better organize your data fixes or to support other versions.
    }
}

Getting Started With Development

To get a local copy up and running, follow these simple steps.

Prerequisites

Ensure you have the following installed on your machine:

  • Java Development Kit (JDK): Version 25 or higher.
  • Gradle: Version 9.2 or higher.
  • Minecraft: Version 26.1

Build

  1. Clone the repository

    git clone https://github.com/VoxelBill/easy-data-fix.git
  2. Navigate to the project directory

    cd easy-data-fix
  3. Build the project with Gradle

    ./gradlew clean build

You can find the built mod at easy-data-fix/build/libs/easy_data_fix-<loader>-x.x.x+mc26.1.jar.

下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
WoKFlows

价格:0 墨喵币
下载量:0

查看详情
Amanita

价格:0 墨喵币
下载量:0

查看详情
AbstractedUtilities

价格:0 墨喵币
下载量:0

查看详情
Harder Beds

价格:0 墨喵币
下载量:0

查看详情