diff --git a/bin/me/Travja/HungerArena/BlockStorage.class b/bin/me/Travja/HungerArena/BlockStorage.class index 709700d..90761eb 100644 Binary files a/bin/me/Travja/HungerArena/BlockStorage.class and b/bin/me/Travja/HungerArena/BlockStorage.class differ diff --git a/bin/me/Travja/HungerArena/Main$3$1.class b/bin/me/Travja/HungerArena/Main$3$1.class index f4a716f..7afbd29 100644 Binary files a/bin/me/Travja/HungerArena/Main$3$1.class and b/bin/me/Travja/HungerArena/Main$3$1.class differ diff --git a/bin/me/Travja/HungerArena/Main$3$2.class b/bin/me/Travja/HungerArena/Main$3$2.class index 80957fe..959b32e 100644 Binary files a/bin/me/Travja/HungerArena/Main$3$2.class and b/bin/me/Travja/HungerArena/Main$3$2.class differ diff --git a/bin/me/Travja/HungerArena/Main$3.class b/bin/me/Travja/HungerArena/Main$3.class index 02c1736..1b41f59 100644 Binary files a/bin/me/Travja/HungerArena/Main$3.class and b/bin/me/Travja/HungerArena/Main$3.class differ diff --git a/bin/me/Travja/HungerArena/Main.class b/bin/me/Travja/HungerArena/Main.class index 3e9627c..3f3f698 100644 Binary files a/bin/me/Travja/HungerArena/Main.class and b/bin/me/Travja/HungerArena/Main.class differ diff --git a/src/me/Travja/HungerArena/BlockStorage.java b/src/me/Travja/HungerArena/BlockStorage.java index 8c1a7b4..9e6cf31 100644 --- a/src/me/Travja/HungerArena/BlockStorage.java +++ b/src/me/Travja/HungerArena/BlockStorage.java @@ -41,28 +41,30 @@ public class BlockStorage implements Listener { if (plugin.getArena(p) != null || !protall) { //int a = this.plugin.getArena(p).intValue(); int a = 1; //Jeppa: define a default (may be needed if protall is true) - if (plugin.getArena(p) != null) a = plugin.getArena(p); - if (!event.isCancelled() && plugin.Playing.get(a).contains(pname)){ - if (plugin.config.getString("Protected_Arena").equalsIgnoreCase("True")) { - event.setCancelled(true); - p.sendMessage(ChatColor.RED + "You can't break blocks while playing!"); - } else if ((((plugin.canjoin.get(a))) || (protall)) && ((plugin.config.getStringList("worlds").isEmpty()) || ((!plugin.config.getStringList("worlds").isEmpty()) && (plugin.config.getStringList("worlds").contains(p.getWorld().getName()))))) { - if (((plugin.management.getIntegerList("blocks.whitelist").isEmpty()) || ((!plugin.management.getIntegerList("blocks.whitelist").isEmpty()) && (!plugin.management.getIntegerList("blocks.whitelist").contains(Integer.valueOf(b.getTypeId()))))) ^ (plugin.management.getBoolean("blocks.useWhitelistAsBlacklist"))) { + if (plugin.getArena(p) != null){ + a = plugin.getArena(p); + if (!event.isCancelled() && plugin.Playing.get(a).contains(pname)){ + if (plugin.config.getString("Protected_Arena").equalsIgnoreCase("True")) { event.setCancelled(true); - p.sendMessage(ChatColor.RED + "That is an illegal block!"); - } else { - String w = b.getWorld().getName(); - int x = b.getX(); - int y = b.getY(); - int z = b.getZ(); - int d = b.getTypeId(); - byte m = b.getData(); - String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + a; - List blocks = plugin.data.getStringList("Blocks_Destroyed"); - if (!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + a)) { - blocks.add(coords); - plugin.data.set("Blocks_Destroyed", blocks); - plugin.saveData(); + p.sendMessage(ChatColor.RED + "You can't break blocks while playing!"); + } else if ((((plugin.canjoin.get(a))) || (protall)) && ((plugin.config.getStringList("worlds").isEmpty()) || ((!plugin.config.getStringList("worlds").isEmpty()) && (plugin.config.getStringList("worlds").contains(p.getWorld().getName()))))) { + if (((plugin.management.getIntegerList("blocks.whitelist").isEmpty()) || ((!plugin.management.getIntegerList("blocks.whitelist").isEmpty()) && (!plugin.management.getIntegerList("blocks.whitelist").contains(Integer.valueOf(b.getTypeId()))))) ^ (plugin.management.getBoolean("blocks.useWhitelistAsBlacklist"))) { + event.setCancelled(true); + p.sendMessage(ChatColor.RED + "That is an illegal block!"); + } else { + String w = b.getWorld().getName(); + int x = b.getX(); + int y = b.getY(); + int z = b.getZ(); + int d = b.getTypeId(); + byte m = b.getData(); + String coords = w + "," + x + "," + y + "," + z + "," + d + "," + m + "," + a; + List blocks = plugin.data.getStringList("Blocks_Destroyed"); + if (!plugin.data.getStringList("Blocks_Placed").contains(w + "," + x + "," + y + "," + z + "," + a)) { + blocks.add(coords); + plugin.data.set("Blocks_Destroyed", blocks); + plugin.saveData(); + } } } } diff --git a/src/me/Travja/HungerArena/Main.java b/src/me/Travja/HungerArena/Main.java index 46d8e10..f713651 100644 --- a/src/me/Travja/HungerArena/Main.java +++ b/src/me/Travja/HungerArena/Main.java @@ -450,6 +450,7 @@ public class Main extends JavaPlugin{ } }else getServer().broadcastMessage(ChatColor.GREEN + "Grace period is over, FIGHT!"); + getServer().getScheduler().cancelTask(grace); } } },20L, 20L);