Block badge commands if MySQL is disabled

This commit is contained in:
Ghoti 2020-03-13 02:22:39 -05:00
parent adc0f41a87
commit bfadbc9340
5 changed files with 25 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>FPChatX</groupId>
<artifactId>FPChatX</artifactId>
<version>1.0.5-BETA</version>
<version>1.0.6-BETA</version>
<repositories>
<repository>
<id>spigot-repo</id>

View File

@ -115,7 +115,10 @@ public class FPChat extends JavaPlugin {
refresh.cancel();
}
if(config.mySQLEnabled()) {
sql.disconnect();
}
for(FPlayer p : FPlayer.getPlayers()) {
p.cleanup();
}

View File

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

View File

@ -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])){

View File

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