From 4b18f5b0ef75e49f62e4cccf400da2f263c1d2fc Mon Sep 17 00:00:00 2001 From: KaiKikuchi Date: Mon, 21 Sep 2015 12:24:18 +0200 Subject: [PATCH] Bugfix #8 - config reload for items blacklist and shoppables --- src/main/java/org/maxgamer/quickshop/QuickShop.java | 5 +++++ .../java/org/maxgamer/quickshop/Shop/ShopManager.java | 7 +------ src/main/java/org/maxgamer/quickshop/Util/Util.java | 10 ++++++++-- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/QuickShop.java b/src/main/java/org/maxgamer/quickshop/QuickShop.java index 0e0d9d9..727deb4 100644 --- a/src/main/java/org/maxgamer/quickshop/QuickShop.java +++ b/src/main/java/org/maxgamer/quickshop/QuickShop.java @@ -119,6 +119,10 @@ public class QuickShop extends JavaPlugin { debug = true; if (loadEcon() == false) return; + + // Initialize Util + Util.initialize(); + // Create the shop manager. this.shopManager = new ShopManager(this); if (this.display) { @@ -250,6 +254,7 @@ public class QuickShop extends JavaPlugin { e.printStackTrace(); getLogger().severe("Could not load shops."); } + getLogger().info("Loaded " + count + " shops."); MsgUtil.loadTransactionMessages(); MsgUtil.clean(); diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java index 71ee996..cdb80a8 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopManager.java @@ -235,12 +235,7 @@ public class ShopManager { return false; } } - PlayerInteractEvent pie = new PlayerInteractEvent(p, Action.RIGHT_CLICK_BLOCK, new ItemStack(Material.AIR), b, bf); // PIE - // = - // PlayerInteractEvent - // - - // What - // else? + PlayerInteractEvent pie = new PlayerInteractEvent(p, Action.RIGHT_CLICK_BLOCK, new ItemStack(Material.AIR), b, bf); // PIE = PlayerInteractEvent - What else? Bukkit.getPluginManager().callEvent(pie); pie.getPlayer().closeInventory(); // If the player has chat open, this // will close their chat. diff --git a/src/main/java/org/maxgamer/quickshop/Util/Util.java b/src/main/java/org/maxgamer/quickshop/Util/Util.java index 093b629..f13cbf3 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Util.java @@ -33,7 +33,13 @@ public class Util { private static HashSet shoppables = new HashSet(); private static HashSet transparent = new HashSet(); private static QuickShop plugin; - static { + + public static void initialize() { + tools.clear(); + blacklist.clear(); + shoppables.clear(); + transparent.clear(); + plugin = QuickShop.instance; for (String s : plugin.getConfig().getStringList("shop-blocks")) { Material mat = Material.getMaterial(s.toUpperCase()); @@ -110,7 +116,7 @@ public class Util { } blacklist.add(mat); } - transparent.clear(); + // ToDo: add extras to config file addTransparentBlock(Material.AIR); /* Misc */