Revert "Added allow-flight boolean flag for regions"

This conflicted with plugins maually setting a player's allow flight setting
This reverts commit 16ce56c1ad.
This commit is contained in:
zml2008 2012-03-31 07:53:42 -07:00
parent fe62c8d0c5
commit a7d198893e
4 changed files with 2 additions and 26 deletions

View File

@ -1,6 +1,4 @@
5.5.2: 5.5.2:
- Added 'allow-flight' flag, which allows or disallows flight per-region
- Restructured /region list
- A cancellable event is now fired if WorldGuard disallows PvP. (for developers!) - A cancellable event is now fired if WorldGuard disallows PvP. (for developers!)
- Made /region setparent check worldguard.region.setparent.own/member.<parent> instead of worldguard.region.setparent.own/member.<child>. - Made /region setparent check worldguard.region.setparent.own/member.<parent> instead of worldguard.region.setparent.own/member.<child>.
- Allowed passing #<index> in place of a region ID, where <index> is the index as displayed by /region list. - Allowed passing #<index> in place of a region ID, where <index> is the index as displayed by /region list.

View File

@ -220,7 +220,6 @@ public static class PlayerFlagState {
public Boolean lastExitAllowed = null; public Boolean lastExitAllowed = null;
public Boolean notifiedForLeave = false; public Boolean notifiedForLeave = false;
public Boolean notifiedForEnter = false; public Boolean notifiedForEnter = false;
public Boolean lastAllowFlight = null;
public World lastWorld; public World lastWorld;
public int lastBlockX; public int lastBlockX;
public int lastBlockY; public int lastBlockY;

View File

@ -65,7 +65,6 @@
import com.sk89q.worldguard.protection.flags.DefaultFlag; import com.sk89q.worldguard.protection.flags.DefaultFlag;
import com.sk89q.worldguard.protection.managers.RegionManager; import com.sk89q.worldguard.protection.managers.RegionManager;
import com.sk89q.worldguard.protection.regions.ProtectedRegion; import com.sk89q.worldguard.protection.regions.ProtectedRegion;
import org.bukkit.GameMode;
/** /**
* Handles all events thrown in relation to a player. * Handles all events thrown in relation to a player.
@ -159,7 +158,6 @@ public void onPlayerMove(PlayerMoveEvent event) {
String farewell = set.getFlag(DefaultFlag.FAREWELL_MESSAGE);//, localPlayer); String farewell = set.getFlag(DefaultFlag.FAREWELL_MESSAGE);//, localPlayer);
Boolean notifyEnter = set.getFlag(DefaultFlag.NOTIFY_ENTER);//, localPlayer); Boolean notifyEnter = set.getFlag(DefaultFlag.NOTIFY_ENTER);//, localPlayer);
Boolean notifyLeave = set.getFlag(DefaultFlag.NOTIFY_LEAVE);//, localPlayer); Boolean notifyLeave = set.getFlag(DefaultFlag.NOTIFY_LEAVE);//, localPlayer);
Boolean allowFlight = set.getFlag(DefaultFlag.ALLOW_FLIGHT);//, localPlayer);
if (state.lastFarewell != null && (farewell == null if (state.lastFarewell != null && (farewell == null
|| !state.lastFarewell.equals(farewell))) { || !state.lastFarewell.equals(farewell))) {
@ -200,24 +198,6 @@ public void onPlayerMove(PlayerMoveEvent event) {
+ regionList); + regionList);
} }
if (allowFlight == null) {
if ((plugin.getServer().getDefaultGameMode() == GameMode.CREATIVE
&& player.getGameMode() == GameMode.CREATIVE)
|| player.getGameMode() == GameMode.CREATIVE) {
allowFlight = true;
} else {
allowFlight = false;
}
}
if (player.getAllowFlight() && !allowFlight) {
player.setAllowFlight(false);
state.lastAllowFlight = true;
} else if (!player.getAllowFlight() && allowFlight) {
player.setAllowFlight(true);
state.lastAllowFlight = false;
}
state.lastGreeting = greeting; state.lastGreeting = greeting;
state.lastFarewell = farewell; state.lastFarewell = farewell;
state.notifiedForEnter = notifyEnter; state.notifiedForEnter = notifyEnter;

View File

@ -80,7 +80,6 @@ public final class DefaultFlag {
public static final DoubleFlag PRICE = new DoubleFlag("price"); public static final DoubleFlag PRICE = new DoubleFlag("price");
public static final SetFlag<String> BLOCKED_CMDS = new SetFlag<String>("blocked-cmds", RegionGroup.ALL, new CommandStringFlag(null)); public static final SetFlag<String> BLOCKED_CMDS = new SetFlag<String>("blocked-cmds", RegionGroup.ALL, new CommandStringFlag(null));
public static final SetFlag<String> ALLOWED_CMDS = new SetFlag<String>("allowed-cmds", RegionGroup.ALL, new CommandStringFlag(null)); public static final SetFlag<String> ALLOWED_CMDS = new SetFlag<String>("allowed-cmds", RegionGroup.ALL, new CommandStringFlag(null));
public static final BooleanFlag ALLOW_FLIGHT = new BooleanFlag("allow-flight", RegionGroup.ALL);
public static final Flag<?>[] flagsList = new Flag<?>[] { public static final Flag<?>[] flagsList = new Flag<?>[] {
PASSTHROUGH, BUILD, CONSTRUCT, PVP, CHEST_ACCESS, PISTONS, PASSTHROUGH, BUILD, CONSTRUCT, PVP, CHEST_ACCESS, PISTONS,
@ -95,7 +94,7 @@ public final class DefaultFlag {
MUSHROOMS, LEAF_DECAY, GRASS_SPREAD, MUSHROOMS, LEAF_DECAY, GRASS_SPREAD,
FIRE_SPREAD, LAVA_FIRE, LAVA_FLOW, WATER_FLOW, FIRE_SPREAD, LAVA_FIRE, LAVA_FLOW, WATER_FLOW,
TELE_LOC, SPAWN_LOC, TELE_LOC, SPAWN_LOC,
BLOCKED_CMDS, ALLOWED_CMDS, PRICE, BUYABLE, ALLOW_FLIGHT, BLOCKED_CMDS, ALLOWED_CMDS, PRICE, BUYABLE,
}; };