Create shop instance only when using it

Former-commit-id: 44681101fbd65ae5f31180e16fa4acc8e6269d7a
This commit is contained in:
Ghost_chu committed 2020-04-12 14:10:41 +08:00
1 parent 5e6a5ff0ea
commit 794814bf2f
1 file changed
+3 -1
@@ -723,6 +723,8 @@ public class ShopManager {
}
// double minPrice = plugin.getConfig().getDouble("shop.minimum-price");
// try {
// if (plugin.getConfig().getBoolean("whole-number-prices-only")) {
@@ -793,7 +795,6 @@ public class ShopManager {
double createCost = plugin.getConfig().getDouble("shop.cost");
// Create the sample shop.
ContainerShop shop = new ContainerShop(info.getLocation(), price, info.getItem(), new ShopModerator(p.getUniqueId()), false, ShopType.SELLING);
// This must be called after the event has been called.
// Else, if the event is cancelled, they won't get their
@@ -815,6 +816,7 @@ public class ShopManager {
plugin.getLogger().log(Level.WARNING, "QuickShop can't pay tax to account in config.yml, Please set tax account name to a existing player!");
}
}
ContainerShop shop = new ContainerShop(info.getLocation(), price, info.getItem(), new ShopModerator(p.getUniqueId()), false, ShopType.SELLING);
shop.onLoad();
ShopCreateEvent e = new ShopCreateEvent(shop, p);
if (Util.fireCancellableEvent(e)) {