Skip to content

Commit

Permalink
patch that PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Nov 17, 2022
1 parent 150b609 commit 57ea183
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib
Submodule lib updated 1 files
+ arikeys.jar
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand All @@ -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);
}

Expand Down

0 comments on commit 57ea183

Please sign in to comment.