From 1a976c6aa033e885a7957b5cffc81dbf555b4064 Mon Sep 17 00:00:00 2001 From: Jules Date: Tue, 27 Jun 2023 00:10:08 +0200 Subject: [PATCH] Cannot enter combos with no skills bound --- .../net/Indyuce/mmocore/skill/cast/listener/KeyCombos.java | 6 +++++- .../Indyuce/mmocore/skill/cast/listener/SkillScroller.java | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) 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 22517b9e..8f780afe 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 @@ -73,6 +73,9 @@ public class KeyCombos implements SkillCastingListener { if (player.getGameMode() == GameMode.CREATIVE && !MMOCore.plugin.configManager.canCreativeCast) return; + // Don't start combos if no skills are bound + if (playerData.getBoundSkills().isEmpty()) return; + // Start combo when there is an initializer key if (!event.getData().isCasting() && initializerKey != null) { if (event.getPressed() == initializerKey) { @@ -172,7 +175,8 @@ public class KeyCombos implements SkillCastingListener { @Override public void onTick() { - if (actionBarOptions != null) if (actionBarOptions.isSubtitle) + if (getCaster().getBoundSkills().isEmpty()) close(); + else if (actionBarOptions != null) if (actionBarOptions.isSubtitle) getCaster().getPlayer().sendTitle(" ", actionBarOptions.format(this), 0, 20, 0); else getCaster().displayActionBar(actionBarOptions.format(this)); } 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 43299828..6d5a66c7 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 @@ -60,6 +60,7 @@ public class SkillScroller implements SkillCastingListener { Player player = playerData.getPlayer(); if (player.getGameMode() == GameMode.CREATIVE && !MMOCore.plugin.configManager.canCreativeCast) return; + if (event.getPressed() == enterKey) { // Leave casting mode