package vg.civcraft.mc.citadel.playerstate;

import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;

import vg.civcraft.mc.citadel.Citadel;
import vg.civcraft.mc.citadel.CitadelUtility;
import vg.civcraft.mc.citadel.reinforcementtypes.ReinforcementType;
import vg.civcraft.mc.namelayer.GroupManager;
import vg.civcraft.mc.namelayer.NameAPI;
import vg.civcraft.mc.namelayer.group.Group;

public class NormalState extends AbstractPlayerState {

	public NormalState(Player p) {
		super(p);
		// TODO Auto-generated constructor stub
	}

	@Override
	public String getName() {
		return "Normal mode";
	}

	@Override
	public void handleBlockPlace(BlockPlaceEvent e) {
		Player player = e.getPlayer();
		if (!Citadel.getInstance().getSettingManager().isInEasyMode(player.getUniqueId())) {
			return;
		}
		ItemStack offHand = player.getInventory().getItemInOffHand();
		ReinforcementType type = Citadel.getInstance().getReinforcementTypeManager().getByItemStack(offHand);
		if (type == null) {
			return;
		}
		String defaultGroupName = NameAPI.getGroupManager().getDefaultGroup(player.getUniqueId());
		Group defaultGroup = GroupManager.getGroup(defaultGroupName);
		if (defaultGroup == null) {
			return;
		}
		CitadelUtility.attemptReinforcementCreation(e.getBlock(), type, defaultGroup, player);
	}

	@Override
	public void handleInteractBlock(PlayerInteractEvent e) {

	}

	@Override
	public boolean equals(Object o) {
		return o instanceof NormalState;
	}

	@Override
	public String getOverlayText() {
		return null;
	}

}

@@ -60,21 +60,88 @@
 kit.
-entity.Player
+ChatColor;%0Aimport org.bukkit.entity.Player;%0Aimport org.bukkit.event.block.Action
 ;%0Aim
@@ -316,16 +316,72 @@
 itadel;%0A
+import vg.civcraft.mc.citadel.CitadelPermissionHandler;%0A
 import v
@@ -723,50 +723,8 @@
 p);%0A
-%09%09// TODO Auto-generated constructor stub%0A
 %09%7D%0A%0A
@@ -769,16 +769,34 @@
 %09%09return
+ ChatColor.GREEN +
  %22Normal
@@ -1573,16 +1573,758 @@
 nt e) %7B%0A
+%09%09if (e.getAction() != Action.LEFT_CLICK_BLOCK && e.getAction() != Action.RIGHT_CLICK_BLOCK) %7B%0A%09%09%09return;%0A%09%09%7D%0A%09%09Player player = e.getPlayer();%0A%09%09if (!Citadel.getInstance().getSettingManager().isInEasyMode(player.getUniqueId())) %7B%0A%09%09%09return;%0A%09%09%7D%0A%09%09ItemStack hand = player.getInventory().getItemInMainHand();%0A%09%09ReinforcementType type = Citadel.getInstance().getReinforcementTypeManager().getByItemStack(hand);%0A%09%09if (type == null) %7B%0A%09%09%09return;%0A%09%09%7D%0A%09%09String defaultGroupName = NameAPI.getGroupManager().getDefaultGroup(player.getUniqueId());%0A%09%09Group defaultGroup = GroupManager.getGroup(defaultGroupName);%0A%09%09if (defaultGroup == null) %7B%0A%09%09%09return;%0A%09%09%7D%0A%09%09CitadelUtility.attemptReinforcementCreation(e.getClickedBlock(), type, defaultGroup, player);
 %0A%09%7D%0A%0A%09@O

Implement cte by hitting stuff