mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
alphabetically order enchantments
This commit is contained in:
parent
1e3bde650c
commit
cfa029e2ca
1 changed files with 5 additions and 4 deletions
|
|
@ -16,9 +16,7 @@ import xyz.alexcrea.cuanvil.gui.config.settings.IntSettingsGui;
|
||||||
import xyz.alexcrea.cuanvil.gui.util.GuiGlobalItems;
|
import xyz.alexcrea.cuanvil.gui.util.GuiGlobalItems;
|
||||||
import xyz.alexcrea.cuanvil.util.StringUtil;
|
import xyz.alexcrea.cuanvil.util.StringUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
public class EnchantLimitConfigGui extends ValueUpdatableGui {
|
public class EnchantLimitConfigGui extends ValueUpdatableGui {
|
||||||
|
|
||||||
|
|
@ -70,7 +68,10 @@ public class EnchantLimitConfigGui extends ValueUpdatableGui {
|
||||||
protected void prepareValues(){
|
protected void prepareValues(){
|
||||||
bookItemFactoryList = new ArrayList<>();
|
bookItemFactoryList = new ArrayList<>();
|
||||||
|
|
||||||
for (Enchantment enchant : Enchantment.values()) {
|
List<Enchantment> enchantments = Arrays.asList(Enchantment.values());
|
||||||
|
enchantments.sort(Comparator.comparing(ench -> ench.getKey().getKey()));
|
||||||
|
|
||||||
|
for (Enchantment enchant : enchantments) {
|
||||||
String key = enchant.getKey().getKey().toLowerCase(Locale.ROOT);
|
String key = enchant.getKey().getKey().toLowerCase(Locale.ROOT);
|
||||||
String prettyKey = StringUtil.snakeToUpperSpacedCase(key);
|
String prettyKey = StringUtil.snakeToUpperSpacedCase(key);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue