Class FlagContext
java.lang.Object
com.sk89q.worldguard.protection.flags.FlagContext
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncopyWith
(com.sk89q.worldedit.extension.platform.Actor commandSender, String s, Map<String, Object> values) Create a copy of this FlagContext, with optional substitutions for values If any supplied variable is null, it will be ignored.create()
Get an object from the context by key name.Get an object from the context by key name.Gets the CommandSender as a player.com.sk89q.worldedit.extension.platform.Actor
void
-
Method Details
-
create
-
put
-
getSender
public com.sk89q.worldedit.extension.platform.Actor getSender() -
getUserInput
-
getPlayerSender
Gets the CommandSender as a player.- Returns:
- Player
- Throws:
InvalidFlagFormat
- if the sender is not a player
-
getUserInputAsInt
- Throws:
InvalidFlagFormat
-
getUserInputAsDouble
- Throws:
InvalidFlagFormat
-
get
Get an object from the context by key name. May return null if the object does not exist in the context.- Parameters:
name
- key name of the object- Returns:
- the object matching the key, or null
-
get
Get an object from the context by key name. Will only return null if a) you provide null as the default b) the key has explicity been set to null- Parameters:
name
- key name of the object- Returns:
- the object matching the key
-
copyWith
public FlagContext copyWith(@Nullable com.sk89q.worldedit.extension.platform.Actor commandSender, @Nullable String s, @Nullable Map<String, Object> values) Create a copy of this FlagContext, with optional substitutions for values If any supplied variable is null, it will be ignored. If a map is supplied, it will override this FlagContext's values of the same key, but unprovided keys will not be overriden and will be returned as shallow copies.- Parameters:
commandSender
- CommandSender for the new FlagContext to run unders
- String of the user input for the new FlagContextvalues
- map of values to override from the current FlagContext- Returns:
- a copy of this FlagContext
-