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:
wizjany 2016-11-27 18:42:22 -05:00
parent 324e90c68a
commit deb283c44b
2 changed files with 9 additions and 21 deletions

View File

@ -23,8 +23,6 @@
import com.sk89q.worldguard.protection.association.RegionAssociable; import com.sk89q.worldguard.protection.association.RegionAssociable;
import com.sk89q.worldguard.protection.flags.DefaultFlag; import com.sk89q.worldguard.protection.flags.DefaultFlag;
import com.sk89q.worldguard.protection.flags.Flag; 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;
import com.sk89q.worldguard.protection.flags.StateFlag.State; import com.sk89q.worldguard.protection.flags.StateFlag.State;
@ -42,14 +40,6 @@ public boolean canBuild(LocalPlayer player) {
return test(queryState(player, DefaultFlag.BUILD)); 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 @Override
public boolean testState(@Nullable RegionAssociable subject, StateFlag... flags) { public boolean testState(@Nullable RegionAssociable subject, StateFlag... flags) {
return test(queryState(subject, flags)); return test(queryState(subject, flags));

View File

@ -36,13 +36,6 @@ public final class DefaultFlag {
// Overrides membership check // Overrides membership check
public static final StateFlag PASSTHROUGH = new StateFlag("passthrough", false); 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 // This flag is unlike the others. It forces the checking of region membership
public static final StateFlag BUILD = new BuildFlag("build", true); 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 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 TELE_LOC = new LocationFlag("teleport", RegionGroup.MEMBERS);
public static final LocationFlag SPAWN_LOC = new LocationFlag("spawn", 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> 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)); 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<?>[] { 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, TNT, LIGHTER, RIDE, USE, INTERACT, PLACE_VEHICLE, DESTROY_VEHICLE, DAMAGE_ANIMALS, SLEEP,
MOB_DAMAGE, MOB_SPAWNING, DENY_SPAWN, INVINCIBILITY, EXP_DROPS, MOB_DAMAGE, MOB_SPAWNING, DENY_SPAWN, INVINCIBILITY, EXP_DROPS,
CREEPER_EXPLOSION, OTHER_EXPLOSION, ENDERDRAGON_BLOCK_DAMAGE, GHAST_FIREBALL, ENDER_BUILD, CREEPER_EXPLOSION, OTHER_EXPLOSION, ENDERDRAGON_BLOCK_DAMAGE, GHAST_FIREBALL, ENDER_BUILD,