mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-29 22:13:32 +01:00
Remove construct flag.
It's been deprecated for ages and is a strict subset of build flag functionality. Also deprecate unused flags. They can be re-added by plugins that need them now.
This commit is contained in:
parent
324e90c68a
commit
deb283c44b
@ -23,8 +23,6 @@
|
||||
import com.sk89q.worldguard.protection.association.RegionAssociable;
|
||||
import com.sk89q.worldguard.protection.flags.DefaultFlag;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroup;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag;
|
||||
import com.sk89q.worldguard.protection.flags.StateFlag.State;
|
||||
|
||||
@ -42,14 +40,6 @@ public boolean canBuild(LocalPlayer player) {
|
||||
return test(queryState(player, DefaultFlag.BUILD));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public boolean canConstruct(LocalPlayer player) {
|
||||
checkNotNull(player);
|
||||
final RegionGroup flag = getFlag(DefaultFlag.CONSTRUCT, player);
|
||||
return RegionGroupFlag.isMember(this, flag, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean testState(@Nullable RegionAssociable subject, StateFlag... flags) {
|
||||
return test(queryState(subject, flags));
|
||||
|
@ -36,13 +36,6 @@ public final class DefaultFlag {
|
||||
// Overrides membership check
|
||||
public static final StateFlag PASSTHROUGH = new StateFlag("passthrough", false);
|
||||
|
||||
/**
|
||||
* @deprecated This flag is being removed because group flags can now be
|
||||
* set on all flags.
|
||||
*/
|
||||
@Deprecated
|
||||
public static final RegionGroupFlag CONSTRUCT = new RegionGroupFlag("construct", RegionGroup.MEMBERS);
|
||||
|
||||
// This flag is unlike the others. It forces the checking of region membership
|
||||
public static final StateFlag BUILD = new BuildFlag("build", true);
|
||||
|
||||
@ -138,14 +131,19 @@ public final class DefaultFlag {
|
||||
// public static final StringFlag MAX_PLAYERS_MESSAGE = new StringFlag("max-players-reject-message");
|
||||
public static final LocationFlag TELE_LOC = new LocationFlag("teleport", RegionGroup.MEMBERS);
|
||||
public static final LocationFlag SPAWN_LOC = new LocationFlag("spawn", RegionGroup.MEMBERS);
|
||||
public static final StateFlag ENABLE_SHOP = new StateFlag("allow-shop", false);
|
||||
public static final BooleanFlag BUYABLE = new BooleanFlag("buyable");
|
||||
public static final DoubleFlag PRICE = new DoubleFlag("price");
|
||||
public static final SetFlag<String> BLOCKED_CMDS = new SetFlag<String>("blocked-cmds", new CommandStringFlag(null));
|
||||
public static final SetFlag<String> ALLOWED_CMDS = new SetFlag<String>("allowed-cmds", new CommandStringFlag(null));
|
||||
|
||||
// these 3 are not used by worldguard and should be re-implemented in plugins that may use them using custom flag api
|
||||
@Deprecated
|
||||
public static final StateFlag ENABLE_SHOP = new StateFlag("allow-shop", false);
|
||||
@Deprecated
|
||||
public static final BooleanFlag BUYABLE = new BooleanFlag("buyable");
|
||||
@Deprecated
|
||||
public static final DoubleFlag PRICE = new DoubleFlag("price");
|
||||
|
||||
public static final Flag<?>[] flagsList = new Flag<?>[] {
|
||||
PASSTHROUGH, BUILD, CONSTRUCT, BLOCK_BREAK, BLOCK_PLACE, PVP, CHEST_ACCESS, PISTONS,
|
||||
PASSTHROUGH, BUILD, BLOCK_BREAK, BLOCK_PLACE, PVP, CHEST_ACCESS, PISTONS,
|
||||
TNT, LIGHTER, RIDE, USE, INTERACT, PLACE_VEHICLE, DESTROY_VEHICLE, DAMAGE_ANIMALS, SLEEP,
|
||||
MOB_DAMAGE, MOB_SPAWNING, DENY_SPAWN, INVINCIBILITY, EXP_DROPS,
|
||||
CREEPER_EXPLOSION, OTHER_EXPLOSION, ENDERDRAGON_BLOCK_DAMAGE, GHAST_FIREBALL, ENDER_BUILD,
|
||||
|
Loading…
Reference in New Issue
Block a user