Interface ComponentService
- All Known Implementing Classes:
ComponentSvc
public interface ComponentService
A utility api class for dealing with rich and less-rich Minecraft message formats.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classSingleton holder for ComponentService. -
Method Summary
Modifier and TypeMethodDescriptiondefault ComponentfromAdventureLegacy(String adventureLegacy) Converts the given input into aComponent.fromAdventureLegacy(String adventureLegacy, char character) Converts the given input into aComponent.fromAutoDetermine(String unknown) Converts the given input into aComponent.default ComponentfromBungeeLegacy(String bungeeLegacy) Converts the given input into aComponent.fromBungeeLegacy(String bungeeLegacy, char character) Converts the given input into aComponent.Converts the given input into aComponent.default ComponentfromLegacy(String legacy) Converts the given input into aComponent.fromLegacy(String legacy, char character) Converts the given input into aComponent.fromMiniMessage(String miniMessage) Converts the given input into aComponent.static ComponentServiceObtain the instance of ComponentService.default StringtranslateLegacy(String input) Translates ampersands into section signs for color codes.translateLegacy(String input, char inputCharacter, char outputCharacter) Translates ampersands into section signs for color codes.
-
Method Details
-
getInstance
Obtain the instance of ComponentService.- Returns:
- ComponentService implementation.
- Throws:
NoClassDefFoundError- If Plan is not installed and this class can not be found or if older Plan version is installed.IllegalStateException- If Plan is installed, but not enabled.
-
translateLegacy
Translates ampersands into section signs for color codes. Defaults toComponent.AMPERSANDtoComponent.SECTION. Example:&ctextto§ctext.- Parameters:
input- the input color string with color codes using ampersands (&)- Returns:
- the same input string with ampersands (
&) for color codes replaced with section signs (§) - See Also:
-
translateLegacy
Translates ampersands into section signs for color codes. Example:&ctextto§ctext.- Parameters:
input- the input color string with color codes using ampersands (&)inputCharacter- the input character for translation, usually&.outputCharacter- the output character for translation, usually§.- Returns:
- the same input string with input characters for color codes replaced with output characters
- See Also:
-
fromAutoDetermine
-
fromLegacy
-
fromLegacy
-
fromAdventureLegacy
-
fromAdventureLegacy
-
fromBungeeLegacy
-
fromBungeeLegacy
-
fromMiniMessage
-
fromJson
-