Class ResourceKeyedValueParameters
- java.lang.Object
-
- org.spongepowered.api.command.parameter.managed.standard.ResourceKeyedValueParameters
-
public final class ResourceKeyedValueParameters extends java.lang.Object
Class containing commonparameters
.
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultedRegistryReference<ResourceKeyedValueParameter<java.math.BigDecimal>>
BIG_DECIMAL
Require an argument to be aBigDecimal
.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.math.BigInteger>>
BIG_INTEGER
Require an argument to be aBigInteger
.static DefaultedRegistryReference<ResourceKeyedValueParameter<BlockState>>
BLOCK_STATE
Requires an argument to represent aBlockState
static DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Boolean>>
BOOLEAN
Require an argument to be a boolean.static DefaultedRegistryReference<ResourceKeyedValueParameter<Color>>
COLOR
Require an argument to be aColor
static DefaultedRegistryReference<ResourceKeyedValueParameter<DataContainer>>
DATA_CONTAINER
Requires an argument to be a HOCON or JSON representation of aDataContainer
.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.time.LocalDateTime>>
DATE_TIME
Expect an argument to be a date-time, in the form of aLocalDateTime
.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Double>>
DOUBLE
Require an argument to be an double-precision floating point number.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.time.Duration>>
DURATION
Require an argument to be a duration.static DefaultedRegistryReference<ResourceKeyedValueParameter<Entity>>
ENTITY
Require an argument to select oneEntity
.static DefaultedRegistryReference<ResourceKeyedValueParameter<GameProfile>>
GAME_PROFILE
Expect an argument to represent aGameProfile
of a user.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Integer>>
INTEGER
Require an argument to be an integer (base 10) number.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.net.InetAddress>>
IP
Require an argument to be an IP address.static DefaultedRegistryReference<ResourceKeyedValueParameter<ItemStackSnapshot>>
ITEM_STACK_SNAPSHOT
Require an argument to represent an item.static DefaultedRegistryReference<ResourceKeyedValueParameter<ServerLocation>>
LOCATION
Expect an argument to represent aServerLocation
.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Long>>
LONG
Require an argument to be a long (base 10).static DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.List<Entity>>>
MANY_ENTITIES
Require an argument to select manyentities
.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.Collection<GameProfile>>>
MANY_GAME_PROFILES
Expect an argument to represent aGameProfile
of a user.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.List<ServerPlayer>>>
MANY_PLAYERS
Require an argument to select manyplayers
.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Void>>
NONE
Does not parse any arguments, returning nothing.static DefaultedRegistryReference<ResourceKeyedValueParameter<Operator>>
OPERATOR
Expect an argument to represent anOperator
static DefaultedRegistryReference<ResourceKeyedValueParameter<ServerPlayer>>
PLAYER
Expect an argument to represent an online player.static DefaultedRegistryReference<ResourceKeyedValueParameter<org.spongepowered.plugin.PluginContainer>>
PLUGIN
Expect an argument to represent aPluginContainer
's id.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.String>>
REMAINING_JOINED_STRINGS
Require one or more strings, without any processing, which are combined into a single, space-separated string.static DefaultedRegistryReference<ResourceKeyedValueParameter<ResourceKey>>
RESOURCE_KEY
Require an argument to be a namespacedResourceKey
.static DefaultedRegistryReference<ResourceKeyedValueParameter<Vector3d>>
ROTATION
Require an argument to be aVector3d
, where any relative value (i.e.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.String>>
STRING
Require an argument to be a string.static DefaultedRegistryReference<ResourceKeyedValueParameter<ServerLocation>>
TARGET_BLOCK
Does not parse any arguments, but instead returns aServerLocation
if the current root of theCause
is targeting (looking at) a non-air block.static DefaultedRegistryReference<ResourceKeyedValueParameter<Entity>>
TARGET_ENTITY
static DefaultedRegistryReference<ResourceKeyedValueParameter<ServerPlayer>>
TARGET_PLAYER
Does not parse any arguments, but instead returns aServerPlayer
if the current root of theCause
is as such (which thus must be aLocatable
).static DefaultedRegistryReference<ResourceKeyedValueParameter<Component>>
TEXT_FORMATTING_CODE
Expects an argument to represent someComponent
serialised using formatting codes.static DefaultedRegistryReference<ResourceKeyedValueParameter<Component>>
TEXT_FORMATTING_CODE_ALL
Expects an argument to represent someComponent
serialised using formatting codes.static DefaultedRegistryReference<ResourceKeyedValueParameter<Component>>
TEXT_JSON
Expects an argument to represent someComponent
serialised using Json.static DefaultedRegistryReference<ResourceKeyedValueParameter<Component>>
TEXT_JSON_ALL
Expects an argument to represent someComponent
serialised using Json.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.net.URL>>
URL
Require an argument to be a URL.static DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.UUID>>
USER
Expect an argument to represent the UUID of a player who has been online at some point - that is, aUUID
where either: The player is online; or The user with the returnedUUID
has user data available in theUserManager
(that is, for this UUID,UserManager.exists(java.util.UUID)
will returntrue
).static DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.UUID>>
UUID
Expect an argument to represent aUUID
static DefaultedRegistryReference<ResourceKeyedValueParameter<Vector2d>>
VECTOR2D
Expect an argument to represent aVector2d
.static DefaultedRegistryReference<ResourceKeyedValueParameter<Vector3d>>
VECTOR3D
Expect an argument to represent aVector3d
.static DefaultedRegistryReference<ResourceKeyedValueParameter<ServerWorld>>
WORLD
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Registry<ValueParameter<?>>
registry()
-
-
-
Field Detail
-
BIG_DECIMAL
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.math.BigDecimal>> BIG_DECIMAL
Require an argument to be aBigDecimal
.Returns a
BigDecimal
.
-
BIG_INTEGER
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.math.BigInteger>> BIG_INTEGER
Require an argument to be aBigInteger
.Returns a
BigInteger
.
-
BLOCK_STATE
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<BlockState>> BLOCK_STATE
Requires an argument to represent aBlockState
Returns a
BlockState
-
BOOLEAN
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Boolean>> BOOLEAN
Require an argument to be a boolean.Returns a
Boolean
.
-
COLOR
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Color>> COLOR
Require an argument to be aColor
There are three types of input that may be used with this element:
- An inbuilt named color, as seen in the
Color
class - A comma separated set of RGB values, each of which ranges from 0 to 255 (eg. "125,3,75" for the red, green and blue components, respectively)
- A hex value, which must be prefixed with "#" or "0x"
Returns a
Color
- An inbuilt named color, as seen in the
-
DATA_CONTAINER
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<DataContainer>> DATA_CONTAINER
Requires an argument to be a HOCON or JSON representation of aDataContainer
.Note that this parameter will consume all arguments, thus, this should be put at the end of a parameter chain.
Returns a
DataContainer
-
DATE_TIME
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.time.LocalDateTime>> DATE_TIME
Expect an argument to be a date-time, in the form of aLocalDateTime
. If no date is specified,LocalDate.now()
is used; if no time is specified,LocalTime.MIDNIGHT
is used.Date-times are expected in the ISO-8601 format.
Returns a
LocalDateTime
-
DOUBLE
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Double>> DOUBLE
Require an argument to be an double-precision floating point number.Returns a
Double
.
-
DURATION
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.time.Duration>> DURATION
Require an argument to be a duration.The duration can be specified in one of these ways:
- A number, which will be assumed to be seconds.
- An element of the form
D:HH:MM:SS
- days and hours can be omitted. - An element of the form
[weeks]w[days]d[hours]h[minutes]m[seconds]s[millis]ms
, where any zeroed unit can be omitted.
Returns a
Duration
.
-
ENTITY
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Entity>> ENTITY
-
GAME_PROFILE
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<GameProfile>> GAME_PROFILE
Expect an argument to represent aGameProfile
of a user.Returns a
GameProfile
.
-
INTEGER
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Integer>> INTEGER
Require an argument to be an integer (base 10) number.Returns an
Integer
.
-
IP
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.net.InetAddress>> IP
Require an argument to be an IP address.Returns an
InetAddress
.
-
ITEM_STACK_SNAPSHOT
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<ItemStackSnapshot>> ITEM_STACK_SNAPSHOT
Require an argument to represent an item.Returns a
ItemStackSnapshot
with a quantity of 1.
-
LOCATION
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<ServerLocation>> LOCATION
Expect an argument to represent aServerLocation
.Returns a
ServerLocation
.
-
LONG
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Long>> LONG
Require an argument to be a long (base 10).Returns a
Long
.
-
MANY_ENTITIES
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.List<Entity>>> MANY_ENTITIES
Require an argument to select manyentities
.This parameter accepts selectors.
Returns many
Entity
objects.- See Also:
ENTITY
-
MANY_GAME_PROFILES
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.Collection<GameProfile>>> MANY_GAME_PROFILES
Expect an argument to represent aGameProfile
of a user.This parameter accepts selectors (to obtain the game profiles of online players). As a result, this may return multiple profiles.
Returns a
GameProfile
.
-
MANY_PLAYERS
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.List<ServerPlayer>>> MANY_PLAYERS
Require an argument to select manyplayers
.This parameter accepts selectors.
Returns many
Player
objects.- See Also:
PLAYER
-
NONE
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.Void>> NONE
Does not parse any arguments, returning nothing.Returns nothing - no entry will be placed into any provided key.
-
OPERATOR
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Operator>> OPERATOR
-
PLAYER
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<ServerPlayer>> PLAYER
Expect an argument to represent an online player.This parameter accepts selectors.
Returns a
ServerPlayer
.
-
PLUGIN
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<org.spongepowered.plugin.PluginContainer>> PLUGIN
Expect an argument to represent aPluginContainer
's id.Returns a
PluginContainer
-
REMAINING_JOINED_STRINGS
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.String>> REMAINING_JOINED_STRINGS
Require one or more strings, without any processing, which are combined into a single, space-separated string.Returns a
String
.
-
RESOURCE_KEY
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<ResourceKey>> RESOURCE_KEY
Require an argument to be a namespacedResourceKey
.Returns a
ResourceKey
-
ROTATION
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Vector3d>> ROTATION
Require an argument to be aVector3d
, where any relative value (i.e. anything specified using tilde (~) notation) will be based on the invoker's current rotation.The supplied
Vector2d
will contain the Euler components (yaw, pitch, roll), where:- the angles are specified in degrees;
- (0, 0) is looking directly south, parallel to the x-z plane;
- the yaw is measured as the angle counter-clockwise from due south in the x-z plane; and
- the pitch is negative when rotating up from the x-z plane.
- the roll is zero
This is presented as a
Vector3d
even though only two arguments are parsed for consistency withEntity.rotation()
.
-
STRING
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.lang.String>> STRING
Require an argument to be a string.Returns a
String
.
-
TARGET_BLOCK
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<ServerLocation>> TARGET_BLOCK
Does not parse any arguments, but instead returns aServerLocation
if the current root of theCause
is targeting (looking at) a non-air block.This will always fail for non-locatable sources
Returns a
ServerLocation
.
-
TARGET_ENTITY
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Entity>> TARGET_ENTITY
-
TARGET_PLAYER
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<ServerPlayer>> TARGET_PLAYER
Does not parse any arguments, but instead returns aServerPlayer
if the current root of theCause
is as such (which thus must be aLocatable
).This will always fail for non-locatable sources
Returns a
ServerPlayer
.
-
TEXT_FORMATTING_CODE
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Component>> TEXT_FORMATTING_CODE
-
TEXT_FORMATTING_CODE_ALL
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Component>> TEXT_FORMATTING_CODE_ALL
-
TEXT_JSON
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Component>> TEXT_JSON
-
TEXT_JSON_ALL
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Component>> TEXT_JSON_ALL
-
URL
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.net.URL>> URL
Require an argument to be a URL.Returns a
URL
-
USER
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.UUID>> USER
Expect an argument to represent the UUID of a player who has been online at some point - that is, aUUID
where either:- The player is online; or
- The user with the returned
UUID
has user data available in theUserManager
(that is, for this UUID,UserManager.exists(java.util.UUID)
will returntrue
).
As
User
objects are potentially slow to load, they are not created or returned here. In general, you will want to runUserManager.load(java.util.UUID)
on the returned UUID to actually obtain the user.This parameter accepts selectors (to obtain players).
Returns a
UUID
.
-
UUID
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<java.util.UUID>> UUID
Expect an argument to represent aUUID
Returns a
UUID
.
-
VECTOR2D
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Vector2d>> VECTOR2D
-
VECTOR3D
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<Vector3d>> VECTOR3D
-
WORLD
public static final DefaultedRegistryReference<ResourceKeyedValueParameter<ServerWorld>> WORLD
-
-
Method Detail
-
registry
public static Registry<ValueParameter<?>> registry()
-
-