mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-27 04:55:25 +01:00
Fix auto-ignite-tnt not working with protect: false
This commit is contained in:
parent
d6c1f97415
commit
ea2cb4baf2
@ -232,11 +232,7 @@ public class ArenaListener
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
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
|
||||
@ -246,12 +242,16 @@ public class ArenaListener
|
||||
|
||||
// If the arena isn't running, or if the player isn't in the arena, cancel.
|
||||
if (!arena.isRunning() || !arena.inArena(event.getPlayer())) {
|
||||
event.setCancelled(true);
|
||||
// But only if we're protecting the region
|
||||
if (protect) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// If the block is TNT, set its planter
|
||||
if (b.getType() == Material.TNT) {
|
||||
// If auto-igniting, set the planter of the primed TNT instead
|
||||
if (autoIgniteTNT) {
|
||||
event.setCancelled(true);
|
||||
event.getPlayer().getInventory().removeItem(new ItemStack(Material.TNT, 1));
|
||||
@ -262,6 +262,11 @@ public class ArenaListener
|
||||
setPlanter(b, event.getPlayer());
|
||||
}
|
||||
|
||||
// Any other block we don't care about if we're not protecting
|
||||
if (!protect) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, block was placed during a session.
|
||||
arena.addBlock(b);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user