Package com.djrapitops.plan.component
Class ComponentSvc
java.lang.Object
com.djrapitops.plan.component.ComponentSvc
- All Implemented Interfaces:
ComponentService
Implementation for
ComponentService
.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.djrapitops.plan.component.ComponentService
ComponentService.Holder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvert
(Component component, ComponentOperation operation) convert
(Component component, ComponentOperation operation, char inputCharacter) fromAdventureLegacy
(String adventureLegacy, char character) Converts the given input into aComponent
.fromAutoDetermine
(String unknown) Converts the given input into aComponent
.fromBungeeLegacy
(String bungeeLegacy, char character) Converts the given input into aComponent
.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
.void
register()
translateLegacy
(String input, char inputCharacter, char outputCharacter) Translates ampersands into section signs for color codes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.djrapitops.plan.component.ComponentService
fromAdventureLegacy, fromBungeeLegacy, fromLegacy, translateLegacy
-
Constructor Details
-
ComponentSvc
@Inject public ComponentSvc()
-
-
Method Details
-
translateLegacy
Description copied from interface:ComponentService
Translates ampersands into section signs for color codes. Example:&ctext
to§ctext
.- Specified by:
translateLegacy
in interfaceComponentService
- 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:
-
convert
-
convert
-
fromAutoDetermine
Description copied from interface:ComponentService
Converts the given input into aComponent
. Converts an unknown format legacy/minimessage string into a component by attempting to guess the input format.- Specified by:
fromAutoDetermine
in interfaceComponentService
- Parameters:
unknown
- the unknown format input string- Returns:
- a
Component
-
fromLegacy
Description copied from interface:ComponentService
Converts the given input into aComponent
. Input example§ctext
.- Specified by:
fromLegacy
in interfaceComponentService
- Parameters:
legacy
- the input legacycharacter
- the character to use as the color prefix, usually§
.- Returns:
- a
Component
- See Also:
-
fromAdventureLegacy
Description copied from interface:ComponentService
Converts the given input into aComponent
. Input example:&#rrggbbtext
.- Specified by:
fromAdventureLegacy
in interfaceComponentService
- Parameters:
adventureLegacy
- the input adventure legacycharacter
- the character to use as the color prefix, usually&
.- Returns:
- a
Component
- See Also:
-
fromBungeeLegacy
Description copied from interface:ComponentService
Converts the given input into aComponent
. Input example:§x§r§r§g§g§b§btext
.- Specified by:
fromBungeeLegacy
in interfaceComponentService
- Parameters:
bungeeLegacy
- the input bungee legacycharacter
- the character to use as the color prefix, usually§
.- Returns:
- a
Component
- See Also:
-
fromMiniMessage
Description copied from interface:ComponentService
Converts the given input into aComponent
. Input example:<red>text</red>
.- Specified by:
fromMiniMessage
in interfaceComponentService
- Parameters:
miniMessage
- the input minimessage- Returns:
- a
Component
-
fromJson
Description copied from interface:ComponentService
Converts the given input into aComponent
. Input example:{text:"text",color:"red"}
(standard Minecraft json).- Specified by:
fromJson
in interfaceComponentService
- Parameters:
json
- the input json- Returns:
- a
Component
-
register
public void register()
-