public class Components
extends java.lang.Object
Constructor and Description |
---|
Components() |
Modifier and Type | Method and Description |
---|---|
static void |
actionBar(org.bukkit.entity.Player player,
java.lang.String actionBar)
Sets the action bar of the given player.
|
static void |
broadcast(net.kyori.adventure.text.Component component)
Sends a component to everyone.
|
static void |
broadcast(java.lang.String message)
Sends a message to everyone.
|
static net.kyori.adventure.text.TextComponent |
commandComponent(java.lang.String message,
java.lang.String command)
Creates a command component from the given values.
|
static java.lang.String |
displayName(org.bukkit.inventory.meta.ItemMeta itemMeta)
Gets the display name of the given item meta.
|
static void |
displayName(org.bukkit.inventory.meta.ItemMeta itemMeta,
java.lang.String displayName)
Sets the display name of the given item meta.
|
private static java.lang.String |
fromComponent(net.kyori.adventure.text.Component component)
Converts the given component to text.
|
static net.kyori.adventure.text.TextComponent |
hyperlinkComponent(java.lang.String message,
java.lang.String url)
Creates a hyperlink component from the given values.
|
static org.bukkit.inventory.Inventory |
inventory(WauzInventory inventory,
java.lang.String title,
int slots)
Creates a custom inventory instance.
|
static net.kyori.adventure.text.TextComponent |
itemComponent(java.lang.String message,
org.bukkit.inventory.ItemStack itemStack)
Creates an item component from the given values.
|
static void |
kick(org.bukkit.entity.Player player,
java.lang.String message)
Kicks a player and shows them the given message.
|
static java.lang.String |
line(org.bukkit.block.Sign sign,
int index)
Gets the line of the given sign.
|
static void |
line(org.bukkit.block.Sign sign,
int index,
java.lang.String line)
Sets the line of the given sign.
|
static java.util.List<java.lang.String> |
lines(org.bukkit.event.block.SignChangeEvent event)
Gets the lines of the given sign event.
|
static void |
lines(org.bukkit.event.block.SignChangeEvent event,
java.util.List<java.lang.String> lines)
Sets the lines of the given sign event.
|
static java.util.List<java.lang.String> |
lore(org.bukkit.inventory.meta.ItemMeta itemMeta)
Gets the lore of the given item meta.
|
static void |
lore(org.bukkit.inventory.meta.ItemMeta itemMeta,
java.util.List<java.lang.String> loreLines)
Sets the lore of the given item meta.
|
static java.lang.String |
message(io.papermc.paper.event.player.AsyncChatEvent event)
Gets the message of the given chat event.
|
static void |
motd(org.bukkit.event.server.ServerListPingEvent event,
java.lang.String motd)
Sets the modt of the given ping event.
|
static org.bukkit.scoreboard.Objective |
objective(org.bukkit.scoreboard.Scoreboard scoreboard,
java.lang.String name,
java.lang.String criteria,
java.lang.String displayName)
Registers a new objective on the given scoreboard.
|
static void |
playerListHeaderAndFooter(org.bukkit.entity.Player player,
java.lang.String header,
java.lang.String footer)
Sets the player list header and footer for the given player.
|
static void |
teamPrefixAndColor(org.bukkit.scoreboard.Team team,
java.lang.String prefix,
org.bukkit.ChatColor color)
Sets the team prefix and color for the given team.
|
static java.lang.String |
title(org.bukkit.inventory.InventoryView inventory)
Gets the title of the given inventory.
|
private static net.kyori.adventure.text.TextComponent |
toComponent(java.lang.String text)
Converts the given text to a component.
|
public static java.lang.String title(org.bukkit.inventory.InventoryView inventory)
inventory
- The inventory to get the title from.public static org.bukkit.inventory.Inventory inventory(WauzInventory inventory, java.lang.String title, int slots)
inventory
- The inventory to instantiate.title
- The title of the inventory instance.slots
- The slots of the inventory instance.public static void kick(org.bukkit.entity.Player player, java.lang.String message)
player
- The player to kick.message
- The message to show to the player.public static void actionBar(org.bukkit.entity.Player player, java.lang.String actionBar)
player
- The player to set the action bar for.actionBar
- The action bar to set.public static void playerListHeaderAndFooter(org.bukkit.entity.Player player, java.lang.String header, java.lang.String footer)
player
- The player to set the player list header and footer for.header
- The header to set.footer
- The footer to set.public static void teamPrefixAndColor(org.bukkit.scoreboard.Team team, java.lang.String prefix, org.bukkit.ChatColor color)
team
- The team to set the team prefix and color for.prefix
- The prefix to set.color
- The color to set.public static org.bukkit.scoreboard.Objective objective(org.bukkit.scoreboard.Scoreboard scoreboard, java.lang.String name, java.lang.String criteria, java.lang.String displayName)
scoreboard
- The scoreboard to register the objective on.name
- The name of the objective.criteria
- The criteria of the objective.displayName
- The display name of the objective.public static java.lang.String displayName(org.bukkit.inventory.meta.ItemMeta itemMeta)
itemMeta
- The item meta to get the display name from.public static void displayName(org.bukkit.inventory.meta.ItemMeta itemMeta, java.lang.String displayName)
itemMeta
- The item meta to set the display name for.displayName
- The display name to set.public static java.util.List<java.lang.String> lore(org.bukkit.inventory.meta.ItemMeta itemMeta)
itemMeta
- The item meta to get the lore from.public static void lore(org.bukkit.inventory.meta.ItemMeta itemMeta, java.util.List<java.lang.String> loreLines)
itemMeta
- The item meta to set the lore for.loreLines
- The lore to set.public static java.lang.String line(org.bukkit.block.Sign sign, int index)
sign
- The sign to get the line from.index
- The index of the line.public static void line(org.bukkit.block.Sign sign, int index, java.lang.String line)
sign
- The sign to set the line for.index
- The index of the line.line
- The line to set.public static java.util.List<java.lang.String> lines(org.bukkit.event.block.SignChangeEvent event)
event
- The sign event to get the lines from.public static void lines(org.bukkit.event.block.SignChangeEvent event, java.util.List<java.lang.String> lines)
event
- The sign event to set the lines for.lines
- The lines to set.public static void motd(org.bukkit.event.server.ServerListPingEvent event, java.lang.String motd)
event
- The ping event to set the motd for.motd
- The motd to set.public static java.lang.String message(io.papermc.paper.event.player.AsyncChatEvent event)
event
- The chat event to get the message from.public static net.kyori.adventure.text.TextComponent itemComponent(java.lang.String message, org.bukkit.inventory.ItemStack itemStack)
message
- The message that should be shown.itemStack
- The item stack that should be shown.public static net.kyori.adventure.text.TextComponent commandComponent(java.lang.String message, java.lang.String command)
message
- The message that should be shown.command
- The command that should be executed on click.public static net.kyori.adventure.text.TextComponent hyperlinkComponent(java.lang.String message, java.lang.String url)
message
- The message that should be shown.url
- The url that should be opened on click.public static void broadcast(java.lang.String message)
message
- The message to send.public static void broadcast(net.kyori.adventure.text.Component component)
component
- The component to send.private static net.kyori.adventure.text.TextComponent toComponent(java.lang.String text)
text
- The text to convert.private static java.lang.String fromComponent(net.kyori.adventure.text.Component component)
component
- The component to convert.