实现了对权限列表的排序

This commit is contained in:
zhangyuheng 2024-05-31 20:47:50 +08:00
parent 6666fb6131
commit a34cc43cbf
2 changed files with 7 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>Dominion</artifactId>
<version>1.30.7-beta</version>
<version>1.30.8-beta</version>
<packaging>jar</packaging>
<name>Dominion</name>

View File

@ -6,8 +6,10 @@ import cn.lunadeer.minecraftpluginutils.XLogger;
import com.alibaba.fastjson.JSONObject;
import java.io.File;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
public enum Flag {
@ -125,6 +127,8 @@ public enum Flag {
}
flags.add(flag);
}
Comparator<Object> comparator = Collator.getInstance(java.util.Locale.CHINA);
flags.sort((o1, o2) -> comparator.compare(o1.getDisplayName(), o2.getDisplayName()));
return flags;
}
@ -144,6 +148,8 @@ public enum Flag {
}
flags.add(flag);
}
Comparator<Object> comparator = Collator.getInstance(java.util.Locale.CHINA);
flags.sort((o1, o2) -> comparator.compare(o1.getDisplayName(), o2.getDisplayName()));
return flags;
}