From 74718bea9280232c3beda75b1d1a403e4175fe16 Mon Sep 17 00:00:00 2001 From: Anselm Brehme Date: Mon, 1 May 2023 10:19:06 +0200 Subject: [PATCH] Revert "moved compare to implementation" This reverts commit baf68a6298ffd43920ab4ae68d56c93d0871614b. --- src/main/java/org/spongepowered/api/MinecraftVersion.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/org/spongepowered/api/MinecraftVersion.java b/src/main/java/org/spongepowered/api/MinecraftVersion.java index d38959a6f1..022fb0962a 100644 --- a/src/main/java/org/spongepowered/api/MinecraftVersion.java +++ b/src/main/java/org/spongepowered/api/MinecraftVersion.java @@ -73,4 +73,12 @@ public interface MinecraftVersion extends Comparable { */ OptionalInt dataVersion(); + @Override + default int compareTo(MinecraftVersion o) { + final int result = Boolean.compare(this.isLegacy(), o.isLegacy()); + if (result != 0) { + return result; + } + return this.protocolVersion() - o.protocolVersion(); + } }