Fixed flags, added separate lava flow flag.

This commit is contained in:
sk89q 2011-04-02 17:43:01 -07:00
parent 48b00874e5
commit b823446e28
3 changed files with 11 additions and 5 deletions

View File

@ -188,7 +188,13 @@ public void onBlockFromTo(BlockFromToEvent event) {
}
}
if (!plugin.getGlobalRegionManager().allows(DefaultFlag.WATER_FLOW,
if (isWater && !plugin.getGlobalRegionManager().allows(DefaultFlag.WATER_FLOW,
blockFrom.getLocation())) {
event.setCancelled(true);
return;
}
if (isLava && !plugin.getGlobalRegionManager().allows(DefaultFlag.LAVA_FLOW,
blockFrom.getLocation())) {
event.setCancelled(true);
return;

View File

@ -124,7 +124,8 @@ public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
}
}
if (attacker != null && attacker instanceof Monster) {
if (attacker != null && attacker instanceof LivingEntity
&& !(attacker instanceof Player)) {
if (attacker instanceof Creeper && wcfg.blockCreeperExplosions) {
event.setCancelled(true);
return;
@ -283,8 +284,6 @@ public void onEntityExplode(EntityExplodeEvent event) {
WorldConfiguration wcfg = cfg.get(world);
if (event.getEntity() instanceof LivingEntity) {
if (wcfg.blockCreeperBlockDamage) {
event.setCancelled(true);
return;

View File

@ -36,6 +36,7 @@ public final class DefaultFlag {
public static final StateFlag LAVA_FIRE = new StateFlag("lava-fire", 'F', true);
public static final StateFlag CHEST_ACCESS = new StateFlag("chest-access", 'C', false);
public static final StateFlag WATER_FLOW = new StateFlag("water-flow", true);
public static final StateFlag LAVA_FLOW = new StateFlag("lava-flow", true);
public static final StateFlag USE = new StateFlag("use", false);
public static final StateFlag PLACE_VEHICLE = new StateFlag("vehicle-place", false);
public static final StringFlag GREET_MESSAGE = new StringFlag("greet-message");
@ -54,7 +55,7 @@ public final class DefaultFlag {
public static final Flag<?>[] flagsList = new Flag<?>[] {
PASSTHROUGH, BUILD, PVP, MOB_DAMAGE, CREEPER_EXPLOSION,
TNT, LIGHTER, FIRE_SPREAD, LAVA_FIRE, CHEST_ACCESS, WATER_FLOW,
TNT, LIGHTER, FIRE_SPREAD, LAVA_FIRE, CHEST_ACCESS, WATER_FLOW, LAVA_FLOW,
USE, PLACE_VEHICLE, GREET_MESSAGE, FAREWELL_MESSAGE, NOTIFY_GREET,
NOTIFY_FAREWELL, DENY_SPAWN, HEAL_DELAY, HEAL_AMOUNT, TELE_LOC,
TELE_PERM, SPAWN_LOC, SPAWN_PERM, BUYABLE, PRICE