1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 05:55:27 +01:00

add jobs reload compatibility to pyrofishing

This commit is contained in:
flo0s 2024-06-28 02:06:30 +02:00
parent 4b6db96c1c
commit 7c172ff54d
3 changed files with 12 additions and 2 deletions

View File

@ -842,6 +842,9 @@ public final class Jobs extends JavaPlugin {
pm.registerEvents(new JobsChatEvent(getInstance()), getInstance());
if(HookManager.checkPyroFishingPro()) {
HookManager.getPyroFishingProManager().registerListener();
}
if (HookManager.getMcMMOManager().CheckmcMMO()) {
HookManager.setMcMMOlistener();
}

View File

@ -102,6 +102,10 @@ public class HookManager {
return Jobs.getGCManager().MythicMobsEnabled && MythicManager != null && MythicManager.check();
}
public static boolean checkPyroFishingPro() {
return pyroFishingProManager != null;
}
public static BlockTrackerManager getBlockTrackerManager() {
if (blockTrackerManager == null) {
blockTrackerManager = new BlockTrackerManager();

View File

@ -7,7 +7,6 @@ import org.bukkit.event.Listener;
import com.gamingmesh.jobs.Jobs;
import me.arsmagica.API.PyroFishCatchEvent;
import net.Zrips.CMILib.Logs.CMIDebug;
public class PyroFishingProManager implements Listener {
private static String lastFish;
@ -16,7 +15,7 @@ public class PyroFishingProManager implements Listener {
public PyroFishingProManager() {
this.jobs = Jobs.getInstance();
jobs.getServer().getPluginManager().registerEvents(this, jobs);
registerListener();
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
@ -30,4 +29,8 @@ public class PyroFishingProManager implements Listener {
return null;
return lastFish;
}
public void registerListener() {
jobs.getServer().getPluginManager().registerEvents(this, jobs);
}
}