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(); } }