Skip to content

Commit fb08567

Browse files
authored
Add AdventureComponentConverter#fromComponentObject (#3127)
1 parent 9fc68d4 commit fb08567

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/com/comphenix/protocol/wrappers/AdventureComponentConverter.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ public static WrappedChatComponent fromComponent(Component component) {
8686
return WrappedChatComponent.fromJson(SERIALIZER.serialize(component));
8787
}
8888

89+
/**
90+
* Converts an object that is instance of {@link Component} into a ProtocolLib wrapper
91+
* @param component Component
92+
* @return ProtocolLib wrapper
93+
*/
94+
public static WrappedChatComponent fromComponentObject(Object component) {
95+
return fromComponent((Component) component);
96+
}
97+
8998
/**
9099
* Converts a {@link WrappedComponentStyle} into a {@link Style}
91100
* @param wrapper ProtocolLib wrapper

0 commit comments

Comments
 (0)