mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-23 17:47:35 +01:00
parent
15f0bfb9db
commit
16ce56c1ad
@ -1,4 +1,6 @@
|
||||
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!)
|
||||
- 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.
|
||||
@ -387,4 +389,4 @@ EduardBaer, TomyLobo, and halvors
|
||||
- Added block lag fix.
|
||||
|
||||
1.0
|
||||
- Initial release.
|
||||
- Initial release.
|
||||
|
1
src/main/java/com/sk89q/worldguard/bukkit/FlagStateManager.java
Normal file → Executable file
1
src/main/java/com/sk89q/worldguard/bukkit/FlagStateManager.java
Normal file → Executable file
@ -220,6 +220,7 @@ public static class PlayerFlagState {
|
||||
public Boolean lastExitAllowed = null;
|
||||
public Boolean notifiedForLeave = false;
|
||||
public Boolean notifiedForEnter = false;
|
||||
public Boolean lastAllowFlight = null;
|
||||
public World lastWorld;
|
||||
public int lastBlockX;
|
||||
public int lastBlockY;
|
||||
|
20
src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java
Normal file → Executable file
20
src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java
Normal file → Executable file
@ -65,6 +65,7 @@
|
||||
import com.sk89q.worldguard.protection.flags.DefaultFlag;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import org.bukkit.GameMode;
|
||||
|
||||
/**
|
||||
* Handles all events thrown in relation to a player.
|
||||
@ -158,6 +159,7 @@ public void onPlayerMove(PlayerMoveEvent event) {
|
||||
String farewell = set.getFlag(DefaultFlag.FAREWELL_MESSAGE);//, localPlayer);
|
||||
Boolean notifyEnter = set.getFlag(DefaultFlag.NOTIFY_ENTER);//, localPlayer);
|
||||
Boolean notifyLeave = set.getFlag(DefaultFlag.NOTIFY_LEAVE);//, localPlayer);
|
||||
Boolean allowFlight = set.getFlag(DefaultFlag.ALLOW_FLIGHT);//, localPlayer);
|
||||
|
||||
if (state.lastFarewell != null && (farewell == null
|
||||
|| !state.lastFarewell.equals(farewell))) {
|
||||
@ -197,6 +199,24 @@ public void onPlayerMove(PlayerMoveEvent event) {
|
||||
+ ChatColor.WHITE
|
||||
+ 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.lastFarewell = farewell;
|
||||
|
3
src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java
Normal file → Executable file
3
src/main/java/com/sk89q/worldguard/protection/flags/DefaultFlag.java
Normal file → Executable file
@ -80,6 +80,7 @@ public final class DefaultFlag {
|
||||
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> 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<?>[] {
|
||||
PASSTHROUGH, BUILD, CONSTRUCT, PVP, CHEST_ACCESS, PISTONS,
|
||||
@ -94,7 +95,7 @@ public final class DefaultFlag {
|
||||
MUSHROOMS, LEAF_DECAY, GRASS_SPREAD,
|
||||
FIRE_SPREAD, LAVA_FIRE, LAVA_FLOW, WATER_FLOW,
|
||||
TELE_LOC, SPAWN_LOC,
|
||||
BLOCKED_CMDS, ALLOWED_CMDS, PRICE, BUYABLE,
|
||||
BLOCKED_CMDS, ALLOWED_CMDS, PRICE, BUYABLE, ALLOW_FLIGHT,
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user