From 9af5c358ddf64512b1113bfabe71df3fa5b04f0c Mon Sep 17 00:00:00 2001 From: Ka0rX Date: Sun, 4 Jun 2023 21:42:10 +0100 Subject: [PATCH] . --- .../net/Indyuce/mmocore/skill/cast/listener/KeyCombos.java | 3 +++ .../Indyuce/mmocore/skill/cast/listener/SkillScroller.java | 5 ++++- 2 files changed, 7 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 9fe2c397..410ce5d9 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 @@ -12,6 +12,7 @@ import net.Indyuce.mmocore.api.event.PlayerKeyPressEvent; import net.Indyuce.mmocore.api.player.PlayerData; import net.Indyuce.mmocore.gui.api.item.Placeholders; import net.Indyuce.mmocore.skill.cast.*; +import org.bukkit.GameMode; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -70,6 +71,8 @@ public class KeyCombos implements SkillCastingListener { public void whenPressingKey(PlayerKeyPressEvent event) { PlayerData playerData = event.getData(); Player player = playerData.getPlayer(); + if(player.getGameMode()== GameMode.CREATIVE&&!MMOCore.plugin.configManager.canCreativeCast) + return; // Start combo when there is an initializer key if (!event.getData().isCasting() && initializerKey != null) { 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..18bf85bf 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 @@ -4,6 +4,7 @@ import io.lumine.mythic.lib.UtilityMethods; import io.lumine.mythic.lib.api.player.EquipmentSlot; import io.lumine.mythic.lib.player.PlayerMetadata; import io.lumine.mythic.lib.skill.trigger.TriggerMetadata; +import net.Indyuce.mmocore.MMOCore; import net.Indyuce.mmocore.api.SoundObject; import net.Indyuce.mmocore.api.event.PlayerKeyPressEvent; import net.Indyuce.mmocore.api.player.PlayerData; @@ -11,6 +12,7 @@ import net.Indyuce.mmocore.skill.cast.PlayerKey; import net.Indyuce.mmocore.skill.cast.SkillCastingInstance; import net.Indyuce.mmocore.skill.cast.SkillCastingListener; import net.Indyuce.mmocore.skill.cast.SkillCastingMode; +import org.bukkit.GameMode; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -56,7 +58,8 @@ public class SkillScroller implements SkillCastingListener { public void whenPressingKey(PlayerKeyPressEvent event) { PlayerData playerData = event.getData(); Player player = playerData.getPlayer(); - + if (player.getGameMode() == GameMode.CREATIVE && !MMOCore.plugin.configManager.canCreativeCast) + return; if (event.getPressed() == enterKey) { // Leave casting mode