@@ -0,0 +1,2142 @@
+package me.stefvanschie.listeners.blocks;%0A%0Aimport java.util.Map.Entry;%0A%0Aimport me.stefvanschie.BuildingGame;%0A%0Aimport org.bukkit.Bukkit;%0Aimport org.bukkit.ChatColor;%0Aimport org.bukkit.Location;%0Aimport org.bukkit.World;%0Aimport org.bukkit.block.Block;%0Aimport org.bukkit.entity.Player;%0Aimport org.bukkit.event.EventHandler;%0Aimport org.bukkit.event.Listener;%0Aimport org.bukkit.event.block.BlockBreakEvent;%0A%0Apublic class Break implements Listener %7B%0A%09%0A%09@EventHandler%0A%09public void onBlockBreak (BlockBreakEvent e) %7B%0A%09%09String arena = BuildingGame.main.players.get(e.getPlayer());%0A%09%09int place = 0;%0A%09%09Player player = e.getPlayer();%0A%09%09%0A%09%09for (Entry%3CInteger, Player%3E entry : BuildingGame.main.playernumbers.entrySet()) %7B%0A%09%09%09if (entry.getValue() == player) %7B%0A%09%09%09%09place = entry.getKey();%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09Block block = e.getBlock();%0A%09%09Location location = block.getLocation();%0A%09%09World world = location.getWorld();%0A%09%09int x = location.getBlockX();%0A%09%09int y = location.getBlockY();%0A%09%09int z = location.getBlockZ();%0A%09%09%0A%09%09try %7B%0A%09%09%09if (world == Bukkit.getWorld(BuildingGame.main.arenas.getString(arena + %22.%22 + place + %22.%22 + %22.low.world%22))) %7B%7D%0A%09%09%09else %7B%0A%09%09%09%09player.sendMessage(ChatColor.RED + %22You can't build here!%22);%0A%09%09%09%09e.setCancelled(true);%0A%09%09%09%7D%0A%09%09%09if (x %3E= BuildingGame.main.arenas.getInt(arena + %22.%22 + place + %22.low.x%22) && x %3C= BuildingGame.main.arenas.getInt(arena + %22.%22 + place + %22.high.x%22)) %7B%7D%0A%09%09%09else %7B%0A%09%09%09%09player.sendMessage(ChatColor.RED + %22You can't build here!%22);%0A%09%09%09%09e.setCancelled(true);%0A%09%09%09%7D%0A%09%09%09if (y %3E= BuildingGame.main.arenas.getInt(arena + %22.%22 + place + %22.low.y%22) && y %3C= BuildingGame.main.arenas.getInt(arena + %22.%22 + place + %22.high.y%22)) %7B%7D %0A%09%09%09else %7B%0A%09%09%09%09player.sendMessage(ChatColor.RED + %22You can't build here!%22);%0A%09%09%09%09e.setCancelled(true);%0A%09%09%09%7D%0A%09%09%09if (z %3E= BuildingGame.main.arenas.getInt(arena + %22.%22 + place + %22.low.z%22) && z %3C= BuildingGame.main.arenas.getInt(arena + %22.%22 + place + %22.high.z%22)) %7B%7D%0A%09%09%09else %7B%0A%09%09%09%09player.sendMessage(ChatColor.RED + %22You can't build here!%22);%0A%09%09%09%09e.setCancelled(true);%0A%09%09%09%7D%0A%09%09%7D catch (Exception exception) %7B%0A%09%09%09//if the place isn't initialized, otherwise players would get an error when they break a block%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Create Break.java