Merge leafdecay flag from zml2008

This commit is contained in:
Wizjany 2011-05-27 19:05:27 -04:00
parent 846cf63268
commit 26946feecc
2 changed files with 14 additions and 1 deletions

View File

@ -67,6 +67,7 @@ public void registerEvents() {
pm.registerEvent(Event.Type.SIGN_CHANGE, this, Priority.High, plugin);
pm.registerEvent(Event.Type.REDSTONE_CHANGE, this, Priority.High, plugin);
pm.registerEvent(Event.Type.SNOW_FORM, this, Priority.High, plugin);
pm.registerEvent(Event.Type.LEAVES_DECAY, this, Priority.High, plugin);
}
protected WorldConfiguration getWorldConfig(World world) {
@ -554,6 +555,17 @@ public void onSnowForm(SnowFormEvent event) {
event.setCancelled(true);
}
}
@Override
public void onLeavesDecay(LeavesDecayEvent event) {
if (event.isCancelled()) {
return;
}
if (!plugin.getGlobalRegionManager().allows(DefaultFlag.LEAF_DECAY, event.getBlock().getLocation())) {
event.setCancelled(true);
}
}
/**
* Drops a sign item and removes a sign.
*

View File

@ -44,6 +44,7 @@ public final class DefaultFlag {
public static final StateFlag USE = new StateFlag("use", false);
public static final StateFlag PLACE_VEHICLE = new StateFlag("vehicle-place", false);
public static final StateFlag SNOW_FALL = new StateFlag("snow-fall", true);
public static final StateFlag LEAF_DECAY = new StateFlag("leaf-decay", true);
public static final StringFlag GREET_MESSAGE = new StringFlag("greeting");
public static final StringFlag FAREWELL_MESSAGE = new StringFlag("farewell");
public static final BooleanFlag NOTIFY_GREET = new BooleanFlag("notify-greet");
@ -63,7 +64,7 @@ public final class DefaultFlag {
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, SNOW_FALL,
TELE_PERM, SPAWN_LOC, SPAWN_PERM, BUYABLE, PRICE, SNOW_FALL, LEAF_DECAY,
GHAST_FIREBALL
};