Interface VersionedComponent
public interface VersionedComponent
A multi-version wrapper that supports Kyori Adventure Components and the MiniMessage format.
This wrapper facilitates sending this wrapped component despite server version differences. (See
On older servers, it likely sends via BaseComponents, while on newer servers it can use the native adventure api.
This wrapper attempts to use the native adventure api on newer servers, but falls back to using an internal shaded copy of adventure if the server does not support it natively.
This wrapper facilitates sending this wrapped component despite server version differences. (See
sendTo(CommandSender)
)On older servers, it likely sends via BaseComponents, while on newer servers it can use the native adventure api.
This wrapper attempts to use the native adventure api on newer servers, but falls back to using an internal shaded copy of adventure if the server does not support it natively.
-
Method Summary
Modifier and TypeMethodDescription@NotNull Inventory
createInventory
(@NotNull InventoryHolder owner, int size) Create a new menu with the current message as the title, other arguments are passed as normal.@NotNull Inventory
createInventory
(@NotNull InventoryHolder owner, @NotNull InventoryType type) Create a new menu with the current message as the title, other arguments are passed as normal.@NotNull String
Serializes the current message component to a plain text string using the PlainTextComponentSerializer on the current platform.default void
sendTo
(@NotNull Collection<CommandSender> senders) Sends the current message component to multiple senders.void
sendTo
(@NotNull CommandSender sender) Sends the current message component to a sender.default void
sendTo
(@NotNull CommandSender... senders) Sends the current message component to multiple senders.@NotNull String
Serializes the current message component to a MiniMessage string.
-
Method Details
-
sendTo
Sends the current message component to a sender. -
serializeMiniMessage
Serializes the current message component to a MiniMessage string. -
plainText
Serializes the current message component to a plain text string using the PlainTextComponentSerializer on the current platform. -
createInventory
Create a new menu with the current message as the title, other arguments are passed as normal.- Parameters:
owner
- The inventory holder for this inventory. (inherited from Bukkit.createInventory)size
- The size of the inventory. (inherited from Bukkit.createInventory)
-
createInventory
@NotNull @NotNull Inventory createInventory(@NotNull @NotNull InventoryHolder owner, @NotNull @NotNull InventoryType type) Create a new menu with the current message as the title, other arguments are passed as normal.- Parameters:
owner
- The inventory holder for this inventory. (inherited from Bukkit.createInventory)type
- The type of the inventory. (inherited from Bukkit.createInventory)
-
sendTo
Sends the current message component to multiple senders. -
sendTo
Sends the current message component to multiple senders.
-