mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-04-21 02:56:23 +02:00

console. These commands now default to OP, because frankly there are much worse things someone can do with OP status than mess with the mcMMO database.
39 lines
1.1 KiB
Java
39 lines
1.1 KiB
Java
package com.gmail.nossr50.commands.database;
|
|
|
|
import java.util.List;
|
|
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.command.TabExecutor;
|
|
|
|
import com.gmail.nossr50.mcMMO;
|
|
import com.gmail.nossr50.config.Config;
|
|
import com.gmail.nossr50.locale.LocaleLoader;
|
|
|
|
import com.google.common.collect.ImmutableList;
|
|
|
|
public class McpurgeCommand implements TabExecutor {
|
|
@Override
|
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
|
switch (args.length) {
|
|
case 0:
|
|
mcMMO.getDatabaseManager().purgePowerlessUsers();
|
|
|
|
if (Config.getInstance().getOldUsersCutoff() != -1) {
|
|
mcMMO.getDatabaseManager().purgeOldUsers();
|
|
}
|
|
|
|
sender.sendMessage(LocaleLoader.getString("Commands.mcpurge.Success"));
|
|
return true;
|
|
|
|
default:
|
|
return false;
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
|
|
return ImmutableList.of();
|
|
}
|
|
}
|