From 415e633d961daef7c20b0b0ccce13091cc9eef87 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Sun, 1 Dec 2019 08:56:29 +0800 Subject: [PATCH] Revert "Add async detect for display check" This reverts commit 47130e2f Former-commit-id: 46de5da99e801ad14720ec247ec565443a5ce2b8 [formerly 9dfd6b3326e6fdc06db19da87dc26e0e8a08c78f] Former-commit-id: 8bfd3472e32223437baaf57490f5bce5020e6aa8 --- .../quickshop/Shop/ContainerShop.java | 48 ++----------------- 1 file changed, 4 insertions(+), 44 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java index 7ddbd8811..e63810b3e 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java @@ -16,12 +16,10 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.Damageable; -import org.bukkit.scheduler.BukkitRunnable; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.maxgamer.quickshop.Event.*; import org.maxgamer.quickshop.QuickShop; -import org.maxgamer.quickshop.Util.AsyncDetector; import org.maxgamer.quickshop.Util.MsgUtil; import org.maxgamer.quickshop.Util.Util; @@ -400,58 +398,20 @@ public class ContainerShop implements Shop { if (!this.displayItem.isSpawned()) { /* Not spawned yet. */ Util.debugLog("Target item not spawned, spawning..."); - if (!AsyncDetector.isAsync()) { - displayItem.spawn(); - } else { - new BukkitRunnable() { - @Override - public void run() { - displayItem.spawn(); - } - }.runTask(plugin); - } + this.displayItem.spawn(); } else { /* If not spawned, we didn't need check these, only check them when we need. */ if (this.displayItem.checkDisplayNeedRegen()) { - if (!AsyncDetector.isAsync()) { - displayItem.fixDisplayNeedRegen(); - } else { - new BukkitRunnable() { - @Override - public void run() { - displayItem.fixDisplayNeedRegen(); - } - }.runTask(plugin); - } + this.displayItem.fixDisplayNeedRegen(); } else {/* If display was regened, we didn't need check it moved, performance! */ if (this.displayItem.checkDisplayIsMoved()) { - if (!AsyncDetector.isAsync()) { - displayItem.fixDisplayMoved(); - } else { - new BukkitRunnable() { - @Override - public void run() { - displayItem.fixDisplayMoved(); - } - }.runTask(plugin); - } - + this.displayItem.fixDisplayMoved(); } } } /* Dupe is always need check, if enabled display */ if (plugin.isDisplay()) { - - if (!AsyncDetector.isAsync()) { - displayItem.removeDupe(); - } else { - new BukkitRunnable() { - @Override - public void run() { - displayItem.removeDupe(); - } - }.runTask(plugin); - } + this.displayItem.removeDupe(); } }