mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-24 03:25:24 +01:00
Made TNT blocking work.
This commit is contained in:
parent
c3f0bbb41c
commit
430f2f57e9
@ -48,7 +48,7 @@ public void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
|
||||
Entity defender = event.getEntity();
|
||||
DamageCause type = event.getCause();
|
||||
|
||||
if (defender instanceof Player) {
|
||||
if (defender instanceof Player) {
|
||||
Player player = (Player)defender;
|
||||
|
||||
if (plugin.invinciblePlayers.contains(player.getName())) {
|
||||
@ -133,6 +133,20 @@ public void onEntityExplode(EntityExplodeEvent event) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else { // Shall assume that this is TNT
|
||||
if (plugin.blockTNT) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (plugin.useRegions) {
|
||||
Vector pt = toVector(event.getEntity().getLocation());
|
||||
|
||||
if (!plugin.regionManager.getApplicableRegions(pt).allowsTNT()) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user