From 92c4ce1a8ba5e441ca670bd3690c9db58a4d852f Mon Sep 17 00:00:00 2001 From: garbagemule Date: Tue, 11 Feb 2014 17:27:37 +0100 Subject: [PATCH] Fix per-arena protect flag. --- resources/plugin.yml | 2 +- .../garbagemule/MobArena/ArenaListener.java | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/resources/plugin.yml b/resources/plugin.yml index 869c007..46da60a 100644 --- a/resources/plugin.yml +++ b/resources/plugin.yml @@ -1,7 +1,7 @@ name: MobArena author: garbagemule main: com.garbagemule.MobArena.MobArena -version: 0.96.2.9 +version: 0.96.2.10 softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault] commands: ma: diff --git a/src/com/garbagemule/MobArena/ArenaListener.java b/src/com/garbagemule/MobArena/ArenaListener.java index 94bdcb2..7df107d 100644 --- a/src/com/garbagemule/MobArena/ArenaListener.java +++ b/src/com/garbagemule/MobArena/ArenaListener.java @@ -154,6 +154,9 @@ public class ArenaListener arena.getRegion().set("leaderboard", null); } } + + // If the arena isn't protected, care + if (!protect) return; if (!arena.getRegion().contains(event.getBlock().getLocation())) return; @@ -172,6 +175,9 @@ public class ArenaListener } public void onHangingBreak(HangingBreakEvent event) { + // If the arena isn't protected, care + if (!protect) return; + Location l = event.getEntity().getLocation(); if (!arena.getRegion().contains(l)) { return; @@ -183,6 +189,9 @@ public class ArenaListener } public void onBlockBurn(BlockBurnEvent event) { + // If the arena isn't protected, care + if (!protect) return; + if (!arena.getRegion().contains(event.getBlock().getLocation()) || onBlockDestroy(event)) return; @@ -227,6 +236,9 @@ public class ArenaListener } public void onBlockPlace(BlockPlaceEvent event) { + // If the arena isn't protected, care + if (!protect) return; + Block b = event.getBlock(); // If the event didn't happen in the region, or if in edit mode, ignore @@ -276,6 +288,9 @@ public class ArenaListener } public void onBlockForm(BlockFormEvent event) { + // If the arena isn't protected, care + if (!protect) return; + if (!arena.getRegion().contains(event.getBlock().getLocation())) return; @@ -285,6 +300,9 @@ public class ArenaListener } public void onBlockIgnite(BlockIgniteEvent event) { + // If the arena isn't protected, care + if (!protect) return; + Block b = event.getBlock(); if (!arena.getRegion().contains(b.getLocation())) return;