1
1
package world .bentobox .level .panels ;
2
2
3
3
import java .io .File ;
4
- import java .util .ArrayList ;
5
- import java .util .Comparator ;
6
- import java .util .EnumMap ;
7
- import java .util .HashMap ;
8
- import java .util .List ;
9
- import java .util .Map ;
10
- import java .util .Objects ;
11
- import java .util .Optional ;
4
+ import java .util .*;
12
5
import java .util .stream .Collectors ;
13
6
14
7
import org .bukkit .Material ;
@@ -263,6 +256,7 @@ private void updateFilters() {
263
256
}
264
257
// Sort and filter
265
258
Comparator <BlockRec > sorter ;
259
+ System .out .println ("activeFilter: " + activeFilter );
266
260
267
261
switch (this .activeFilter ) {
268
262
case COUNT -> {
@@ -285,17 +279,26 @@ private void updateFilters() {
285
279
blockLimit = Objects .requireNonNullElse (this .addon .getBlockConfig ().getLimit (o2 .key ()), 0 );
286
280
int o2Count = blockLimit > 0 ? Math .min (o2 .value (), blockLimit ) : o2 .value ();
287
281
282
+ System .out .println ("o1.key(): " + o1 .key ());
283
+ System .out .println ("o1.key() class: " + o1 .key ().getClass ());
284
+ System .out .println ("o2.key(): " + o2 .key ());
285
+
288
286
long o1Value = (long ) o1Count
289
- * this .addon .getBlockConfig ().getBlockValues ().getOrDefault (o1 .key (), 0 );
287
+ * this .addon .getBlockConfig ().getBlockValues ().getOrDefault (o1 .key (). toString (). toLowerCase ( Locale . ENGLISH ) , 0 );
290
288
long o2Value = (long ) o2Count
291
- * this .addon .getBlockConfig ().getBlockValues ().getOrDefault (o2 .key (), 0 );
289
+ * this .addon .getBlockConfig ().getBlockValues ().getOrDefault (o2 .key ().toString ().toLowerCase (Locale .ENGLISH ), 0 );
290
+
291
+ System .out .println ("o1Value: " + o1Value );
292
+ System .out .println ("o2Value: " + o2Value );
292
293
293
294
if (o1Value == o2Value ) {
295
+ System .out .println ("has same value" );
294
296
String o1Name = Utils .prettifyObject (o1 .key (), this .user );
295
297
String o2Name = Utils .prettifyObject (o2 .key (), this .user );
296
298
297
299
return String .CASE_INSENSITIVE_ORDER .compare (o1Name , o2Name );
298
300
} else {
301
+ System .out .println ("compare long" );
299
302
return Long .compare (o2Value , o1Value );
300
303
}
301
304
};
0 commit comments