forked from Upstream/mmocore
Added message for the skill tree command.
This commit is contained in:
parent
e2ec78ff8d
commit
10ac569f44
@ -1,6 +1,7 @@
|
||||
package net.Indyuce.mmocore.command;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.ConfigMessage;
|
||||
import net.Indyuce.mmocore.api.player.PlayerData;
|
||||
import net.Indyuce.mmocore.api.event.MMOCommandEvent;
|
||||
import net.Indyuce.mmocore.manager.InventoryManager;
|
||||
@ -21,18 +22,22 @@ public class SkillTreeCommand extends BukkitCommand {
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull CommandSender sender, String s, String[] args) {
|
||||
if (!(sender instanceof Player))
|
||||
if (!(sender instanceof Player player))
|
||||
return false;
|
||||
PlayerData data = PlayerData.get((Player) sender);
|
||||
PlayerData data = PlayerData.get(player);
|
||||
MMOCommandEvent event = new MMOCommandEvent(data, "skilltree");
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
if (event.isCancelled())
|
||||
return true;
|
||||
if (MMOCore.plugin.skillTreeManager.getAll().size() != 0) {
|
||||
if (data.getProfess().getSkillTrees().size() != 0) {
|
||||
InventoryManager.TREE_VIEW.newInventory(data).open();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
else {
|
||||
MMOCore.plugin.configManager.getSimpleMessage("no-skill-tree").send(player);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -186,3 +186,4 @@ skill-node-max-level-hit: '&cYou already hit the max level for that skill node.'
|
||||
not-enough-skill-tree-points: '&cYou need one skill tree point.'
|
||||
reallocated-points: '&eYou successfully reset the skill tree {skill-tree}. &eYou now have &6{points} &eskill tree points.'
|
||||
not-skill-tree-reallocation-point: '&cYou do not have 1 skill tree reallocation point.'
|
||||
no-skill-tree: '&cYour class doesn''t have any skill tree.'
|
Loading…
Reference in New Issue
Block a user