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

Fixed milking quests and Dye action not working correctly (#762)

- Added leather_horse_armor as a dyeable material.
This commit is contained in:
Pablo Villaverde 2020-04-27 18:33:06 +02:00 committed by GitHub
parent 4198a28967
commit bedd3e5d97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -228,20 +228,27 @@ public class JobsPaymentListener implements Listener {
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
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;
}
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;
}
}
for (Quest q : prog.getJob().getQuests()) {
if (q != null && q.hasAction(ActionType.MILK)) {
found = true;
break t;
}
}
}
}
if (!found) {
return;
}
if (!found) {
return;
}
if (Jobs.getGCManager().CowMilkingTimer > 0) {
if (cow.hasMetadata(CowMetadata)) {
@ -634,6 +641,7 @@ public class JobsPaymentListener implements Listener {
case LEATHER_CHESTPLATE:
case LEATHER_HELMET:
case LEATHER_LEGGINGS:
case LEATHER_HORSE_ARMOR:
leather = true;
break;
default:
@ -654,7 +662,7 @@ public class JobsPaymentListener implements Listener {
// Check Dyes
if (y >= 2) {
if ((third != null && third.isDye() || second != null && second.isDye()) && leather) {
if ((third != null && third.isDye() || second != null && second.isDye() || first != null && first.isDye()) && leather) {
Jobs.action(jPlayer, new ItemActionInfo(sourceItems[0], ActionType.DYE));
for (ItemStack OneDye : DyeStack) {
Jobs.action(jPlayer, new ItemActionInfo(OneDye, ActionType.DYE));