Skip to content

Commit

Permalink
Updated outdated ProtocolVersion renames
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Dec 8, 2023
1 parent 26dc4e4 commit 2b6bc8a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,13 @@ public abstract class MixinProtocolVersion {
private static void initMaps(CallbackInfo ci) {
viaFabricPlus$skips = ImmutableSet.of("1.4.6/7", "1.5.1", "1.5.2", "1.6.1", "1.6.2", "1.6.3", "1.6.4");
viaFabricPlus$remaps = new HashMap<>();
viaFabricPlus$remaps.put("1.7-1.7.5", new Pair<>("1.7.2-1.7.5", new VersionRange("1.7", 2, 5)));
viaFabricPlus$remaps.put("1.9.3/4", new Pair<>("1.9.3-1.9.4", null));
viaFabricPlus$remaps.put("1.11.1/2", new Pair<>("1.11.1-1.11.2", null));
viaFabricPlus$remaps.put("1.16.4/5", new Pair<>("1.16.4-1.16.5", null));
viaFabricPlus$remaps.put("1.18/1.18.1", new Pair<>("1.18-1.18.1", null));
viaFabricPlus$remaps.put("1.19.1/2", new Pair<>("1.19.1-1.19.2", null));
viaFabricPlus$remaps.put("1.20/1.20.1", new Pair<>("1.20-1.20.1", null));
viaFabricPlus$remaps.put("1.20.3", new Pair<>("1.20.3-1.20.4", null));
viaFabricPlus$remaps.put("1.20.3", new Pair<>("1.20.3-1.20.4", new VersionRange("1.20", 3, 4)));
}

@Redirect(method = "<clinit>", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/version/ProtocolVersion;register(ILjava/lang/String;)Lcom/viaversion/viaversion/api/protocol/version/ProtocolVersion;"))
Expand All @@ -63,6 +62,9 @@ private static ProtocolVersion unregisterAndRenameVersions(int version, String n
final Pair<String, VersionRange> remapEntry = viaFabricPlus$remaps.get(name);
if (remapEntry != null) {
if (remapEntry.key() != null) name = remapEntry.key();
if (remapEntry.value() != null) {
return ProtocolVersion.register(version, name, remapEntry.value());
}
}

return ProtocolVersion.register(version, name);
Expand All @@ -75,6 +77,9 @@ private static ProtocolVersion unregisterAndRenameVersions(int version, int snap
final Pair<String, VersionRange> remapEntry = viaFabricPlus$remaps.get(name);
if (remapEntry != null) {
if (remapEntry.key() != null) name = remapEntry.key();
if (remapEntry.value() != null) {
return ProtocolVersion.register(version, snapshotVersion, name, remapEntry.value());
}
}

return ProtocolVersion.register(version, snapshotVersion, name);
Expand Down

0 comments on commit 2b6bc8a

Please sign in to comment.