mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2025-02-13 13:11:23 +01:00
Added 'display-order' to classes
This commit is contained in:
parent
b47e1eb334
commit
3ca8ad817e
@ -38,7 +38,7 @@ public class PlayerClass {
|
|||||||
private final ItemStack icon;
|
private final ItemStack icon;
|
||||||
private final Map<ClassOption, Boolean> options = new HashMap<>();
|
private final Map<ClassOption, Boolean> options = new HashMap<>();
|
||||||
private final ManaDisplayOptions manaDisplay;
|
private final ManaDisplayOptions manaDisplay;
|
||||||
private final int maxLevel;
|
private final int maxLevel, displayOrder;
|
||||||
|
|
||||||
private final Map<StatType, LinearValue> stats = new HashMap<>();
|
private final Map<StatType, LinearValue> stats = new HashMap<>();
|
||||||
private final Map<String, SkillInfo> skills = new LinkedHashMap<>();
|
private final Map<String, SkillInfo> skills = new LinkedHashMap<>();
|
||||||
@ -66,6 +66,7 @@ public class PlayerClass {
|
|||||||
attrDescription.add(ChatColor.GRAY + ChatColor.translateAlternateColorCodes('&', string));
|
attrDescription.add(ChatColor.GRAY + ChatColor.translateAlternateColorCodes('&', string));
|
||||||
manaDisplay = new ManaDisplayOptions(config.getConfigurationSection("mana"));
|
manaDisplay = new ManaDisplayOptions(config.getConfigurationSection("mana"));
|
||||||
maxLevel = config.getInt("max-level");
|
maxLevel = config.getInt("max-level");
|
||||||
|
displayOrder = config.getInt("display-order");
|
||||||
|
|
||||||
if (config.contains("attributes"))
|
if (config.contains("attributes"))
|
||||||
for (String key : config.getConfigurationSection("attributes").getKeys(false))
|
for (String key : config.getConfigurationSection("attributes").getKeys(false))
|
||||||
@ -135,6 +136,7 @@ public class PlayerClass {
|
|||||||
this.fileName = id;
|
this.fileName = id;
|
||||||
manaDisplay = new ManaDisplayOptions(ChatColor.BLUE, "Mana", AltChar.listSquare.charAt(0));
|
manaDisplay = new ManaDisplayOptions(ChatColor.BLUE, "Mana", AltChar.listSquare.charAt(0));
|
||||||
maxLevel = 0;
|
maxLevel = 0;
|
||||||
|
displayOrder = 0;
|
||||||
|
|
||||||
this.icon = new ItemStack(material);
|
this.icon = new ItemStack(material);
|
||||||
setOption(ClassOption.DISPLAY, false);
|
setOption(ClassOption.DISPLAY, false);
|
||||||
@ -171,6 +173,10 @@ public class PlayerClass {
|
|||||||
return maxLevel;
|
return maxLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getDisplayOrder() {
|
||||||
|
return displayOrder;
|
||||||
|
}
|
||||||
|
|
||||||
public String getFileName() {
|
public String getFileName() {
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package net.Indyuce.mmocore.gui;
|
package net.Indyuce.mmocore.gui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -96,7 +97,7 @@ public class ClassSelect extends EditableInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class ProfessSelectionInventory extends GeneratedInventory {
|
public class ProfessSelectionInventory extends GeneratedInventory {
|
||||||
private final List<PlayerClass> classes = MMOCore.plugin.classManager.getAll().stream().filter(c -> c.hasOption(ClassOption.DISPLAY)).collect(Collectors.toList());
|
private final List<PlayerClass> classes = MMOCore.plugin.classManager.getAll().stream().filter(c -> c.hasOption(ClassOption.DISPLAY)).sorted(Comparator.comparingInt(PlayerClass::getDisplayOrder)).collect(Collectors.toList());
|
||||||
|
|
||||||
public ProfessSelectionInventory(PlayerData playerData, EditableInventory editable) {
|
public ProfessSelectionInventory(PlayerData playerData, EditableInventory editable) {
|
||||||
super(playerData, editable);
|
super(playerData, editable);
|
||||||
|
Loading…
Reference in New Issue
Block a user