Fix per-arena protect flag.

This commit is contained in:
garbagemule
2014-02-11 17:27:37 +01:00
parent ea497e42c2
commit 92c4ce1a8b
2 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
name: MobArena name: MobArena
author: garbagemule author: garbagemule
main: com.garbagemule.MobArena.MobArena main: com.garbagemule.MobArena.MobArena
version: 0.96.2.9 version: 0.96.2.10
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault] softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
commands: commands:
ma: ma:
@@ -155,6 +155,9 @@ public class ArenaListener
} }
} }
// If the arena isn't protected, care
if (!protect) return;
if (!arena.getRegion().contains(event.getBlock().getLocation())) if (!arena.getRegion().contains(event.getBlock().getLocation()))
return; return;
@@ -172,6 +175,9 @@ public class ArenaListener
} }
public void onHangingBreak(HangingBreakEvent event) { public void onHangingBreak(HangingBreakEvent event) {
// If the arena isn't protected, care
if (!protect) return;
Location l = event.getEntity().getLocation(); Location l = event.getEntity().getLocation();
if (!arena.getRegion().contains(l)) { if (!arena.getRegion().contains(l)) {
return; return;
@@ -183,6 +189,9 @@ public class ArenaListener
} }
public void onBlockBurn(BlockBurnEvent event) { public void onBlockBurn(BlockBurnEvent event) {
// If the arena isn't protected, care
if (!protect) return;
if (!arena.getRegion().contains(event.getBlock().getLocation()) || onBlockDestroy(event)) if (!arena.getRegion().contains(event.getBlock().getLocation()) || onBlockDestroy(event))
return; return;
@@ -227,6 +236,9 @@ public class ArenaListener
} }
public void onBlockPlace(BlockPlaceEvent event) { public void onBlockPlace(BlockPlaceEvent event) {
// If the arena isn't protected, care
if (!protect) return;
Block b = event.getBlock(); Block b = event.getBlock();
// If the event didn't happen in the region, or if in edit mode, ignore // 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) { public void onBlockForm(BlockFormEvent event) {
// If the arena isn't protected, care
if (!protect) return;
if (!arena.getRegion().contains(event.getBlock().getLocation())) if (!arena.getRegion().contains(event.getBlock().getLocation()))
return; return;
@@ -285,6 +300,9 @@ public class ArenaListener
} }
public void onBlockIgnite(BlockIgniteEvent event) { public void onBlockIgnite(BlockIgniteEvent event) {
// If the arena isn't protected, care
if (!protect) return;
Block b = event.getBlock(); Block b = event.getBlock();
if (!arena.getRegion().contains(b.getLocation())) if (!arena.getRegion().contains(b.getLocation()))
return; return;