diff --git a/pom.xml b/pom.xml index 4fdc86f..f90e2d5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 FPChatX FPChatX - 1.0.5-BETA + 1.0.6-BETA spigot-repo diff --git a/src/main/java/com/fpghoti/fpchatx/FPChat.java b/src/main/java/com/fpghoti/fpchatx/FPChat.java index 39e0546..522c7e9 100644 --- a/src/main/java/com/fpghoti/fpchatx/FPChat.java +++ b/src/main/java/com/fpghoti/fpchatx/FPChat.java @@ -64,7 +64,7 @@ public class FPChat extends JavaPlugin { private BukkitTask refresh = null; private PlayerListener listener = null; private PlayerCache cache; - + public void onEnable() { plugin = this; VaultUtil vault = new VaultUtil(this); @@ -115,7 +115,10 @@ public class FPChat extends JavaPlugin { refresh.cancel(); } - sql.disconnect(); + if(config.mySQLEnabled()) { + sql.disconnect(); + } + for(FPlayer p : FPlayer.getPlayers()) { p.cleanup(); } @@ -185,7 +188,7 @@ public class FPChat extends JavaPlugin { public MainConfig getMainConfig() { return this.config; } - + public PlayerCache getPlayerCache() { return this.cache; } diff --git a/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeClearCommand.java b/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeClearCommand.java index ab5ffc0..39a3135 100644 --- a/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeClearCommand.java +++ b/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeClearCommand.java @@ -31,6 +31,13 @@ public class BadgeClearCommand extends Commands { FPlayer.errMsg(null, "This command is for players only."); return; } + + + if(!plugin.getMainConfig().mySQLEnabled()) { + FPlayer.errMsg(null, "MySQL is not enabled."); + return; + } + FPlayer p = FPlayer.getPlayer((Player)sender); BadgeSet.setBadge(p, 1, 0); BadgeSet.setBadge(p, 2, 0); diff --git a/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeEquipCommand.java b/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeEquipCommand.java index 95c9cf4..ace7aa4 100644 --- a/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeEquipCommand.java +++ b/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeEquipCommand.java @@ -35,6 +35,11 @@ public class BadgeEquipCommand extends Commands { return; } + if(!plugin.getMainConfig().mySQLEnabled()) { + FPlayer.errMsg(null, "MySQL is not enabled."); + return; + } + FPlayer p = FPlayer.getPlayer((Player)sender); if(Util.isDigit(args[0]) && Util.isDigit(args[1])){ diff --git a/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeListCommand.java b/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeListCommand.java index 5074d42..2b8db8e 100644 --- a/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeListCommand.java +++ b/src/main/java/com/fpghoti/fpchatx/command/commands/BadgeListCommand.java @@ -32,6 +32,12 @@ public class BadgeListCommand extends Commands { FPlayer.errMsg(null, "This command is for players only."); return; } + + if(!plugin.getMainConfig().mySQLEnabled()) { + FPlayer.errMsg(null, "MySQL is not enabled."); + return; + } + FPlayer p = FPlayer.getPlayer((Player)sender); if(args.length == 0 || !Util.isDigit(args[0])){ BadgeList.badgeList(p, 1);