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