mirror of
https://github.com/taoneill/war.git
synced 2024-11-13 05:54:31 +01:00
Don't burn important blocks. Fixes #697
This commit is contained in:
parent
9e6b0d9f17
commit
a039e65a8a
@ -9,6 +9,7 @@ import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
@ -239,6 +240,14 @@ public class WarBlockListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBlockBurn(final BlockBurnEvent event) {
|
||||
Warzone zone = Warzone.getZoneByLocation(event.getBlock().getLocation());
|
||||
if (zone != null && zone.isImportantBlock(event.getBlock())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleBreakOrDamage(Player player, Block block, Cancellable event) {
|
||||
Warzone warzone = Warzone.getZoneByLocation(player);
|
||||
Team team = Team.getTeamByPlayerName(player.getName());
|
||||
|
Loading…
Reference in New Issue
Block a user