diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index 089ce5ff..fb5c562d 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -1009,6 +1009,7 @@ public class PlayerData extends SynchronizedDataHolder implements OfflinePlayerD Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()){ + skillCasting.close(); return; } this.skillCasting = skillCasting; diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/KeyCombos.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/KeyCombos.java index 9fe2c397..b6de6f7f 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/KeyCombos.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/KeyCombos.java @@ -96,6 +96,9 @@ public class KeyCombos implements SkillCastingListener { if (comboMap.isComboStart(event.getPressed())) { casting = new CustomSkillCastingInstance(playerData); playerData.setSkillCasting(casting); + if (!playerData.isCasting()){ + return; + } if (beginComboSound != null) beginComboSound.playTo(player); } } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/SkillBar.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/SkillBar.java index ca459b64..f4e5873a 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/SkillBar.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/SkillBar.java @@ -57,6 +57,9 @@ public class SkillBar implements SkillCastingListener { final PlayerData playerData = event.getData(); if (player.getGameMode() != GameMode.SPECTATOR && (MMOCore.plugin.configManager.canCreativeCast || player.getGameMode() != GameMode.CREATIVE) && !playerData.isCasting() && !playerData.getBoundSkills().isEmpty()) { playerData.setSkillCasting(new CustomSkillCastingInstance(playerData)); + if (!playerData.isCasting()){ + return; + } MMOCore.plugin.soundManager.getSound(SoundEvent.SPELL_CAST_BEGIN).playTo(player); } } diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/SkillScroller.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/SkillScroller.java index 92acb49e..72a2db96 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/SkillScroller.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/skill/cast/listener/SkillScroller.java @@ -78,6 +78,9 @@ public class SkillScroller implements SkillCastingListener { // Enter casting mode playerData.setSkillCasting(new CustomSkillCastingInstance(playerData)); + if (!playerData.isCasting()){ + return; + } if (enterSound != null) enterSound.playTo(player); }