IdentifierArgument.java
net.minecraft.commands.arguments.IdentifierArgument
信息
- 全限定名:net.minecraft.commands.arguments.IdentifierArgument
- 类型:public class
- 包:net.minecraft.commands.arguments
- 源码路径:src/main/java/net/minecraft/commands/arguments/IdentifierArgument.java
- 起始行号:L12
- 实现:ArgumentType
- 职责:
TODO
字段/常量
EXAMPLES- 类型:
Collection<String> - 修饰符:
private static final - 源码定位:
L13 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public static IdentifierArgument id() @ L15
- 方法名:id
- 源码定位:L15
- 返回类型:IdentifierArgument
- 修饰符:public static
参数:
- 无
说明:
TODO
public static Identifier getId(CommandContext<CommandSourceStack> context, String name) @ L19
- 方法名:getId
- 源码定位:L19
- 返回类型:Identifier
- 修饰符:public static
参数:
- context: CommandContext
- name: String
说明:
TODO
public Identifier parse(StringReader reader) @ L23
- 方法名:parse
- 源码定位:L23
- 返回类型:Identifier
- 修饰符:public
参数:
- reader: StringReader
说明:
TODO
public Collection<String> getExamples() @ L27
- 方法名:getExamples
- 源码定位:L27
- 返回类型:Collection
- 修饰符:public
参数:
- 无
说明:
TODO
代码
public class IdentifierArgument implements ArgumentType<Identifier> {
private static final Collection<String> EXAMPLES = Arrays.asList("foo", "foo:bar", "012");
public static IdentifierArgument id() {
return new IdentifierArgument();
}
public static Identifier getId(CommandContext<CommandSourceStack> context, String name) {
return context.getArgument(name, Identifier.class);
}
public Identifier parse(StringReader reader) throws CommandSyntaxException {
return Identifier.read(reader);
}
@Override
public Collection<String> getExamples() {
return EXAMPLES;
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
实现/方法调用/返回值 - 关联成员:
Identifier.read()
- 引用位置: