forked from Upstream/mmocore
added a placeholder in the no-mana message
This commit is contained in:
parent
622455268a
commit
e9b417f191
@ -19,15 +19,15 @@ import net.Indyuce.mmocore.api.player.social.guilds.Guild;
|
||||
import net.Indyuce.mmocore.api.player.stats.PlayerStats;
|
||||
import net.Indyuce.mmocore.api.player.stats.StatType;
|
||||
import net.Indyuce.mmocore.api.quest.PlayerQuests;
|
||||
import net.Indyuce.mmocore.api.skill.PlayerSkillData;
|
||||
import net.Indyuce.mmocore.api.skill.Skill;
|
||||
import net.Indyuce.mmocore.api.skill.Skill.SkillInfo;
|
||||
import net.Indyuce.mmocore.api.skill.SkillResult;
|
||||
import net.Indyuce.mmocore.api.skill.SkillResult.CancelReason;
|
||||
import net.Indyuce.mmocore.api.util.MMOCoreUtils;
|
||||
import net.Indyuce.mmocore.api.util.math.particle.SmallParticleEffect;
|
||||
import net.Indyuce.mmocore.listener.SpellCast.SkillCasting;
|
||||
import net.Indyuce.mmocore.manager.SoundManager;
|
||||
import net.Indyuce.mmocore.skill.PlayerSkillData;
|
||||
import net.Indyuce.mmocore.skill.Skill;
|
||||
import net.Indyuce.mmocore.skill.Skill.SkillInfo;
|
||||
import net.Indyuce.mmocore.skill.metadata.SkillMetadata;
|
||||
import net.Indyuce.mmocore.skill.metadata.SkillMetadata.CancelReason;
|
||||
import net.md_5.bungee.api.ChatMessageType;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.*;
|
||||
@ -807,19 +807,19 @@ public class PlayerData extends OfflinePlayerData {
|
||||
combat = new CombatRunnable(this);
|
||||
}
|
||||
|
||||
public SkillResult cast(Skill skill) {
|
||||
public SkillMetadata cast(Skill skill) {
|
||||
return cast(getProfess().getSkill(skill));
|
||||
}
|
||||
|
||||
public SkillResult cast(SkillInfo skill) {
|
||||
public SkillMetadata cast(SkillInfo skill) {
|
||||
|
||||
PlayerPreCastSkillEvent preEvent = new PlayerPreCastSkillEvent(this, skill);
|
||||
Bukkit.getPluginManager().callEvent(preEvent);
|
||||
if (preEvent.isCancelled())
|
||||
return new SkillResult(this, skill, CancelReason.OTHER);
|
||||
return new SkillMetadata(this, skill, CancelReason.OTHER);
|
||||
|
||||
// Check for mana/stamina/cooldown and cast skill
|
||||
SkillResult cast = skill.getSkill().whenCast(this, skill);
|
||||
SkillMetadata cast = skill.getSkill().whenCast(this, skill);
|
||||
|
||||
// Send failure messages
|
||||
if (!cast.isSuccessful()) {
|
||||
@ -828,7 +828,7 @@ public class PlayerData extends OfflinePlayerData {
|
||||
MMOCore.plugin.configManager.getSimpleMessage("not-unlocked-skill").send(getPlayer());
|
||||
|
||||
if (cast.getCancelReason() == CancelReason.MANA)
|
||||
MMOCore.plugin.configManager.getSimpleMessage("casting.no-mana").send(getPlayer());
|
||||
MMOCore.plugin.configManager.getSimpleMessage("casting.no-mana", "mana", getProfess().getManaDisplay().getName()).send(getPlayer());
|
||||
|
||||
if (cast.getCancelReason() == CancelReason.STAMINA)
|
||||
MMOCore.plugin.configManager.getSimpleMessage("casting.no-stamina").send(getPlayer());
|
||||
|
@ -56,7 +56,7 @@ casting:
|
||||
no-mana: '&6[{index}] &9&l{skill}'
|
||||
split: '&7 &7 - &7 '
|
||||
no-longer: '%&cYou cancelled skill casting.'
|
||||
no-mana: '&cYou do not have enough mana!'
|
||||
no-mana: '&cYou do not have enough {mana}!'
|
||||
no-stamina: '&cYou do not have enough stamina!'
|
||||
on-cooldown: '&cThis skill is on cooldown.'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user