mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-09-16 09:06:53 +02:00
Added config option to disable explosion-caused damage to players.
This commit is contained in:
parent
424b580eb9
commit
4850bdefdf
@ -93,6 +93,7 @@ public class WorldConfiguration {
|
|||||||
public boolean teleportOnSuffocation;
|
public boolean teleportOnSuffocation;
|
||||||
public boolean disableVoidDamage;
|
public boolean disableVoidDamage;
|
||||||
public boolean teleportOnVoid;
|
public boolean teleportOnVoid;
|
||||||
|
public boolean disableExplosionDamage;
|
||||||
public boolean useRegions;
|
public boolean useRegions;
|
||||||
public boolean highFreqFlags;
|
public boolean highFreqFlags;
|
||||||
public int regionWand = 287;
|
public int regionWand = 287;
|
||||||
@ -194,6 +195,7 @@ private void loadConfiguration() {
|
|||||||
teleportOnSuffocation = config.getBoolean("player-damage.teleport-on-suffocation", false);
|
teleportOnSuffocation = config.getBoolean("player-damage.teleport-on-suffocation", false);
|
||||||
disableVoidDamage = config.getBoolean("player-damage.disable-void-damage", false);
|
disableVoidDamage = config.getBoolean("player-damage.disable-void-damage", false);
|
||||||
teleportOnVoid = config.getBoolean("player-damage.teleport-on-void-falling", false);
|
teleportOnVoid = config.getBoolean("player-damage.teleport-on-void-falling", false);
|
||||||
|
disableExplosionDamage = config.getBoolean("player-damage.disable-explosion-damage", false);
|
||||||
|
|
||||||
signChestProtection = config.getBoolean("chest-protection.enable", false);
|
signChestProtection = config.getBoolean("chest-protection.enable", false);
|
||||||
|
|
||||||
|
@ -128,6 +128,10 @@ public void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wcfg.disableExplosionDamage && event.getCause() == DamageCause.BLOCK_EXPLOSION) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +155,11 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wcfg.disableExplosionDamage && event.getCause() == DamageCause.ENTITY_EXPLOSION) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (attacker != null && attacker instanceof Player) {
|
if (attacker != null && attacker instanceof Player) {
|
||||||
if (wcfg.useRegions) {
|
if (wcfg.useRegions) {
|
||||||
Vector pt = toVector(defender.getLocation());
|
Vector pt = toVector(defender.getLocation());
|
||||||
|
@ -81,6 +81,7 @@ player-damage:
|
|||||||
teleport-on-suffocation: off
|
teleport-on-suffocation: off
|
||||||
disable-void-damage: off
|
disable-void-damage: off
|
||||||
teleport-on-void-falling: off
|
teleport-on-void-falling: off
|
||||||
|
disable-explosion-damage: off
|
||||||
|
|
||||||
regions:
|
regions:
|
||||||
enable: on
|
enable: on
|
||||||
|
Loading…
Reference in New Issue
Block a user