Revert "Add async detect for display check"

This reverts commit 47130e2f


Former-commit-id: 46de5da99e801ad14720ec247ec565443a5ce2b8 [formerly 9dfd6b3326e6fdc06db19da87dc26e0e8a08c78f]
Former-commit-id: 8bfd3472e32223437baaf57490f5bce5020e6aa8
This commit is contained in:
Ghost_chu committed 2019-12-01 08:56:29 +08:00
1 parent d411673879
commit 415e633d96
1 file changed
+4 -44
@@ -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();
}
}