mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-21 18:15:32 +01:00
Compare against goal amount, fixes #2280
This commit is contained in:
parent
9ae2bc57da
commit
98441a6b65
@ -2245,7 +2245,7 @@ public class BukkitQuester implements Quester {
|
||||
new BukkitObjective(type, null, amount, goal));
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
|
||||
final int progress = Math.min(crafted.getAmount() + amount, 64);
|
||||
final int progress = Math.min(crafted.getAmount() + amount, goal.getAmount());
|
||||
bukkitQuestProgress.itemsCrafted.set(match, progress);
|
||||
if (progress >= goal.getAmount()) {
|
||||
finishObjective(quest, new BukkitObjective(type, null, progress, goal), null, null, null, null,
|
||||
@ -2294,7 +2294,7 @@ public class BukkitQuester implements Quester {
|
||||
new BukkitObjective(type, null, amount, goal));
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
|
||||
final int progress = Math.min(smelted.getAmount() + amount, 64);
|
||||
final int progress = Math.min(smelted.getAmount() + amount, goal.getAmount());
|
||||
bukkitQuestProgress.itemsSmelted.set(match, progress);
|
||||
if (progress >= goal.getAmount()) {
|
||||
finishObjective(quest, new BukkitObjective(type, null, progress, goal), null, null, null, null,
|
||||
@ -2346,7 +2346,7 @@ public class BukkitQuester implements Quester {
|
||||
new BukkitObjective(type, null, amount, goal));
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
|
||||
final int progress = Math.min(enchantedBook.getAmount() + amount, 64);
|
||||
final int progress = Math.min(enchantedBook.getAmount() + amount, goal.getAmount());
|
||||
bukkitQuestProgress.itemsEnchanted.set(match, progress);
|
||||
if (progress >= goal.getAmount()) {
|
||||
finishObjective(quest, new BukkitObjective(type, null, progress, goal), null, null, null, null,
|
||||
@ -2403,7 +2403,7 @@ public class BukkitQuester implements Quester {
|
||||
new BukkitObjective(type, null, amount, goal));
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
|
||||
final int progress = Math.min(enchanted.getAmount() + amount, 64);
|
||||
final int progress = Math.min(enchanted.getAmount() + amount, goal.getAmount());
|
||||
bukkitQuestProgress.itemsEnchanted.set(match, progress);
|
||||
if (progress >= goal.getAmount()) {
|
||||
finishObjective(quest, new BukkitObjective(type, null, progress, goal), null, null, null, null,
|
||||
@ -2452,7 +2452,7 @@ public class BukkitQuester implements Quester {
|
||||
new BukkitObjective(type, null, amount, goal));
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
|
||||
final int progress = Math.min(brewed.getAmount() + amount, 64);
|
||||
final int progress = Math.min(brewed.getAmount() + amount, goal.getAmount());
|
||||
bukkitQuestProgress.itemsBrewed.set(match, progress);
|
||||
if (progress >= goal.getAmount()) {
|
||||
finishObjective(quest, new BukkitObjective(type, null, progress, goal), null, null, null, null,
|
||||
@ -2566,7 +2566,7 @@ public class BukkitQuester implements Quester {
|
||||
return;
|
||||
}
|
||||
|
||||
final int progress = Math.min(delivered.getAmount() + amount, 64);
|
||||
final int progress = Math.min(delivered.getAmount() + amount, goal.getAmount());
|
||||
bukkitQuestProgress.itemsDelivered.set(match, progress);
|
||||
if (progress >= goal.getAmount()) {
|
||||
// Take away remaining amount to be delivered
|
||||
|
Loading…
Reference in New Issue
Block a user