diff --git a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.java b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.java index 7c94e1395..74655a85b 100644 --- a/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.java +++ b/item-nbt-api/src/main/java/de/tr7zw/changeme/nbtapi/utils/DataFixerUtil.java @@ -16,6 +16,9 @@ public class DataFixerUtil { + // these values can be found in DetectedVersion inside mc + // Finding pre 1.12.2 values is left as an exercise for the reader, + // as DetectedVersion is not a thing there public static final int VERSION1_12_2 = 1343; public static final int VERSION1_16_5 = 2586; public static final int VERSION1_17_1 = 2730; @@ -26,6 +29,7 @@ public class DataFixerUtil { public static final int VERSION1_20_2 = 3578; public static final int VERSION1_20_4 = 3700; public static final int VERSION1_20_5 = 3837; + public static final int VERSION1_21 = 3953; @SuppressWarnings("unchecked") public static Object fixUpRawItemData(Object nbt, int fromVersion, int toVersion) @@ -58,7 +62,9 @@ public static ReadWriteNBT fixUpItemData(ReadWriteNBT nbt, int fromVersion, int * @return */ public static int getCurrentVersion() { - if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_20_R4)) { + if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_21_R1)) { + return VERSION1_21; + } else if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_20_R4)) { return VERSION1_20_5; } else if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_20_R3)) { return VERSION1_20_4; diff --git a/wiki/Using-the-NBT-API.md b/wiki/Using-the-NBT-API.md index 3b996c15b..71d5ccb17 100644 --- a/wiki/Using-the-NBT-API.md +++ b/wiki/Using-the-NBT-API.md @@ -404,7 +404,7 @@ You can refer to [NBTHandlers](https://github.com/tr7zw/Item-NBT-API/blob/master ### Data fixer utils -``DataFixerUtil`` allows updating nbt from versions since 1.12.2 to more recent ones. +``DataFixerUtil`` allows updating nbt from older versions to more recent ones. For example, given the input from 1.12.2: