From 57ea18399356fc1cf3e6ace327de9d58be1a00d0 Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" Date: Thu, 17 Nov 2022 05:08:55 -0800 Subject: [PATCH] patch that PR --- lib | 2 +- .../mythickeys/MythicKeysKeyPressScriptEvent.java | 14 +++++++++----- .../MythicKeysKeyReleaseScriptEvent.java | 14 ++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib b/lib index 7af7933dd..83fb6580f 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit 7af7933dd976eeb281972bcab3f33d06ad6e4527 +Subproject commit 83fb6580fd81ce06633d6e27b20c7d9339b9bd5c diff --git a/src/main/java/com/denizenscript/depenizen/bukkit/events/mythickeys/MythicKeysKeyPressScriptEvent.java b/src/main/java/com/denizenscript/depenizen/bukkit/events/mythickeys/MythicKeysKeyPressScriptEvent.java index 6fec4a2eb..2d7d0f636 100644 --- a/src/main/java/com/denizenscript/depenizen/bukkit/events/mythickeys/MythicKeysKeyPressScriptEvent.java +++ b/src/main/java/com/denizenscript/depenizen/bukkit/events/mythickeys/MythicKeysKeyPressScriptEvent.java @@ -10,7 +10,6 @@ import com.denizenscript.denizencore.utilities.debugging.SlowWarning; import com.denizenscript.denizencore.utilities.debugging.Warning; import eu.asangarin.mythickeys.api.MythicKeyPressEvent; -import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -45,7 +44,15 @@ public MythicKeysKeyPressScriptEvent() { } public MythicKeyPressEvent event; - public Warning outdatedMythicKeys = new Warning("mythicKeysOutdated", "MythicKeys is outdated. Use the plugin 'AriKeysPlugin' for 1.19+ servers."); + public static Warning outdatedMythicKeys = new SlowWarning("mythicKeysOutdated", "MythicKeys is outdated. Use the plugin 'AriKeysPlugin' for 1.19+ servers."); + + @Override + public boolean couldMatch(ScriptPath path) { + if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19)) { + outdatedMythicKeys.warn(); + } + return super.couldMatch(path); + } @Override public boolean matches(ScriptPath path) { @@ -55,9 +62,6 @@ public boolean matches(ScriptPath path) { if (!runInCheck(path, event.getPlayer().getLocation())) { return false; } - if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19)) { - outdatedMythicKeys.warn(); - } return super.matches(path); } diff --git a/src/main/java/com/denizenscript/depenizen/bukkit/events/mythickeys/MythicKeysKeyReleaseScriptEvent.java b/src/main/java/com/denizenscript/depenizen/bukkit/events/mythickeys/MythicKeysKeyReleaseScriptEvent.java index e0c92de1f..6c4c6f135 100644 --- a/src/main/java/com/denizenscript/depenizen/bukkit/events/mythickeys/MythicKeysKeyReleaseScriptEvent.java +++ b/src/main/java/com/denizenscript/depenizen/bukkit/events/mythickeys/MythicKeysKeyReleaseScriptEvent.java @@ -7,9 +7,7 @@ import com.denizenscript.denizencore.objects.ObjectTag; import com.denizenscript.denizencore.objects.core.ElementTag; import com.denizenscript.denizencore.scripts.ScriptEntryData; -import com.denizenscript.denizencore.utilities.debugging.Warning; import eu.asangarin.mythickeys.api.MythicKeyReleaseEvent; -import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -44,7 +42,14 @@ public MythicKeysKeyReleaseScriptEvent() { } public MythicKeyReleaseEvent event; - public Warning outdatedMythicKeys = new Warning("mythicKeysOutdated", "MythicKeys is outdated. Use the plugin 'AriKeysPlugin' for 1.19+ servers."); + + @Override + public boolean couldMatch(ScriptPath path) { + if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19)) { + MythicKeysKeyPressScriptEvent.outdatedMythicKeys.warn(); + } + return super.couldMatch(path); + } @Override public boolean matches(ScriptPath path) { @@ -54,9 +59,6 @@ public boolean matches(ScriptPath path) { if (!runInCheck(path, event.getPlayer().getLocation())) { return false; } - if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_19)) { - outdatedMythicKeys.warn(); - } return super.matches(path); }