Bugfix #8 - config reload for items blacklist and shoppables

pull/3/HEAD
KaiKikuchi 2015-09-21 12:24:18 +02:00
parent f085a5dda3
commit 4b18f5b0ef
3 changed files with 14 additions and 8 deletions

View File

@ -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();

View File

@ -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.

View File

@ -33,7 +33,13 @@ public class Util {
private static HashSet<Material> shoppables = new HashSet<Material>();
private static HashSet<Material> transparent = new HashSet<Material>();
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 */