| package us.myles.ViaVersion.commands.defaultsubs; |
| |
| import org.bukkit.command.CommandSender; |
| import us.myles.ViaVersion.ViaVersionPlugin; |
| import us.myles.ViaVersion.api.ViaVersion; |
| import us.myles.ViaVersion.api.command.ViaSubCommand; |
| |
| public class AutoTeamSubCmd extends ViaSubCommand { |
| @Override |
| public String name() { |
| return "autoteam"; |
| } |
| |
| @Override |
| public String description() { |
| return "Toggle automatically teaming to prevent colliding."; |
| } |
| |
| @Override |
| public boolean execute(CommandSender sender, String[] args) { |
| ViaVersionPlugin plugin = (ViaVersionPlugin) ViaVersion.getInstance(); |
| |
| boolean newValue = !plugin.isAutoTeam(); |
| plugin.getConfig().set("auto-team", newValue); |
| plugin.saveConfig(); |
| sender.sendMessage(color("&6We will " + (newValue ? "&aautomatically team players" : "&cno longer auto team players"))); |
| sender.sendMessage(color("&6All players will need to re-login for the change to take place.")); |
| |
| return true; |
| } |
| } |