Class GameModeParser
java.lang.Object
com.ultikits.ultitools.abstracts.command.parser.GameModeParser
- All Implemented Interfaces:
TypeParser<org.bukkit.GameMode>
Type parser for Bukkit GameMode.
Supports parsing by name (SURVIVAL, CREATIVE, etc.) or number (0, 1, 2, 3).
Bukkit GameMode 类型解析器。 支持通过名称(SURVIVAL、CREATIVE等)或数字(0、1、2、3)解析。
- Since:
- 6.2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<org.bukkit.GameMode> Gets the primary type this parser handles.Gets all types this parser can handle, including array types.org.bukkit.GameModeParses a string value into the target type.org.bukkit.GameMode[]parseArray(String[] values) Parses multiple string values into an array of the target type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.ultikits.ultitools.abstracts.command.parser.TypeParser
getPriority, supports
-
Constructor Details
-
GameModeParser
public GameModeParser()
-
-
Method Details
-
getPrimaryType
Description copied from interface:TypeParserGets the primary type this parser handles. 获取此解析器处理的主要类型。- Specified by:
getPrimaryTypein interfaceTypeParser<org.bukkit.GameMode>- Returns:
- the primary type class
-
getSupportedTypes
Description copied from interface:TypeParserGets all types this parser can handle, including array types. 获取此解析器可以处理的所有类型,包括数组类型。- Specified by:
getSupportedTypesin interfaceTypeParser<org.bukkit.GameMode>- Returns:
- list of supported types
-
parse
Description copied from interface:TypeParserParses a string value into the target type. 将字符串值解析为目标类型。- Specified by:
parsein interfaceTypeParser<org.bukkit.GameMode>- Parameters:
value- the string value to parse- Returns:
- the parsed value, or null if parsing fails
- Throws:
TypeParseException- if parsing fails with an error
-
parseArray
Description copied from interface:TypeParserParses multiple string values into an array of the target type. Default implementation calls parse() for each value. 将多个字符串值解析为目标类型的数组。 默认实现为每个值调用 parse()。- Specified by:
parseArrayin interfaceTypeParser<org.bukkit.GameMode>- Parameters:
values- the string values to parse- Returns:
- the parsed array
- Throws:
TypeParseException- if parsing fails with an error
-