package me.stefvanschie.buildinggame.events.block;

import me.stefvanschie.buildinggame.managers.arenas.ArenaManager;
import me.stefvanschie.buildinggame.managers.messages.MessageManager;
import me.stefvanschie.buildinggame.utils.Arena;
import me.stefvanschie.buildinggame.utils.GameState;
import me.stefvanschie.buildinggame.utils.Plot;

import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;

public class BlockBreak implements Listener {

	@EventHandler
	public void onBlockBreak(BlockBreakEvent e) {
		Player player = e.getPlayer();
		
		if (ArenaManager.getInstance().getArena(player) == null) {
			return;
		}
		
		Arena arena = ArenaManager.getInstance().getArena(player);
		Plot plot = arena.getPlot(player);
		
		if (arena.getState() != GameState.BUILDING) {
			return;
		}
		
		if (!plot.getBoundary().isInside(e.getBlock().getLocation())) {
			MessageManager.getInstance().send(player, ChatColor.RED + "You can't build here!");
			e.setCancelled(true);
			return;
		}
	}
}

@@ -325,16 +325,21 @@
 e.utils.
+plot.
 Plot;%0A%0Ai

Update BlockBreak.java