Package com.comphenix.protocol.wrappers
Class AdventureComponentConverter
java.lang.Object
com.comphenix.protocol.wrappers.AdventureComponentConverter
Utility class for converting between the Adventure API Component and ProtocolLib's wrapper
Note: The Adventure API Component is not included in CraftBukkit, Bukkit or Spigot and but is present in PaperMC.
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.kyori.adventure.text.Componentstatic WrappedChatComponentfromComponent(net.kyori.adventure.text.Component component) Converts aComponentinto a ProtocolLib wrapperstatic WrappedChatComponentfromComponentObject(Object component) Converts an object that is instance ofComponentinto a ProtocolLib wrapperstatic net.kyori.adventure.text.ComponentConverts a JSONStringinto a Componentstatic ObjectfromJsonAsObject(String json) Converts a JSONStringinto a Component objectstatic WrappedComponentStylefromStyle(net.kyori.adventure.text.format.Style style) Converts aStyleinto a ProtocolLib wrapperstatic net.kyori.adventure.text.ComponentfromWrapper(WrappedChatComponent wrapper) Converts aWrappedChatComponentinto aComponentstatic net.kyori.adventure.text.format.StylefromWrapper(WrappedComponentStyle wrapper) Converts aWrappedComponentStyleinto aStylestatic ObjectfromWrapperAsObject(WrappedChatComponent wrapper) Converts aWrappedChatComponentinto aComponentstatic Class<?>
-
Method Details
-
fromWrapper
Converts aWrappedChatComponentinto aComponent- Parameters:
wrapper- ProtocolLib wrapper- Returns:
- Component
-
fromWrapperAsObject
Converts aWrappedChatComponentinto aComponent- Parameters:
wrapper- ProtocolLib wrapper- Returns:
- Component
-
fromJson
Converts a JSONStringinto a Component- Parameters:
json- Json String- Returns:
- Component
-
fromJsonAsObject
Converts a JSONStringinto a Component object- Parameters:
json- Json String- Returns:
- Component object
-
fromComponent
Converts aComponentinto a ProtocolLib wrapper- Parameters:
component- Component- Returns:
- ProtocolLib wrapper
-
fromComponentObject
Converts an object that is instance ofComponentinto a ProtocolLib wrapper- Parameters:
component- Component- Returns:
- ProtocolLib wrapper
-
fromWrapper
Converts aWrappedComponentStyleinto aStyle- Parameters:
wrapper- ProtocolLib wrapper- Returns:
- Style
-
fromStyle
Converts aStyleinto a ProtocolLib wrapper- Parameters:
style- Style- Returns:
- ProtocolLib wrapper
-
getComponentClass
-
clone
-