From a8f850a128307bef089738b6b4f37f17f4b87960 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 26 Dec 2024 10:11:18 -0800 Subject: [PATCH] temporarily revert OldEnum toString changes (#11829) --- .../java/io/papermc/paper/util/OldEnumHolderable.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/io/papermc/paper/util/OldEnumHolderable.java b/paper-server/src/main/java/io/papermc/paper/util/OldEnumHolderable.java index 1e70146847..0c4ddd9ea9 100644 --- a/paper-server/src/main/java/io/papermc/paper/util/OldEnumHolderable.java +++ b/paper-server/src/main/java/io/papermc/paper/util/OldEnumHolderable.java @@ -9,7 +9,7 @@ import org.bukkit.util.OldEnum; import org.jspecify.annotations.NullMarked; import org.jspecify.annotations.Nullable; -@SuppressWarnings("removal") +@SuppressWarnings({"removal", "DeprecatedIsStillUsed"}) @Deprecated @NullMarked public abstract class OldEnumHolderable, M> implements Holderable, OldEnum, Keyed { @@ -43,7 +43,7 @@ public abstract class OldEnumHolderable, M> implements Hold @Override @Deprecated - public int compareTo(A other) { + public int compareTo(final A other) { this.checkIsReference(); return this.ordinal - other.ordinal(); } @@ -83,6 +83,10 @@ public abstract class OldEnumHolderable, M> implements Hold @Override public String toString() { + if (this.name != null) { + // TODO remove in next feature release or 1.22 + return this.name; + } return this.implToString(); } }