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

Jobs join should go after JobsJoinEvent being fired

This commit is contained in:
Zrips 2022-08-08 12:53:57 +03:00
parent 7c7b269e7d
commit f8d94952bd

View File

@ -459,10 +459,6 @@ public class PlayerManager {
if (jPlayer == null) if (jPlayer == null)
return; return;
// let the user join the job
if (!jPlayer.joinJob(job))
return;
// JobsJoin event // JobsJoin event
JobsJoinEvent jobsJoinEvent = new JobsJoinEvent(jPlayer, job); JobsJoinEvent jobsJoinEvent = new JobsJoinEvent(jPlayer, job);
plugin.getServer().getPluginManager().callEvent(jobsJoinEvent); plugin.getServer().getPluginManager().callEvent(jobsJoinEvent);
@ -470,6 +466,10 @@ public class PlayerManager {
if (jobsJoinEvent.isCancelled()) if (jobsJoinEvent.isCancelled())
return; return;
// let the user join the job
if (!jPlayer.joinJob(job))
return;
Jobs.getJobsDAO().joinJob(jPlayer, jPlayer.getJobProgression(job)); Jobs.getJobsDAO().joinJob(jPlayer, jPlayer.getJobProgression(job));
jPlayer.setLeftTime(job); jPlayer.setLeftTime(job);