package vg.civcraft.mc.citadel.command.commands;

import java.util.ArrayList;
import java.util.List;

import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import vg.civcraft.mc.citadel.PlayerState;

public class ToggleEasyMode extends PlayerCommandMiddle {

	public ToggleEasyMode(String name) {
		super(name);
		setIdentifier("cte");
		setDescription("Toggle easy mode");
		setUsage("/cte");
		setArguments(0, 0);
	}

	@Override
	public boolean execute(CommandSender sender, String[] args) {
		if (!(sender instanceof Player)) {
			sender.sendMessage("Must be a player to perform that command.");
			return true;
		}
		Player p = (Player) sender;
		PlayerState state = PlayerState.get(p);
		if (state.toggleEasyMode()) {
			sendAndLog(p, ChatColor.GREEN, "Easy mode has been enabled.");
		} else {
			sendAndLog(p, ChatColor.GREEN, "Easy mode has been disabled.");
		}
		return true;
	}

	@Override
	public List<String> tabComplete(CommandSender sender, String[] args) {
		return new ArrayList<String>();
	}

}

@@ -433,16 +433,25 @@
 ge(%22/cte
+ %5Bon%7Coff%5D
 %22);%0A%09%09se
@@ -464,17 +464,17 @@
 ents(0, 
-0
+1
 );%0A%09%7D%0A%0A%09
@@ -701,16 +701,16 @@
 sender;%0A
-
 %09%09Player
@@ -743,16 +743,495 @@
 get(p);%0A
+%09%09if (args.length == 1) %7B%0A%09%09%09if (args%5B0%5D.equalsIgnoreCase(%22on%22)) %7B%0A%09%09%09%09if (!state.getEasyMode()) %7B%0A%09%09%09%09%09state.toggleEasyMode();%0A%09%09%09%09%7D%0A%09%09%09%09sendAndLog(p, ChatColor.GREEN, %22Easy mode has been enabled.%22);%0A%09%09%09%7D else if (args%5B0%5D.equalsIgnoreCase(%22off%22)) %7B%0A%09%09%09%09if (state.getEasyMode()) %7B%0A%09%09%09%09%09state.toggleEasyMode();%0A%09%09%09%09%7D%0A%09%09%09%09sendAndLog(p, ChatColor.GREEN, %22Easy mode has been disabled.%22);%0A%09%09%09%7D else %7B%0A%09%09%09%09sendAndLog(p, ChatColor.RED, %22Usage: /cte %5Bon%7Coff%5D%22);%0A%09%09%09%7D%0A%09%09%09return true;%0A%09%09%7D%0A
 %09%09if (st

Make /cte idempotent (non-stateful)