diff --git a/src/main/java/org/maxgamer/quickshop/Command/QS.java b/src/main/java/org/maxgamer/quickshop/Command/QS.java index d48693b53..de2012159 100644 --- a/src/main/java/org/maxgamer/quickshop/Command/QS.java +++ b/src/main/java/org/maxgamer/quickshop/Command/QS.java @@ -39,7 +39,7 @@ public class QS implements CommandExecutor { Shop shop = plugin.getShopManager().getShop(b.getLocation()); if (shop != null) { shop.setUnlimited(!shop.isUnlimited()); - shop.setSignText(); + //shop.setSignText(); shop.update(); sender.sendMessage(MsgUtil.getMessage("command.toggle-unlimited", (shop.isUnlimited() ? "unlimited" : "limited"))); @@ -61,7 +61,7 @@ public class QS implements CommandExecutor { Integer.valueOf(args[3]), Integer.valueOf(args[4]))); if (shop != null) { shop.setUnlimited(!shop.isUnlimited()); - shop.setSignText(); + //shop.setSignText(); shop.update(); MsgUtil.sendControlPanelInfo(sender, shop); sender.sendMessage(MsgUtil.getMessage("command.toggle-unlimited", @@ -206,7 +206,7 @@ public class QS implements CommandExecutor { @SuppressWarnings("deprecation") OfflinePlayer p = this.plugin.getServer().getOfflinePlayer(args[1]); shop.setOwner(p.getUniqueId()); - shop.setSignText(); + //shop.setSignText(); shop.update(); sender.sendMessage(MsgUtil.getMessage("command.new-owner", this.plugin.getServer().getOfflinePlayer(shop.getOwner()).getName())); @@ -437,7 +437,7 @@ public class QS implements CommandExecutor { Integer.valueOf(args[3]), Integer.valueOf(args[4]))); if (shop != null && shop.getModerator().isModerator(((Player) sender).getUniqueId())) { shop.setShopType(ShopType.BUYING); - shop.setSignText(); + //shop.setSignText(); shop.update(); MsgUtil.sendControlPanelInfo(sender, shop); sender.sendMessage(MsgUtil @@ -457,7 +457,7 @@ public class QS implements CommandExecutor { Shop shop = plugin.getShopManager().getShop(b.getLocation()); if (shop != null && shop.getModerator().isModerator(((Player) sender).getUniqueId())) { shop.setShopType(ShopType.BUYING); - shop.setSignText(); + //shop.setSignText(); shop.update(); sender.sendMessage(MsgUtil .getMessage("command.now-buying", MsgUtil.getItemi18n(shop.getItem().getType().name()))); @@ -477,7 +477,7 @@ public class QS implements CommandExecutor { Integer.valueOf(args[2]), Integer.valueOf(args[3]), Integer.valueOf(args[4]))); if (shop != null && shop.getModerator().isModerator(((Player) sender).getUniqueId())) { shop.setShopType(ShopType.SELLING); - shop.setSignText(); + //shop.setSignText(); shop.update(); MsgUtil.sendControlPanelInfo(sender, shop); sender.sendMessage(MsgUtil @@ -498,7 +498,7 @@ public class QS implements CommandExecutor { Shop shop = plugin.getShopManager().getShop(b.getLocation()); if (shop != null && shop.getModerator().isModerator(((Player) sender).getUniqueId())) { shop.setShopType(ShopType.SELLING); - shop.setSignText(); + //shop.setSignText(); shop.update(); sender.sendMessage(MsgUtil .getMessage("command.now-selling", MsgUtil.getItemi18n(shop.getItem().getType().name()))); @@ -579,7 +579,7 @@ public class QS implements CommandExecutor { } // Update the shop shop.setPrice(price); - shop.setSignText(); + //shop.setSignText(); shop.update(); sender.sendMessage(MsgUtil.getMessage("price-is-now", plugin.getEcon().format(shop.getPrice()))); // Chest shops can be double shops. diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java index 48dde3373..2ecdcb6c2 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ContainerShop.java @@ -327,6 +327,7 @@ public class ContainerShop implements Shop { inv.removeItem(item); remains = remains - stackSize; } + this.setSignText(); } /** @@ -347,6 +348,7 @@ public class ContainerShop implements Shop { inv.addItem(item); remains = remains - stackSize; } + this.setSignText(); } /** @@ -467,6 +469,7 @@ public class ContainerShop implements Shop { */ public void setOwner(UUID owner) { this.moderator.setOwner(owner); + this.setSignText(); update(); } @@ -481,6 +484,7 @@ public class ContainerShop implements Shop { public void setUnlimited(boolean unlimited) { this.unlimited = unlimited; + this.setSignText(); update(); } @@ -754,6 +758,7 @@ public class ContainerShop implements Shop { // check price restriction Entry priceRestriction = Util.getPriceRestriction(this.getMaterial()); + if (priceRestriction != null) { if (price < priceRestriction.getKey()) { price = priceRestriction.getKey(); diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopLoader.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopLoader.java index 038e55bdd..533fa5da3 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopLoader.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopLoader.java @@ -68,7 +68,7 @@ public class ShopLoader { } plugin.getQueuedShopManager() - .add(new QueueShopObject(shop, new QueueAction[]{ QueueAction.LOAD, QueueAction.SETSIGNTEXT })); + .add(new QueueShopObject(shop, QueueAction.LOAD, QueueAction.SETSIGNTEXT)); } else { loadAfterChunkLoaded++; }