11package world .bentobox .level .panels ;
22
33import 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 .*;
125import java .util .stream .Collectors ;
136
147import org .bukkit .Material ;
@@ -263,6 +256,7 @@ private void updateFilters() {
263256 }
264257 // Sort and filter
265258 Comparator <BlockRec > sorter ;
259+ System .out .println ("activeFilter: " + activeFilter );
266260
267261 switch (this .activeFilter ) {
268262 case COUNT -> {
@@ -285,17 +279,26 @@ private void updateFilters() {
285279 blockLimit = Objects .requireNonNullElse (this .addon .getBlockConfig ().getLimit (o2 .key ()), 0 );
286280 int o2Count = blockLimit > 0 ? Math .min (o2 .value (), blockLimit ) : o2 .value ();
287281
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+
288286 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 );
290288 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 );
292293
293294 if (o1Value == o2Value ) {
295+ System .out .println ("has same value" );
294296 String o1Name = Utils .prettifyObject (o1 .key (), this .user );
295297 String o2Name = Utils .prettifyObject (o2 .key (), this .user );
296298
297299 return String .CASE_INSENSITIVE_ORDER .compare (o1Name , o2Name );
298300 } else {
301+ System .out .println ("compare long" );
299302 return Long .compare (o2Value , o1Value );
300303 }
301304 };
0 commit comments