diff --git a/src/main/java/org/maxgamer/QuickShop/Command/CommandReload.java b/src/main/java/org/maxgamer/QuickShop/Command/CommandReload.java index 630cb20..9d4c113 100644 --- a/src/main/java/org/maxgamer/QuickShop/Command/CommandReload.java +++ b/src/main/java/org/maxgamer/QuickShop/Command/CommandReload.java @@ -22,9 +22,9 @@ public class CommandReload extends BaseCommand { @Override public void execute(final CommandSender sender, final Command command, final String label, final String[] args) throws CommandException { sender.sendMessage(MsgUtil.p("command.reloading")); + plugin.reloadConfig(); Bukkit.getPluginManager().disablePlugin(plugin); Bukkit.getPluginManager().enablePlugin(plugin); - plugin.reloadConfig(); return; } } diff --git a/src/main/java/org/maxgamer/QuickShop/Config/ConfigManager.java b/src/main/java/org/maxgamer/QuickShop/Config/ConfigManager.java index b7cb316..2e45e19 100644 --- a/src/main/java/org/maxgamer/QuickShop/Config/ConfigManager.java +++ b/src/main/java/org/maxgamer/QuickShop/Config/ConfigManager.java @@ -15,14 +15,15 @@ public class ConfigManager { private boolean enableMagicLib = false; /** Whether debug info should be shown in the console */ protected boolean debug = false; + /** Whether we should use display items or not */ protected boolean display = true; protected double feeForPriceChange = 0.0; protected int findDistance = 30; protected String guiTitle = "§6[§b快捷商店§6]"; - /** Whether or not to limit players shop amounts */ protected boolean limit = false; + protected int limitdefault = 0; protected final HashMap limits = new HashMap(); protected boolean logAction = true; @@ -187,4 +188,8 @@ public class ConfigManager { return useSpout; } + public void setEnableMagicLib(final boolean enableMagicLib) { + this.enableMagicLib = enableMagicLib; + } + } diff --git a/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java b/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java index 38aa9cf..9978f8b 100644 --- a/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java +++ b/src/main/java/org/maxgamer/QuickShop/Util/MsgUtil.java @@ -130,6 +130,7 @@ public class MsgUtil { final FancyMessage fm = FancyMessage.newFM(); fm.text(msg).itemTooltip(is).send(p); } catch (Exception | NoClassDefFoundError | NoSuchMethodError e) { + plugin.getConfigManager().setEnableMagicLib(false); p.sendMessage(msg); } }