mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-26 00:35:17 +01:00
Fixed subclass confirmation
This commit is contained in:
parent
3904b9a8b7
commit
f9a4f65860
@ -264,8 +264,11 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<SkillTreeNode, Integer> getNodeLevels() {
|
@Override
|
||||||
return new HashMap<>(nodeLevels);
|
public Map<String, Integer> getNodeLevels() {
|
||||||
|
final Map<String, Integer> mapped = new HashMap<>();
|
||||||
|
this.nodeLevels.forEach((node, level) -> mapped.put(node.getFullId(), level));
|
||||||
|
return mapped;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearNodeLevels() {
|
public void clearNodeLevels() {
|
||||||
|
@ -7,7 +7,6 @@ import net.Indyuce.mmocore.api.player.PlayerData;
|
|||||||
import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
|
import net.Indyuce.mmocore.api.player.attribute.PlayerAttribute;
|
||||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
||||||
import net.Indyuce.mmocore.player.ClassDataContainer;
|
import net.Indyuce.mmocore.player.ClassDataContainer;
|
||||||
import net.Indyuce.mmocore.skill.ClassSkill;
|
|
||||||
import net.Indyuce.mmocore.skill.RegisteredSkill;
|
import net.Indyuce.mmocore.skill.RegisteredSkill;
|
||||||
import net.Indyuce.mmocore.skilltree.SkillTreeNode;
|
import net.Indyuce.mmocore.skilltree.SkillTreeNode;
|
||||||
import net.Indyuce.mmocore.skilltree.tree.SkillTree;
|
import net.Indyuce.mmocore.skilltree.tree.SkillTree;
|
||||||
@ -20,7 +19,7 @@ import java.util.Map;
|
|||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class SavedClassInformation {
|
public class SavedClassInformation implements ClassDataContainer {
|
||||||
private final int level, skillPoints, attributePoints, attributeReallocationPoints, skillTreeReallocationPoints, skillReallocationPoints;
|
private final int level, skillPoints, attributePoints, attributeReallocationPoints, skillTreeReallocationPoints, skillReallocationPoints;
|
||||||
private final double experience, health, mana, stellium, stamina;
|
private final double experience, health, mana, stellium, stamina;
|
||||||
private final Map<String, Integer> attributeLevels = new HashMap<>();
|
private final Map<String, Integer> attributeLevels = new HashMap<>();
|
||||||
@ -128,44 +127,53 @@ public class SavedClassInformation {
|
|||||||
data.mapAttributeLevels().forEach((key, val) -> this.attributeLevels.put(key, val));
|
data.mapAttributeLevels().forEach((key, val) -> this.attributeLevels.put(key, val));
|
||||||
data.mapSkillLevels().forEach((key, val) -> skillLevels.put(key, val));
|
data.mapSkillLevels().forEach((key, val) -> skillLevels.put(key, val));
|
||||||
data.mapSkillTreePoints().forEach((key, val) -> skillTreePoints.put(key, val));
|
data.mapSkillTreePoints().forEach((key, val) -> skillTreePoints.put(key, val));
|
||||||
data.getNodeLevels().forEach((node, level) -> nodeLevels.put(node.getFullId(), level));
|
data.getNodeLevels().forEach((node, level) -> nodeLevels.put(node, level));
|
||||||
data.getNodeTimesClaimed().forEach((key, val) -> nodeTimesClaimed.put(key, val));
|
data.getNodeTimesClaimed().forEach((key, val) -> nodeTimesClaimed.put(key, val));
|
||||||
data.mapBoundSkills().forEach((slot, skill) -> boundSkills.put(slot, skill));
|
data.mapBoundSkills().forEach((slot, skill) -> boundSkills.put(slot, skill));
|
||||||
data.getUnlockedItems().forEach(item->unlockedItems.add(item));
|
data.getUnlockedItems().forEach(item -> unlockedItems.add(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getExperience() {
|
public double getExperience() {
|
||||||
return experience;
|
return experience;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getSkillPoints() {
|
public int getSkillPoints() {
|
||||||
return skillPoints;
|
return skillPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getAttributePoints() {
|
public int getAttributePoints() {
|
||||||
return attributePoints;
|
return attributePoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getAttributeReallocationPoints() {
|
public int getAttributeReallocationPoints() {
|
||||||
return attributeReallocationPoints;
|
return attributeReallocationPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getHealth() {
|
public double getHealth() {
|
||||||
return health;
|
return health;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getMana() {
|
public double getMana() {
|
||||||
return mana;
|
return mana;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getStellium() {
|
public double getStellium() {
|
||||||
return stellium;
|
return stellium;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getStamina() {
|
public double getStamina() {
|
||||||
return stamina;
|
return stamina;
|
||||||
}
|
}
|
||||||
@ -186,14 +194,27 @@ public class SavedClassInformation {
|
|||||||
registerSkillLevel(skill.getHandler().getId(), level);
|
registerSkillLevel(skill.getHandler().getId(), level);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer, String> getBoundSkills() {
|
@Override
|
||||||
return boundSkills;
|
public Map<String, Integer> mapSkillLevels() {
|
||||||
|
return skillLevels;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> mapSkillTreePoints() {
|
||||||
|
return skillTreePoints;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public Map<Integer, String> getBoundSkills() {
|
||||||
|
return mapBoundSkills();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getSkillTreeReallocationPoints() {
|
public int getSkillTreeReallocationPoints() {
|
||||||
return skillTreeReallocationPoints;
|
return skillTreeReallocationPoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getSkillReallocationPoints() {
|
public int getSkillReallocationPoints() {
|
||||||
return skillReallocationPoints;
|
return skillReallocationPoints;
|
||||||
}
|
}
|
||||||
@ -210,6 +231,26 @@ public class SavedClassInformation {
|
|||||||
return nodeLevels.get(node);
|
return nodeLevels.get(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> mapAttributeLevels() {
|
||||||
|
return attributeLevels;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Integer, String> mapBoundSkills() {
|
||||||
|
return boundSkills;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> getNodeLevels() {
|
||||||
|
return nodeLevels;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> getNodeTimesClaimed() {
|
||||||
|
return nodeTimesClaimed;
|
||||||
|
}
|
||||||
|
|
||||||
public Set<String> getSkillTreePointsKeys() {
|
public Set<String> getSkillTreePointsKeys() {
|
||||||
return skillTreePoints.keySet();
|
return skillTreePoints.keySet();
|
||||||
}
|
}
|
||||||
@ -234,6 +275,7 @@ public class SavedClassInformation {
|
|||||||
attributeLevels.put(attribute, level);
|
attributeLevels.put(attribute, level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Set<String> getUnlockedItems() {
|
public Set<String> getUnlockedItems() {
|
||||||
return unlockedItems;
|
return unlockedItems;
|
||||||
}
|
}
|
||||||
|
@ -14,20 +14,20 @@ import net.Indyuce.mmocore.gui.api.PluginInventory;
|
|||||||
import net.Indyuce.mmocore.gui.api.item.InventoryItem;
|
import net.Indyuce.mmocore.gui.api.item.InventoryItem;
|
||||||
import net.Indyuce.mmocore.gui.api.item.Placeholders;
|
import net.Indyuce.mmocore.gui.api.item.Placeholders;
|
||||||
import net.Indyuce.mmocore.gui.api.item.SimplePlaceholderItem;
|
import net.Indyuce.mmocore.gui.api.item.SimplePlaceholderItem;
|
||||||
|
import net.Indyuce.mmocore.player.ClassDataContainer;
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class ClassConfirmation extends EditableInventory {
|
public class ClassConfirmation extends EditableInventory {
|
||||||
|
|
||||||
private final PlayerClass playerClass;
|
private final PlayerClass playerClass;
|
||||||
|
|
||||||
public ClassConfirmation(PlayerClass playerClass, boolean isDefault) {
|
public ClassConfirmation(PlayerClass playerClass, boolean isDefault) {
|
||||||
super("class-confirm-" + (isDefault ? "default" : UtilityMethods.ymlName(playerClass.getId())));
|
super("class-confirm-" + (isDefault ? "default" : UtilityMethods.ymlName(playerClass.getId())));
|
||||||
|
|
||||||
this.playerClass = playerClass;
|
this.playerClass = playerClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,13 +36,8 @@ public class ClassConfirmation extends EditableInventory {
|
|||||||
return function.equalsIgnoreCase("yes") ? new YesItem(config) : new SimplePlaceholderItem(config);
|
return function.equalsIgnoreCase("yes") ? new YesItem(config) : new SimplePlaceholderItem(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeneratedInventory newInventory(PlayerData data, PluginInventory last) {
|
public GeneratedInventory newInventory(PlayerData data, PluginInventory last, boolean subclass) {
|
||||||
return new ClassConfirmationInventory(data, this, playerClass, last);
|
return new ClassConfirmationInventory(data, this, playerClass, last, subclass);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void reload(FileConfiguration config) {
|
|
||||||
super.reload(config);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UnlockedItem extends InventoryItem<ClassConfirmationInventory> {
|
public class UnlockedItem extends InventoryItem<ClassConfirmationInventory> {
|
||||||
@ -53,7 +48,7 @@ public class ClassConfirmation extends EditableInventory {
|
|||||||
@Override
|
@Override
|
||||||
public Placeholders getPlaceholders(ClassConfirmationInventory inv, int n) {
|
public Placeholders getPlaceholders(ClassConfirmationInventory inv, int n) {
|
||||||
PlayerClass profess = inv.profess;
|
PlayerClass profess = inv.profess;
|
||||||
SavedClassInformation info = inv.getPlayerData().getClassInfo(profess);
|
ClassDataContainer info = inv.subclass ? inv.getPlayerData() : inv.getPlayerData().getClassInfo(profess);
|
||||||
Placeholders holders = new Placeholders();
|
Placeholders holders = new Placeholders();
|
||||||
|
|
||||||
final double nextLevelExp = inv.getPlayerData().getLevelUpExperience();
|
final double nextLevelExp = inv.getPlayerData().getLevelUpExperience();
|
||||||
@ -67,7 +62,7 @@ public class ClassConfirmation extends EditableInventory {
|
|||||||
holders.register("percent", decimal.format(ratio * 100));
|
holders.register("percent", decimal.format(ratio * 100));
|
||||||
holders.register("progress", bar.toString());
|
holders.register("progress", bar.toString());
|
||||||
holders.register("class", profess.getName());
|
holders.register("class", profess.getName());
|
||||||
holders.register("unlocked_skills", info.getSkillKeys().size());
|
holders.register("unlocked_skills", info.mapSkillLevels().size());
|
||||||
holders.register("class_skills", profess.getSkills().size());
|
holders.register("class_skills", profess.getSkills().size());
|
||||||
holders.register("next_level", "" + nextLevelExp);
|
holders.register("next_level", "" + nextLevelExp);
|
||||||
holders.register("level", info.getLevel());
|
holders.register("level", info.getLevel());
|
||||||
@ -108,12 +103,14 @@ public class ClassConfirmation extends EditableInventory {
|
|||||||
public class ClassConfirmationInventory extends GeneratedInventory {
|
public class ClassConfirmationInventory extends GeneratedInventory {
|
||||||
private final PlayerClass profess;
|
private final PlayerClass profess;
|
||||||
private final PluginInventory last;
|
private final PluginInventory last;
|
||||||
|
private final boolean subclass;
|
||||||
|
|
||||||
public ClassConfirmationInventory(PlayerData playerData, EditableInventory editable, PlayerClass profess, PluginInventory last) {
|
public ClassConfirmationInventory(PlayerData playerData, EditableInventory editable, PlayerClass profess, PluginInventory last, boolean subclass) {
|
||||||
super(playerData, editable);
|
super(playerData, editable);
|
||||||
|
|
||||||
this.profess = profess;
|
this.profess = profess;
|
||||||
this.last = last;
|
this.last = last;
|
||||||
|
this.subclass = subclass;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -129,6 +126,9 @@ public class ClassConfirmation extends EditableInventory {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
playerData.giveClassPoints(-1);
|
playerData.giveClassPoints(-1);
|
||||||
|
if (subclass)
|
||||||
|
playerData.setClass(profess);
|
||||||
|
else
|
||||||
(playerData.hasSavedClass(profess) ? playerData.getClassInfo(profess)
|
(playerData.hasSavedClass(profess) ? playerData.getClassInfo(profess)
|
||||||
: new SavedClassInformation(MMOCore.plugin.dataProvider.getDataManager().getDefaultData())).load(profess, playerData);
|
: new SavedClassInformation(MMOCore.plugin.dataProvider.getDataManager().getDefaultData())).load(profess, playerData);
|
||||||
MMOCore.plugin.configManager.getSimpleMessage("class-select", "class", profess.getName()).send(player);
|
MMOCore.plugin.configManager.getSimpleMessage("class-select", "class", profess.getName()).send(player);
|
||||||
|
@ -90,14 +90,9 @@ public class ClassSelect extends EditableInventory {
|
|||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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))
|
|
||||||
.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);
|
||||||
}
|
}
|
||||||
@ -131,7 +126,7 @@ public class ClassSelect extends EditableInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final PlayerClass playerClass = findDeepestSubclass(playerData, profess);
|
final PlayerClass playerClass = findDeepestSubclass(playerData, profess);
|
||||||
InventoryManager.CLASS_CONFIRM.get(MMOCoreUtils.ymlName(playerClass.getId())).newInventory(playerData, this).open();
|
InventoryManager.CLASS_CONFIRM.get(MMOCoreUtils.ymlName(playerClass.getId())).newInventory(playerData, this, false).open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,13 +96,8 @@ public class SubclassSelect extends EditableInventory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class SubclassSelectionInventory extends GeneratedInventory {
|
public class SubclassSelectionInventory extends GeneratedInventory {
|
||||||
private final List<Subclass> subclasses;
|
|
||||||
|
|
||||||
public SubclassSelectionInventory(PlayerData playerData, EditableInventory editable) {
|
public SubclassSelectionInventory(PlayerData playerData, EditableInventory editable) {
|
||||||
super(playerData, editable);
|
super(playerData, editable);
|
||||||
|
|
||||||
subclasses = playerData.getProfess().getSubclasses().stream().filter(sub -> playerData.getLevel() >= sub.getLevel())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -116,7 +111,7 @@ public class SubclassSelect extends EditableInventory {
|
|||||||
InventoryManager.CLASS_SELECT.newInventory(playerData).open();
|
InventoryManager.CLASS_SELECT.newInventory(playerData).open();
|
||||||
|
|
||||||
if (item.getFunction().startsWith("sub-class")) {
|
if (item.getFunction().startsWith("sub-class")) {
|
||||||
String classId= item.getFunction().substring(10);
|
String classId = item.getFunction().substring(10);
|
||||||
|
|
||||||
if (playerData.getClassPoints() < 1) {
|
if (playerData.getClassPoints() < 1) {
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
@ -124,7 +119,8 @@ public class SubclassSelect extends EditableInventory {
|
|||||||
new ConfigMessage("cant-choose-new-class").send(player);
|
new ConfigMessage("cant-choose-new-class").send(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
InventoryManager.CLASS_CONFIRM.get(classId).newInventory(playerData, this).open();
|
|
||||||
|
InventoryManager.CLASS_CONFIRM.get(classId).newInventory(playerData, this, true).open();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,26 +35,20 @@ public class InventoryManager {
|
|||||||
|
|
||||||
public static final List<EditableInventory> list = new ArrayList(Arrays.asList(PLAYER_STATS, ATTRIBUTE_VIEW, TREE_VIEW, SKILL_LIST, CLASS_SELECT, SUBCLASS_SELECT, QUEST_LIST, WAYPOINTS, FRIEND_LIST, FRIEND_REMOVAL, PARTY_VIEW, PARTY_CREATION, GUILD_VIEW, GUILD_CREATION));
|
public static final List<EditableInventory> list = new ArrayList(Arrays.asList(PLAYER_STATS, ATTRIBUTE_VIEW, TREE_VIEW, SKILL_LIST, CLASS_SELECT, SUBCLASS_SELECT, QUEST_LIST, WAYPOINTS, FRIEND_LIST, FRIEND_REMOVAL, PARTY_VIEW, PARTY_CREATION, GUILD_VIEW, GUILD_CREATION));
|
||||||
|
|
||||||
private static List<String> defaultClass = Arrays.asList(new String[]{"human", "mage", "paladin", "warrior", "rogue", "arcane-mage"});
|
|
||||||
|
|
||||||
public static void load() {
|
public static void load() {
|
||||||
String classConfirmFolder = "gui/class-confirm";
|
final String classConfirmFolder = "gui/class-confirm";
|
||||||
try {
|
try {
|
||||||
MMOCore.plugin.configManager.loadDefaultFile(classConfirmFolder, "class-confirm-default.yml");
|
MMOCore.plugin.configManager.loadDefaultFile(classConfirmFolder, "class-confirm-default.yml");
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
MMOCore.log(Level.WARNING, "Could not load inventory 'class-confirm/class-confirm-default" + "': " + exception.getMessage());
|
MMOCore.log(Level.WARNING, "Could not load inventory 'class-confirm/class-confirm-default" + "': " + exception.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (PlayerClass playerClass : MMOCore.plugin.classManager.getAll()) {
|
for (PlayerClass playerClass : MMOCore.plugin.classManager.getAll()) {
|
||||||
String classId = MMOCoreUtils.ymlName(playerClass.getId());
|
final String classId = MMOCoreUtils.ymlName(playerClass.getId());
|
||||||
ConfigFile configFile = new ConfigFile(classConfirmFolder, "class-confirm-" + classId);
|
final ConfigFile configFile = new ConfigFile(classConfirmFolder, "class-confirm-" + classId);
|
||||||
ClassConfirmation GUI;
|
final ClassConfirmation GUI = configFile.exists() ? new ClassConfirmation(playerClass, false) : new ClassConfirmation(playerClass, true);
|
||||||
if (configFile.exists())
|
|
||||||
GUI = new ClassConfirmation(playerClass, false);
|
|
||||||
else {
|
|
||||||
GUI = new ClassConfirmation(playerClass, true);
|
|
||||||
}
|
|
||||||
CLASS_CONFIRM.put(MMOCoreUtils.ymlName(playerClass.getId()), GUI);
|
CLASS_CONFIRM.put(MMOCoreUtils.ymlName(playerClass.getId()), GUI);
|
||||||
GUI.reload(new ConfigFile("/" +classConfirmFolder, GUI.getId()).getConfig());
|
GUI.reload(new ConfigFile("/" + classConfirmFolder, GUI.getId()).getConfig());
|
||||||
}
|
}
|
||||||
|
|
||||||
list.forEach(inv ->
|
list.forEach(inv ->
|
||||||
|
@ -115,8 +115,8 @@ public class MySQLPlayerDataManager extends PlayerDataManager {
|
|||||||
classinfo.add("skill-tree-points", skillTreePointsInfo);
|
classinfo.add("skill-tree-points", skillTreePointsInfo);
|
||||||
|
|
||||||
JsonObject boundSkillInfo = new JsonObject();
|
JsonObject boundSkillInfo = new JsonObject();
|
||||||
for (int slot : info.getBoundSkills().keySet())
|
for (int slot : info.mapBoundSkills().keySet())
|
||||||
boundSkillInfo.addProperty(slot + "", info.getBoundSkills().get(slot));
|
boundSkillInfo.addProperty(String.valueOf(slot), info.mapBoundSkills().get(slot));
|
||||||
classinfo.add("bound-skills", boundSkillInfo);
|
classinfo.add("bound-skills", boundSkillInfo);
|
||||||
|
|
||||||
json.add(c, classinfo);
|
json.add(c, classinfo);
|
||||||
|
@ -191,7 +191,7 @@ public class YAMLPlayerDataManager extends PlayerDataManager {
|
|||||||
info.getAttributeKeys().forEach(attribute -> config.set("class-info." + key + ".attribute." + attribute, info.getAttributeLevel(attribute)));
|
info.getAttributeKeys().forEach(attribute -> config.set("class-info." + key + ".attribute." + attribute, info.getAttributeLevel(attribute)));
|
||||||
info.getNodeKeys().forEach(node -> config.set("class-info." + key + ".node-levels." + node, info.getNodeLevel(node)));
|
info.getNodeKeys().forEach(node -> config.set("class-info." + key + ".node-levels." + node, info.getNodeLevel(node)));
|
||||||
info.getSkillTreePointsKeys().forEach(skillTreeId -> config.set("class-info." + key + ".skill-tree-points." + skillTreeId, info.getAttributeLevel(skillTreeId)));
|
info.getSkillTreePointsKeys().forEach(skillTreeId -> config.set("class-info." + key + ".skill-tree-points." + skillTreeId, info.getAttributeLevel(skillTreeId)));
|
||||||
info.getBoundSkills().forEach((slot, skill) -> config.set("class-info." + key + ".bound-skills." + slot, skill));
|
info.mapBoundSkills().forEach((slot, skill) -> config.set("class-info." + key + ".bound-skills." + slot, skill));
|
||||||
config.set("class-info." + key + ".unlocked-items", new ArrayList<>(info.getUnlockedItems()));
|
config.set("class-info." + key + ".unlocked-items", new ArrayList<>(info.getUnlockedItems()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package net.Indyuce.mmocore.player;
|
package net.Indyuce.mmocore.player;
|
||||||
|
|
||||||
import net.Indyuce.mmocore.api.player.profess.SavedClassInformation;
|
import net.Indyuce.mmocore.api.player.profess.SavedClassInformation;
|
||||||
import net.Indyuce.mmocore.skilltree.SkillTreeNode;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All the class-specific information i.e information being saved
|
* All the class-specific information i.e information being saved
|
||||||
* in {@link SavedClassInformation} when a player changes its current
|
* in {@link SavedClassInformation} when a player changes its current class.
|
||||||
* class.
|
*
|
||||||
|
* TODO move {@link SavedClassInformation} method to ClassDataContainer
|
||||||
*/
|
*/
|
||||||
public interface ClassDataContainer {
|
public interface ClassDataContainer {
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ public interface ClassDataContainer {
|
|||||||
|
|
||||||
Map<Integer,String> mapBoundSkills();
|
Map<Integer,String> mapBoundSkills();
|
||||||
|
|
||||||
Map<SkillTreeNode, Integer> getNodeLevels();
|
Map<String, Integer> getNodeLevels();
|
||||||
|
|
||||||
Map<String, Integer> getNodeTimesClaimed();
|
Map<String, Integer> getNodeTimesClaimed();
|
||||||
|
|
||||||
|
@ -110,7 +110,7 @@ public class DefaultPlayerData implements ClassDataContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<SkillTreeNode, Integer> getNodeLevels() {
|
public Map<String, Integer> getNodeLevels() {
|
||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,11 +200,10 @@ death-exp-loss:
|
|||||||
# Maximum number of skill slots. This means that you cannot unlock more than X skill slots.
|
# Maximum number of skill slots. This means that you cannot unlock more than X skill slots.
|
||||||
max-skill-slots: 8
|
max-skill-slots: 8
|
||||||
|
|
||||||
#If you want players to bound their passive skills.
|
# When set to true, passive skills must be bound in order to take effect.
|
||||||
#If false, all the passive skills unlocked will be active
|
# When set to false, unlocked skills will take effect right away.
|
||||||
#Also set max-bound-passive-skills to 0 if seting passive-skill-need-bound to false.
|
# Temporarily disabled.
|
||||||
passive-skill-need-bound: true
|
# passive-skill-need-bound: true
|
||||||
|
|
||||||
|
|
||||||
# Fun extra RPG feature that switches the player's hotbar with
|
# Fun extra RPG feature that switches the player's hotbar with
|
||||||
# the 9 lower row items of his inventory. This allows the player
|
# the 9 lower row items of his inventory. This allows the player
|
||||||
|
@ -39,12 +39,16 @@ max-level: 100
|
|||||||
skill-slots:
|
skill-slots:
|
||||||
1:
|
1:
|
||||||
name: "Skill Slot I"
|
name: "Skill Slot I"
|
||||||
|
unlocked-by-default: true
|
||||||
2:
|
2:
|
||||||
name: "Skill Slot II"
|
name: "Skill Slot II"
|
||||||
|
unlocked-by-default: true
|
||||||
3:
|
3:
|
||||||
name: "Skill Slot III"
|
name: "Skill Slot III"
|
||||||
|
unlocked-by-default: true
|
||||||
4:
|
4:
|
||||||
name: "Skill Slot IV"
|
name: "Skill Slot IV"
|
||||||
|
unlocked-by-default: true
|
||||||
|
|
||||||
skill-trees:
|
skill-trees:
|
||||||
- 'general'
|
- 'general'
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
name: Ambers
|
name: Mana Ambers
|
||||||
lore:
|
lore:
|
||||||
- Dealing magic damage has &630% &7chance
|
- Dealing magic damage has &630% &7chance
|
||||||
- of dropping an amber on the ground.
|
- of dropping an amber on the ground.
|
||||||
- ''
|
- ''
|
||||||
- When picked up, ambers stack and
|
- When picked up, ambers refund &9{percent}% &7of your missing mana.
|
||||||
- refund &9{percent}% &7of your missing mana.
|
|
||||||
- ''
|
|
||||||
- '&oAmbers can be used in other damaging skills.'
|
|
||||||
- '&oThe more you collect, the more powerful the skills.'
|
|
||||||
- ''
|
- ''
|
||||||
- '&e{cooldown}s Cooldown'
|
- '&e{cooldown}s Cooldown'
|
||||||
material: EMERALD
|
material: EMERALD
|
||||||
|
Loading…
Reference in New Issue
Block a user