Block badge commands if MySQL is disabled
This commit is contained in:
parent
adc0f41a87
commit
bfadbc9340
2
pom.xml
2
pom.xml
|
@ -4,7 +4,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>FPChatX</groupId>
|
<groupId>FPChatX</groupId>
|
||||||
<artifactId>FPChatX</artifactId>
|
<artifactId>FPChatX</artifactId>
|
||||||
<version>1.0.5-BETA</version>
|
<version>1.0.6-BETA</version>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
|
|
|
@ -115,7 +115,10 @@ public class FPChat extends JavaPlugin {
|
||||||
refresh.cancel();
|
refresh.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(config.mySQLEnabled()) {
|
||||||
sql.disconnect();
|
sql.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
for(FPlayer p : FPlayer.getPlayers()) {
|
for(FPlayer p : FPlayer.getPlayers()) {
|
||||||
p.cleanup();
|
p.cleanup();
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,6 +31,13 @@ public class BadgeClearCommand extends Commands {
|
||||||
FPlayer.errMsg(null, "This command is for players only.");
|
FPlayer.errMsg(null, "This command is for players only.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(!plugin.getMainConfig().mySQLEnabled()) {
|
||||||
|
FPlayer.errMsg(null, "MySQL is not enabled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
FPlayer p = FPlayer.getPlayer((Player)sender);
|
FPlayer p = FPlayer.getPlayer((Player)sender);
|
||||||
BadgeSet.setBadge(p, 1, 0);
|
BadgeSet.setBadge(p, 1, 0);
|
||||||
BadgeSet.setBadge(p, 2, 0);
|
BadgeSet.setBadge(p, 2, 0);
|
||||||
|
|
|
@ -35,6 +35,11 @@ public class BadgeEquipCommand extends Commands {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!plugin.getMainConfig().mySQLEnabled()) {
|
||||||
|
FPlayer.errMsg(null, "MySQL is not enabled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
FPlayer p = FPlayer.getPlayer((Player)sender);
|
FPlayer p = FPlayer.getPlayer((Player)sender);
|
||||||
if(Util.isDigit(args[0]) && Util.isDigit(args[1])){
|
if(Util.isDigit(args[0]) && Util.isDigit(args[1])){
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,12 @@ public class BadgeListCommand extends Commands {
|
||||||
FPlayer.errMsg(null, "This command is for players only.");
|
FPlayer.errMsg(null, "This command is for players only.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!plugin.getMainConfig().mySQLEnabled()) {
|
||||||
|
FPlayer.errMsg(null, "MySQL is not enabled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
FPlayer p = FPlayer.getPlayer((Player)sender);
|
FPlayer p = FPlayer.getPlayer((Player)sender);
|
||||||
if(args.length == 0 || !Util.isDigit(args[0])){
|
if(args.length == 0 || !Util.isDigit(args[0])){
|
||||||
BadgeList.badgeList(p, 1);
|
BadgeList.badgeList(p, 1);
|
||||||
|
|
Loading…
Reference in New Issue