mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2025-01-26 01:51:19 +01:00
Added player-damage.disable-tnt-damage.
This commit is contained in:
parent
141d5ccd25
commit
a5332c2166
@ -89,6 +89,7 @@ public class WorldConfiguration {
|
||||
public Set<Integer> preventWaterDamage;
|
||||
public boolean blockTNT;
|
||||
public boolean blockLighter;
|
||||
public boolean disableTNTDamage;
|
||||
public boolean disableFireSpread;
|
||||
public Set<Integer> disableFireSpreadBlocks;
|
||||
public boolean preventLavaFire;
|
||||
@ -277,6 +278,7 @@ private void loadConfiguration() {
|
||||
exactRespawn = getBoolean("spawn.exact-respawn", false);
|
||||
teleportToHome = getBoolean("spawn.teleport-to-home-on-death", false);
|
||||
|
||||
disableTNTDamage = getBoolean("player-damage.disable-tnt-damage", false);
|
||||
disableFallDamage = getBoolean("player-damage.disable-fall-damage", false);
|
||||
disableLavaDamage = getBoolean("player-damage.disable-lava-damage", false);
|
||||
disableFireDamage = getBoolean("player-damage.disable-fire-damage", false);
|
||||
|
@ -237,6 +237,11 @@ private void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
}
|
||||
}
|
||||
|
||||
if (attacker != null && attacker instanceof TNTPrimed && wcfg.disableTNTDamage) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (attacker != null && attacker instanceof LivingEntity
|
||||
&& !(attacker instanceof Player)) {
|
||||
if (attacker instanceof Creeper && wcfg.blockCreeperExplosions) {
|
||||
|
Loading…
Reference in New Issue
Block a user