aboutsummaryrefslogtreecommitdiffstats
path: root/bukkit/src/main/java/com/leonardobishop
diff options
context:
space:
mode:
Diffstat (limited to 'bukkit/src/main/java/com/leonardobishop')
-rw-r--r--bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java
index 969c8c29..81ebf24e 100644
--- a/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java
+++ b/bukkit/src/main/java/com/leonardobishop/quests/bukkit/tasktype/type/InventoryTaskType.java
@@ -151,6 +151,15 @@ public final class InventoryTaskType extends BukkitTaskType {
}
} else {
int progress = Math.min(amountPerSlot[36], amount);
+ int oldProgress = TaskUtils.getIntegerTaskProgress(taskProgress);
+
+ if (progress == oldProgress) {
+ // no need to update, also no need to check for progress >= amount
+ // as quest completer will handle that properly after some time
+ // we don't want to send track advancement for each inventory op too
+ continue;
+ }
+
taskProgress.setProgress(progress);
super.debug("Updating task progress (now " + progress + ")", quest.getId(), task.getId(), player.getUniqueId());