Class Type
java.lang.Object
cn.nukkit.command.selector.args.CachedSimpleSelectorArgument
cn.nukkit.command.selector.args.impl.Type
- All Implemented Interfaces:
ISelectorArgument
,Comparable<ISelectorArgument>
-
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncache
(SelectorType selectorType, CommandSender sender, Location basePos, String... arguments) 当未在缓存中找到解析结果时,则调用此方法对参数进行解析protected String
completionPrefix
(String type) getDefaultValue
(Map<String, List<String>> values, SelectorType selectorType, CommandSender sender) 若一个参数有默认值(即此方法返回非null值),则在解析时若给定参数表中没有此参数,会以此默认值参与解析获取此参数的名称int
解析优先级定义了各个参数的解析顺序protected boolean
Methods inherited from class cn.nukkit.command.selector.args.CachedSimpleSelectorArgument
getPredicate, provideCacheService
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cn.nukkit.command.selector.args.ISelectorArgument
compareTo, getFilter, isFilter
-
Field Details
-
ENTITY_ID2TYPE
-
ENTITY_TYPE2ID
-
-
Constructor Details
-
Type
public Type()
-
-
Method Details
-
cache
protected Predicate<Entity> cache(SelectorType selectorType, CommandSender sender, Location basePos, String... arguments) Description copied from class:CachedSimpleSelectorArgument
当未在缓存中找到解析结果时,则调用此方法对参数进行解析- Specified by:
cache
in classCachedSimpleSelectorArgument
-
getDefaultValue
@Nullable public String getDefaultValue(Map<String, List<String>> values, SelectorType selectorType, CommandSender sender) Description copied from interface:ISelectorArgument
若一个参数有默认值(即此方法返回非null值),则在解析时若给定参数表中没有此参数,会以此默认值参与解析- Parameters:
values
- 参数列表selectorType
- 选择器类型sender
- 命令执行者- Returns:
- 此参数的默认值
-
getKeyName
Description copied from interface:ISelectorArgument
获取此参数的名称- Returns:
- 参数名称
-
getPriority
public int getPriority()Description copied from interface:ISelectorArgument
解析优先级定义了各个参数的解析顺序 优先级越高(数字越小)的参数,其越先被解析,且其解析结果将会影响下个参数的解析- Returns:
- 此参数的解析优先级
-
completionPrefix
-
isType
-