Added config option to block fireball world damage only. Thanks Qalthos

This commit is contained in:
Wizjany 2011-06-28 00:58:13 -04:00
parent cfffba25cf
commit 1e24e9c128
2 changed files with 7 additions and 0 deletions

View File

@ -96,6 +96,7 @@ public class WorldConfiguration {
public Set<Integer> allowedLavaSpreadOver; public Set<Integer> allowedLavaSpreadOver;
public boolean blockCreeperExplosions; public boolean blockCreeperExplosions;
public boolean blockCreeperBlockDamage; public boolean blockCreeperBlockDamage;
public boolean blockFireballBlockDamage;
public int loginProtection; public int loginProtection;
public int spawnProtection; public int spawnProtection;
public boolean kickOnDeath; public boolean kickOnDeath;
@ -275,6 +276,7 @@ private void loadConfiguration() {
blockCreeperExplosions = getBoolean("mobs.block-creeper-explosions", false); blockCreeperExplosions = getBoolean("mobs.block-creeper-explosions", false);
blockCreeperBlockDamage = getBoolean("mobs.block-creeper-block-damage", false); blockCreeperBlockDamage = getBoolean("mobs.block-creeper-block-damage", false);
blockFireballBlockDamage = getBoolean("mobs.block-fireball-block-damage", false);
antiWolfDumbness = getBoolean("mobs.anti-wolf-dumbness", false); antiWolfDumbness = getBoolean("mobs.anti-wolf-dumbness", false);
loginProtection = getInt("spawn.login-protection", 3); loginProtection = getInt("spawn.login-protection", 3);

View File

@ -484,6 +484,11 @@ public void onEntityExplode(EntityExplodeEvent event) {
} }
} }
} else if (ent instanceof Fireball) { } else if (ent instanceof Fireball) {
if (wcfg.blockFireballBlockDamage) {
event.setCancelled(true);
return;
}
if (wcfg.useRegions) { if (wcfg.useRegions) {
Vector pt = toVector(l); Vector pt = toVector(l);
RegionManager mgr = plugin.getGlobalRegionManager().get(world); RegionManager mgr = plugin.getGlobalRegionManager().get(world);