diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java index f2393c700..9f047a95e 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java @@ -36,7 +36,6 @@ public class ContainerShop implements Shop { private boolean unlimited; private ShopType shopType; private QuickShop plugin; - private boolean isLoaded = false; /** * Returns a clone of this shop. References to the same display item, @@ -516,8 +515,6 @@ public class ContainerShop implements Shop { * Updates signs attached to the shop */ public void setSignText() { - if (this.isLoaded == false) - return; if (Util.isLoaded(this.getLocation()) == false) return; String[] lines = new String[4]; @@ -675,8 +672,6 @@ public class ContainerShop implements Shop { } public void checkDisplay() { - if (this.isLoaded == false) - return; if (plugin.isDisplay() == false) return; if (getLocation().getWorld() == null) @@ -715,8 +710,6 @@ public class ContainerShop implements Shop { public boolean checkDisplayMoved() { // don't check if the plugin doesn't know about the object - if (this.isLoaded == false) - return false; if (this.getDisplayItem() == null) { return false; @@ -744,11 +737,6 @@ public class ContainerShop implements Shop { this.getDisplayItem().remove(); this.displayItem = null; } - this.isLoaded = false; - } - - public boolean isLoaded() { - return this.isLoaded; } public void onLoad() { @@ -759,9 +747,9 @@ public class ContainerShop implements Shop { //this.setSignText(); if (!Util.canBeShop(this.getLocation().getBlock())) { - if (this.isLoaded) - this.onUnload(); - this.delete(); + this.onUnload(); + plugin.getQueuedShopManager() + .add(new QueueShopObject(this, QueueAction.DELETE)); //Use queue make sure not will happend NPE. return; } @@ -776,7 +764,6 @@ public class ContainerShop implements Shop { this.update(); } } - this.isLoaded = true; } public void onClick() { diff --git a/src/main/java/org/maxgamer/quickshop/Shop/Shop.java b/src/main/java/org/maxgamer/quickshop/Shop/Shop.java index 37eba6a50..cfd1c8297 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/Shop.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/Shop.java @@ -93,6 +93,5 @@ public abstract interface Shop { public abstract ArrayList getStaffs(); - public abstract boolean isLoaded(); } \ No newline at end of file diff --git a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java index 0bcf82a65..87f7104cc 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java +++ b/src/main/java/org/maxgamer/quickshop/Util/MsgUtil.java @@ -631,7 +631,8 @@ public class MsgUtil { chatSheetPrinter.printLine(MsgUtil.getMessage("menu.owner", shop.ownerName())); //Enabled Util.sendItemholochat(shop, shop.getItem(), p, ChatColor.DARK_PURPLE + MsgUtil - .getMessage("tableformat.left_begin") + MsgUtil.getMessage("menu.item", MsgUtil.getDisplayName(shop.getItem()))); + .getMessage("tableformat.left_begin") + " " + MsgUtil + .getMessage("menu.item", MsgUtil.getDisplayName(shop.getItem()))); if (Util.isTool(items.getType())) { chatSheetPrinter.printLine(MsgUtil.getMessage("menu.damage-percent-remaining", Util.getToolPercentage(items))); }