User Tools

Site Tools


zh_cn:tutorial:command_argument_types

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
zh_cn:tutorial:command_argument_types [2023/04/20 11:09] – 没有必要使用 SystemUtil solidblockzh_cn:tutorial:command_argument_types [2023/04/20 11:11] – fix type solidblock
Line 42: Line 42:
 <code java [enable_line_numbers="true"]>String uuidString = reader.getString().substring(argBeginning, reader.getCursor());</code> <code java [enable_line_numbers="true"]>String uuidString = reader.getString().substring(argBeginning, reader.getCursor());</code>
  
-最终,我们检我们的参数是否正确,并解析我们的参数,如果解析失败则抛出异常。+最终,我们检我们的参数是否正确,并解析我们的参数,如果解析失败则抛出异常。
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
Line 88: Line 88:
     public static <S> UUID getUuid(String name, CommandContext<S> context) {     public static <S> UUID getUuid(String name, CommandContext<S> context) {
         // 注意你应该假设 CommandContext 中包含的 CommandSource 是一个泛型类型。         // 注意你应该假设 CommandContext 中包含的 CommandSource 是一个泛型类型。
-        // 如果你需要访问 ServerCommandSource,确保你在强转之前验证了源。+        // 如果你需要访问 ServerCommandSource,确保你在强转之前验证了命令源。
         return context.getArgument(name, UUID.class);         return context.getArgument(name, UUID.class);
     }     }
zh_cn/tutorial/command_argument_types.txt · Last modified: 2024/04/15 07:24 by solidblock