Skip to content

Commit

Permalink
Add 1.21.2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Oct 22, 2024
1 parent 243a5c2 commit e3142b4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public class DataFixerUtil {
public static final int VERSION1_20_4 = 3700;
public static final int VERSION1_20_5 = 3837;
public static final int VERSION1_21 = 3953;
public static final int VERSION1_21_2 = 4080;

@SuppressWarnings("unchecked")
public static Object fixUpRawItemData(Object nbt, int fromVersion, int toVersion)
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_20_R4(1204, true), MC1_21_R1(1211, true), MC1_21_R2(1212, true);

private static MinecraftVersion version;
private static Boolean hasGsonSupport;
Expand Down Expand Up @@ -57,6 +57,7 @@ public enum MinecraftVersion {
this.put("1.20.6", MC1_20_R4);
this.put("1.21", MC1_21_R1);
this.put("1.21.1", MC1_21_R1);
this.put("1.21.2", MC1_21_R2);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,26 @@ public class MojangToMapping {
}

};

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

{
putAll(MC1_21R1);

put("net.minecraft.server.MinecraftServer#registryAccess()", "ba");
put("net.minecraft.world.entity.Entity#getEncodeId()", "bK");
put("net.minecraft.world.level.block.entity.BlockEntity#getBlockState()", "m");
}

};



public static Map<String, String> getMapping() {
switch (MinecraftVersion.getVersion()) {
case MC1_21_R2:
return MC1_21R2;
case MC1_21_R1:
return MC1_21R1;
case MC1_20_R4:
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.txt");
File input = new File("minecraft_server.1.21.2.txt");
List<String> lines = Files.readAllLines(input.toPath());

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

0 comments on commit e3142b4

Please sign in to comment.