介绍

Easy Data Fix
A library that enables modders to register custom data fixers.
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
- Download
easy_data_fix-<loader>-x.x.x+mc26.1from on of the places at the top of this README. - Copy the downloaded jar file to your
modsfolder.
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 {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
dependencies {
...
// Replace <Version> with the version number string from the Modrinth version page
implementation "com.modrinth:easy-data-fix:<Version>"
}
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.
- Download JDK
- Gradle: Version 9.2 or higher.
- Install Gradle
- Minecraft: Version 26.1
Build
- Clone the repository
git clone https://codeberg.org/VoxelBill/easy-data-fix.git
- Navigate to the project directory
cd easy-data-fix
- Build the project with Gradle
./gradlew clean build
You can find the built mod at easy-data-fix/<loader>/build/libs/easy_data_fix-<loader>-x.x.x+mc26.1.jar.
常见问题
Easy Data Fix 支持哪些 Minecraft 版本?
Easy Data Fix 支持 Minecraft Java 版 1.21–26.3,共 17 个版本,可用的加载器:Fabric / NeoForge。下载时注意选择和你游戏版本一致的文件。
Easy Data Fix 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅服务端。
VoxelBill 的其他作品
查看全部 →
Hibernate MC (Formerly Hibernate Fabric)
Lets your Minecraft Fabric or NeoForge server snooze when idle, slashing CPU usage without missing a block!
26.1 Backport
Backports Minecraft 26.1 features to 1.21.11 minus the baby mob remodels.
Intentional Pickup
A simple mod that makes mobs only pickup items that are intentionally dropped by players.
评论
登录后评论和评分