diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index f5cf9c667..5ad571c63 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -558,7 +558,7 @@ public class QuickShop extends JavaPlugin { Util.debugLog("Registering shop watcher..."); shopVaildWatcher.runTaskTimer(this, 0, 20 * 60); signUpdateWatcher.runTaskTimer(this,0,120); - shopContainerWatcher.runTaskTimer(this,0,20); + shopContainerWatcher.runTaskTimer(this,0,5); if (logWatcher != null) { logWatcher.runTaskTimerAsynchronously(this, 10, 10); getLogger().info("Log actions is enabled, actions will log in the qs.log file!"); diff --git a/src/main/java/org/maxgamer/quickshop/Watcher/ShopContainerWatcher.java b/src/main/java/org/maxgamer/quickshop/Watcher/ShopContainerWatcher.java index e03a753eb..48a968e25 100644 --- a/src/main/java/org/maxgamer/quickshop/Watcher/ShopContainerWatcher.java +++ b/src/main/java/org/maxgamer/quickshop/Watcher/ShopContainerWatcher.java @@ -45,14 +45,13 @@ public class ShopContainerWatcher extends BukkitRunnable { @Override public void run() { + long beginTime = System.currentTimeMillis(); Shop shop = checkQueue.poll(); while (shop != null) { - int cost = 0; if(shop instanceof ContainerShop){ ((ContainerShop) shop).checkContainer(); - cost ++; } - if(cost > 15){ + if(System.currentTimeMillis() - beginTime > 45){ //Don't let quickshop eat more than 45 ms per tick. break; } shop = checkQueue.poll();