mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-07 07:32:03 -07:00
Fix unstable Suggestion comparison by sorting int suggestions before text ones (#11941)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
--- a/com/mojang/brigadier/suggestion/IntegerSuggestion.java
|
||||
+++ b/com/mojang/brigadier/suggestion/IntegerSuggestion.java
|
||||
@@ -53,7 +_,7 @@
|
||||
|
||||
@Override
|
||||
public int compareTo(final Suggestion o) {
|
||||
- if (o instanceof IntegerSuggestion) {
|
||||
+ if (false && o instanceof IntegerSuggestion) { // Paper - fix unstable Suggestion comparison
|
||||
return Integer.compare(value, ((IntegerSuggestion) o).value);
|
||||
}
|
||||
return super.compareTo(o);
|
||||
@@ -61,6 +_,6 @@
|
||||
|
||||
@Override
|
||||
public int compareToIgnoreCase(final Suggestion b) {
|
||||
- return compareTo(b);
|
||||
+ return super.compareToIgnoreCase(b); // Paper - fix unstable Suggestion comparison
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user