From b7a83e3e0fd9b91fd09bee4672f4aa4b89d7b327 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Thu, 15 Feb 2024 18:31:44 +0100 Subject: [PATCH] Tidy up LegacyProtocolVersion --- .../vialegacy/api/LegacyProtocolVersion.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/main/java/net/raphimc/vialegacy/api/LegacyProtocolVersion.java b/src/main/java/net/raphimc/vialegacy/api/LegacyProtocolVersion.java index 9fbcebd..17dead3 100644 --- a/src/main/java/net/raphimc/vialegacy/api/LegacyProtocolVersion.java +++ b/src/main/java/net/raphimc/vialegacy/api/LegacyProtocolVersion.java @@ -20,9 +20,9 @@ package net.raphimc.vialegacy.api; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.api.protocol.version.SubVersionRange; import com.viaversion.viaversion.api.protocol.version.VersionType; +import com.viaversion.viaversion.protocol.RedirectProtocolVersion; import java.util.ArrayList; -import java.util.Comparator; import java.util.List; import static com.viaversion.viaversion.api.protocol.version.VersionType.*; @@ -68,20 +68,7 @@ public class LegacyProtocolVersion { public static final ProtocolVersion r1_6_2 = registerLegacy(RELEASE_INITIAL, 74, "1.6.2"); public static final ProtocolVersion r1_6_4 = registerLegacy(RELEASE_INITIAL, 78, "1.6.4"); - public static final ProtocolVersion c0_30cpe = new ProtocolVersion(SPECIAL, 7, -1, "c0.30 CPE", null) { - @Override - protected Comparator customComparator() { - return (o1, o2) -> { - if (o1 == c0_30cpe) { - o1 = c0_28toc0_30; - } - if (o2 == c0_30cpe) { - o2 = c0_28toc0_30; - } - return o1.compareTo(o2); - }; - } - }; + public static final ProtocolVersion c0_30cpe = new RedirectProtocolVersion(7, "c0.30 CPE", c0_28toc0_30); static { ProtocolVersion.register(c0_30cpe);