Added player-damage.disable-tnt-damage.

This commit is contained in:
sk89q 2011-06-27 12:57:33 -07:00
parent 141d5ccd25
commit a5332c2166
2 changed files with 7 additions and 0 deletions

View File

@ -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);

View File

@ -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) {