From 0c0c0ff9baf958e9f6d9746aa9210b18e20a04e0 Mon Sep 17 00:00:00 2001 From: Zrips Date: Thu, 17 Oct 2024 11:03:34 +0300 Subject: [PATCH] This needs to be here. Fix for BP with -1 payments --- src/main/java/com/gamingmesh/jobs/Jobs.java | 3 +-- .../com/gamingmesh/jobs/config/ExploitProtectionManager.java | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index a11979b2..f8c348df 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -1047,9 +1047,8 @@ public final class Jobs extends JavaPlugin { List progression = jPlayer.getJobProgression(); int numjobs = progression.size(); - if (!Jobs.getGCManager().useBlockProtectionBlockTracker && !Jobs.getExploitManager().isProtectionValidAddIfNotExists(jPlayer, info, block, true)) { + if (!Jobs.getGCManager().useBlockProtectionBlockTracker && !Jobs.getExploitManager().isProtectionValidAddIfNotExists(jPlayer, info, block, true)) return; - } // no job if (numjobs == 0) { diff --git a/src/main/java/com/gamingmesh/jobs/config/ExploitProtectionManager.java b/src/main/java/com/gamingmesh/jobs/config/ExploitProtectionManager.java index 96bcef86..9023e4e0 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ExploitProtectionManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ExploitProtectionManager.java @@ -284,6 +284,11 @@ public class ExploitProtectionManager { if (exploitProtection.getProtectedUntil() != 0) { long time = exploitProtection.getProtectedUntil(); + if (time == -1L) { + remove(block); + return false; + } + if (time < System.currentTimeMillis()) { remove(block); return true;