Skip to content

Commit

Permalink
Add 1.21.4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Dec 3, 2024
1 parent b339c9e commit d2de90e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class DataFixerUtil {
public static final int VERSION1_20_5 = 3837;
public static final int VERSION1_21 = 3953;
public static final int VERSION1_21_2 = 4080;
public static final int VERSION1_21_3 = 4189;

@SuppressWarnings("unchecked")
public static Object fixUpRawItemData(Object nbt, int fromVersion, int toVersion)
Expand Down Expand Up @@ -63,7 +64,9 @@ public static ReadWriteNBT fixUpItemData(ReadWriteNBT nbt, int fromVersion, int
* @return
*/
public static int getCurrentVersion() {
if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_21_R2)) {
if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_21_R3)) {
return VERSION1_21_3;
} else if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_21_R2)) {
return VERSION1_21_2;
} else if (MinecraftVersion.isAtLeastVersion(MinecraftVersion.MC1_21_R1)) {
return VERSION1_21;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public enum MinecraftVersion {
MC1_13_R1(1131), MC1_13_R2(1132), MC1_14_R1(1141), MC1_15_R1(1151), MC1_16_R1(1161), MC1_16_R2(1162),
MC1_16_R3(1163), MC1_17_R1(1171), MC1_18_R1(1181, true), MC1_18_R2(1182, true), MC1_19_R1(1191, true),
MC1_19_R2(1192, true), MC1_19_R3(1193, true), MC1_20_R1(1201, true), MC1_20_R2(1202, true), MC1_20_R3(1203, true),
MC1_20_R4(1204, true), MC1_21_R1(1211, true), MC1_21_R2(1212, true);
MC1_20_R4(1204, true), MC1_21_R1(1211, true), MC1_21_R2(1212, true), MC1_21_R3(1213, true);

private static MinecraftVersion version;
private static Boolean hasGsonSupport;
Expand Down Expand Up @@ -59,6 +59,7 @@ public enum MinecraftVersion {
this.put("1.21.1", MC1_21_R1);
this.put("1.21.2", MC1_21_R2);
this.put("1.21.3", MC1_21_R2);
this.put("1.21.4", MC1_21_R3);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,21 @@ public class MojangToMapping {

};

@SuppressWarnings("serial")
private static Map<String, String> MC1_21R3 = new HashMap<String, String>() {

{
putAll(MC1_21R2);

put("net.minecraft.world.item.component.CustomData#copyTag()", "d");
}

};

public static Map<String, String> getMapping() {
switch (MinecraftVersion.getVersion()) {
case MC1_21_R3:
return MC1_21R3;
case MC1_21_R2:
return MC1_21R2;
case MC1_21_R1:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class MappingsParser {
public static StringBuilder builder = new StringBuilder();

public static void main(String[] args) throws IOException {
File input = new File("minecraft_server.1.21.2.txt");
File input = new File("minecraft_server.1.21.4.txt");
List<String> lines = Files.readAllLines(input.toPath());

Map<String, ClassWrapper> classes = new HashMap<>();
Expand Down

0 comments on commit d2de90e

Please sign in to comment.