diff --git a/src/main/java/org/maxgamer/quickshop/Shop/RealDisplayItem.java b/src/main/java/org/maxgamer/quickshop/Shop/RealDisplayItem.java index aa8fe2f34..9f7c3c214 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/RealDisplayItem.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/RealDisplayItem.java @@ -207,39 +207,36 @@ public class RealDisplayItem implements DisplayItem { Util.debugLog("Canceled the displayItem spawning because the ItemStack is null."); return; } - - synchronized (this) { - if (item != null && item.isValid() && !item.isDead()) { + if (item != null && item.isValid() && !item.isDead()) { + Util.debugLog( + "Warning: Spawning the Dropped Item for DisplayItem when there is already an existing Dropped Item, May cause a duplicated Dropped Item!"); + StackTraceElement[] traces = Thread.currentThread().getStackTrace(); + for (StackTraceElement trace : traces) { Util.debugLog( - "Warning: Spawning the Dropped Item for DisplayItem when there is already an existing Dropped Item, May cause a duplicated Dropped Item!"); - StackTraceElement[] traces = Thread.currentThread().getStackTrace(); - for (StackTraceElement trace : traces) { - Util.debugLog( - trace.getClassName() + "#" + trace.getMethodName() + "#" + trace.getLineNumber()); - } + trace.getClassName() + "#" + trace.getMethodName() + "#" + trace.getLineNumber()); } - if (!Util.isDisplayAllowBlock( - getDisplayLocation().getBlock().getType())) { - Util.debugLog( - "Can't spawn the displayItem because there is not an AIR block above the shopblock."); - return; - } - - ShopDisplayItemSpawnEvent shopDisplayItemSpawnEvent = - new ShopDisplayItemSpawnEvent(shop, originalItemStack, DisplayType.REALITEM); - Bukkit.getPluginManager().callEvent(shopDisplayItemSpawnEvent); - if (shopDisplayItemSpawnEvent.isCancelled()) { - Util.debugLog( - "Canceled the displayItem spawning because a plugin setCancelled the spawning event, usually this is a QuickShop Add on"); - return; - } - this.guardedIstack = DisplayItem.createGuardItemStack(this.originalItemStack, this.shop); - this.item = - this.shop.getLocation().getWorld().dropItem(getDisplayLocation(), this.guardedIstack); - Util.debugLog("Spawned item @ " + this.item.getLocation() + " with UUID " + this.item.getUniqueId()); - this.item.setItemStack(this.guardedIstack); - safeGuard(this.item); } + if (!Util.isDisplayAllowBlock( + getDisplayLocation().getBlock().getType())) { + Util.debugLog( + "Can't spawn the displayItem because there is not an AIR block above the shopblock."); + return; + } + + ShopDisplayItemSpawnEvent shopDisplayItemSpawnEvent = + new ShopDisplayItemSpawnEvent(shop, originalItemStack, DisplayType.REALITEM); + Bukkit.getPluginManager().callEvent(shopDisplayItemSpawnEvent); + if (shopDisplayItemSpawnEvent.isCancelled()) { + Util.debugLog( + "Canceled the displayItem spawning because a plugin setCancelled the spawning event, usually this is a QuickShop Add on"); + return; + } + this.guardedIstack = DisplayItem.createGuardItemStack(this.originalItemStack, this.shop); + this.item = + this.shop.getLocation().getWorld().dropItem(getDisplayLocation(), this.guardedIstack); + Util.debugLog("Spawned item @ " + this.item.getLocation() + " with UUID " + this.item.getUniqueId()); + this.item.setItemStack(this.guardedIstack); + safeGuard(this.item); } @Override