Tabcomplete for sounds fixed + "citizens-check" added to config

Allows you to disable the self disabling of the plugin.
This commit is contained in:
Mateus 2019-02-19 18:58:16 +00:00
parent f7c9933b02
commit 98fc5bdbe9
3 changed files with 11 additions and 6 deletions

View File

@ -68,7 +68,10 @@ public final class CitizensCMD extends JavaPlugin {
public void onEnable() {
if (!hasCitizens()) {
checkOldConfig(this);
saveDefaultConfig();
if (!hasCitizens() && getConfig().getBoolean("citizens-check")) {
Util.disablePlugin(this);
return;
}
@ -76,8 +79,6 @@ public final class CitizensCMD extends JavaPlugin {
commandHandler = new CommandHandler(this);
commandHandler.enable();
checkOldConfig(this);
new Metrics(this);
info(color(TAG + "&3Citizens&cCMD &8&o" + getDescription().getVersion() + " &8By &3Mateus Moreira &c@LichtHund"));
@ -90,7 +91,6 @@ public final class CitizensCMD extends JavaPlugin {
cooldownHandler = new CooldownHandler(this);
Bukkit.getScheduler().scheduleSyncDelayedTask(this, () -> cooldownHandler.initialize(), 30L);
saveDefaultConfig();
registerCommands();
registerEvents();

View File

@ -157,7 +157,9 @@ public class CommandHandler implements CommandExecutor, TabCompleter, IHandler {
switch (subCMD) {
case "add":
if (args.length == 2) return getCommandNames(subCMD, args, 1, (Player) sender);
if (args.length == 3) return getCommandNames(subCMD, args, 2, (Player) sender);
if (args[1].equalsIgnoreCase("sound")) {
if (args.length == 3) return getCommandNames(subCMD, args, 2, (Player) sender);
}
break;
case "remove":

View File

@ -19,4 +19,7 @@ default-cooldown: 0
shift-confirm: true
#
# Select cooldown display format, SHORT = 3m 3s | MEDIUM = 3 min 3 sec | FULL - 3 minutes 3 seconds
cooldown-time-display: MEDIUM
cooldown-time-display: MEDIUM
#
# Disables citizens check on startup
citizens-check: true