1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-20 07:01:22 +01:00

Fixed issue when cows milking are giving messages, even when the player was not joined to a job

Closes, #728
This commit is contained in:
montlikadani 2020-04-17 11:33:29 +02:00
parent 05b1122d66
commit d16fc7e50d

View File

@ -228,6 +228,20 @@ public class JobsPaymentListener implements Listener {
if (jPlayer == null)
return;
boolean found = false;
t: for (JobProgression prog : jPlayer.getJobProgression()) {
for (JobInfo info : jPlayer.getJobProgression(prog.getJob()).getJob().getJobInfo(ActionType.MILK)) {
if (info.getActionType() == ActionType.MILK) {
found = true;
break t;
}
}
}
if (!found) {
return;
}
if (Jobs.getGCManager().CowMilkingTimer > 0) {
if (cow.hasMetadata(CowMetadata)) {
long time = cow.getMetadata(CowMetadata).get(0).asLong();