Fixed being able to increase step1 over the max
This commit is contained in:
parent
6d513de154
commit
263b0ddbd1
|
|
@ -126,7 +126,7 @@ public class BreedMobsQuest extends Quest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void breed(LivingEntity entity) {
|
public void breed(LivingEntity entity) {
|
||||||
if (isDone() || !entity.getType().equals(breedMobsQuestObject.getEntityType()))
|
if (isDone() || !entity.getType().equals(breedMobsQuestObject.getEntityType()) || getAmount() == getStep1())
|
||||||
return;
|
return;
|
||||||
addStep1(1);
|
addStep1(1);
|
||||||
checkDone();
|
checkDone();
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ public class CollectDropsQuest extends Quest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void collectDrops(List<ItemStack> drops) {
|
public void collectDrops(List<ItemStack> drops) {
|
||||||
if (isDone())
|
if (isDone() || getAmount() == getStep1())
|
||||||
return;
|
return;
|
||||||
int total = drops.stream()
|
int total = drops.stream()
|
||||||
.filter(itemStack -> itemStack.getType().equals(collectDropsQuestObject.getMaterial()))
|
.filter(itemStack -> itemStack.getType().equals(collectDropsQuestObject.getMaterial()))
|
||||||
|
|
@ -158,7 +158,7 @@ public class CollectDropsQuest extends Quest {
|
||||||
.sum();
|
.sum();
|
||||||
if (total == 0)
|
if (total == 0)
|
||||||
return;
|
return;
|
||||||
addStep1(total);
|
addStep1(Math.min(total, getAmount() - getStep1()));
|
||||||
checkDone();
|
checkDone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ public class KillMobsQuest extends Quest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void kill(LivingEntity entity) {
|
public void kill(LivingEntity entity) {
|
||||||
if (isDone() || !entity.getType().equals(killMobsQuestObject.getEntityType()) || !entity.hasAI())
|
if (isDone() || !entity.getType().equals(killMobsQuestObject.getEntityType()) || !entity.hasAI() || getAmount() == getStep1())
|
||||||
return;
|
return;
|
||||||
addStep1(1);
|
addStep1(1);
|
||||||
checkDone();
|
checkDone();
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ public class MineQuest extends Quest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mine(Block block) {
|
public void mine(Block block) {
|
||||||
if (isDone() || !block.getType().equals(mineQuestObject.getMaterial()))
|
if (isDone() || !block.getType().equals(mineQuestObject.getMaterial()) || getAmount() == getStep1())
|
||||||
return;
|
return;
|
||||||
addStep1(1);
|
addStep1(1);
|
||||||
checkDone();
|
checkDone();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user