From 2e0ea7a596e1f71192bc86e0a1b8625a8d1ffb8a Mon Sep 17 00:00:00 2001 From: Zrips Date: Mon, 3 Oct 2016 13:17:41 +0300 Subject: [PATCH] check if same job by its name, just to be on safe side if multiserver enabled, load player data after some delay. --- com/gamingmesh/jobs/container/Job.java | 2 +- com/gamingmesh/jobs/listeners/JobsListener.java | 13 +++++++++++-- plugin.yml | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/com/gamingmesh/jobs/container/Job.java b/com/gamingmesh/jobs/container/Job.java index 03383b26..544538e0 100644 --- a/com/gamingmesh/jobs/container/Job.java +++ b/com/gamingmesh/jobs/container/Job.java @@ -123,7 +123,7 @@ public class Job { } public boolean isSame(Job job) { - return this.equals(job); + return this.getName().equalsIgnoreCase(job.getName()); } public double getPointBoost() { diff --git a/com/gamingmesh/jobs/listeners/JobsListener.java b/com/gamingmesh/jobs/listeners/JobsListener.java index 19999fb4..eb54b978 100644 --- a/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/com/gamingmesh/jobs/listeners/JobsListener.java @@ -156,12 +156,21 @@ public class JobsListener implements Listener { } @EventHandler(priority = EventPriority.MONITOR) - public void onPlayerJoin(PlayerJoinEvent event) { + public void onPlayerJoin(final PlayerJoinEvent event) { // make sure plugin is enabled if (!plugin.isEnabled()) return; - Jobs.getPlayerManager().playerJoin(event.getPlayer()); + if (!Jobs.getGCManager().MultiServerCompatability()) + Jobs.getPlayerManager().playerJoin(event.getPlayer()); + else + Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { + @Override + public void run() { + Jobs.getPlayerManager().playerJoin(event.getPlayer()); + } + }, 10L); + } // @EventHandler(priority = EventPriority.MONITOR) diff --git a/plugin.yml b/plugin.yml index 44cbd8a8..9ca9a305 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,7 +1,7 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.Jobs -version: 3.6.1 +version: 3.6.2 author: phrstbrn depend: [Vault] softdepend: [MythicMobs, McMMO]