mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
temporarily revert OldEnum toString changes (#11829)
This commit is contained in:
parent
c9a904ed17
commit
a8f850a128
1 changed files with 6 additions and 2 deletions
|
@ -9,7 +9,7 @@ import org.bukkit.util.OldEnum;
|
||||||
import org.jspecify.annotations.NullMarked;
|
import org.jspecify.annotations.NullMarked;
|
||||||
import org.jspecify.annotations.Nullable;
|
import org.jspecify.annotations.Nullable;
|
||||||
|
|
||||||
@SuppressWarnings("removal")
|
@SuppressWarnings({"removal", "DeprecatedIsStillUsed"})
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@NullMarked
|
@NullMarked
|
||||||
public abstract class OldEnumHolderable<A extends OldEnum<A>, M> implements Holderable<M>, OldEnum<A>, Keyed {
|
public abstract class OldEnumHolderable<A extends OldEnum<A>, M> implements Holderable<M>, OldEnum<A>, Keyed {
|
||||||
|
@ -43,7 +43,7 @@ public abstract class OldEnumHolderable<A extends OldEnum<A>, M> implements Hold
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public int compareTo(A other) {
|
public int compareTo(final A other) {
|
||||||
this.checkIsReference();
|
this.checkIsReference();
|
||||||
return this.ordinal - other.ordinal();
|
return this.ordinal - other.ordinal();
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,10 @@ public abstract class OldEnumHolderable<A extends OldEnum<A>, M> implements Hold
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
if (this.name != null) {
|
||||||
|
// TODO remove in next feature release or 1.22
|
||||||
|
return this.name;
|
||||||
|
}
|
||||||
return this.implToString();
|
return this.implToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue