Package me.totalfreedom.utils.kyori
Class KyoriConstants
java.lang.Object
me.totalfreedom.utils.kyori.KyoriConstants
This class contains different methods to provide
Even though Scissors has this feature disabled, upstream (Paper) and Kyori Adventure have made the appropriate API changes to accomodate chat signatures.
As a result, we need to conform to those specifications even if we do not use this feature.
ChatType.Bound instances for sending messages to players in
game. This is now a requirement for all message requests to players due to the new chat signature system.
Even though Scissors has this feature disabled, upstream (Paper) and Kyori Adventure have made the appropriate API changes to accomodate chat signatures.
As a result, we need to conform to those specifications even if we do not use this feature.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.kyori.adventure.chat.ChatType.BoundA singletonChatType.Boundfor the Patchwork plugin. -
Method Summary
Modifier and TypeMethodDescriptionstatic net.kyori.adventure.chat.ChatType.BoundfromConsole(org.bukkit.command.ConsoleCommandSender sender) Represents a Chat Bound for the console.static net.kyori.adventure.chat.ChatType.BoundfromPlayer(org.bukkit.entity.Player player) Represents a Chat Bound for a player.static net.kyori.adventure.chat.ChatType.BoundfromPlugin(Class<? extends org.bukkit.plugin.java.JavaPlugin> pluginClass) Represents a Chat Bound for a plugin.static net.kyori.adventure.chat.ChatType.BoundfromPlugin(org.bukkit.plugin.java.JavaPlugin plugin)
-
Field Details
-
PATCHWORK
public static final net.kyori.adventure.chat.ChatType.Bound PATCHWORKA singletonChatType.Boundfor the Patchwork plugin.
-
-
Method Details
-
fromPlugin
public static net.kyori.adventure.chat.ChatType.Bound fromPlugin(Class<? extends org.bukkit.plugin.java.JavaPlugin> pluginClass) Represents a Chat Bound for a plugin.
This is a convenience method so you are not required to dependency inject your plugin instance any time that you need a Bound.- Parameters:
pluginClass- The plugin class to get the plugin instance from.- Returns:
- A ChatType.Bound instance for the plugin.
- See Also:
-
fromPlugin
public static net.kyori.adventure.chat.ChatType.Bound fromPlugin(org.bukkit.plugin.java.JavaPlugin plugin) -
fromPlayer
public static net.kyori.adventure.chat.ChatType.Bound fromPlayer(org.bukkit.entity.Player player) Represents a Chat Bound for a player. Chat bounds are required for sending messages to players.
The chat bound is a representation of a validated chat signature, which is tied directly to the user's account name. In our case, this is the player's name.- Parameters:
player- The player to get the bound for.- Returns:
- A ChatType.Bound instance for the player.
-
fromConsole
public static net.kyori.adventure.chat.ChatType.Bound fromConsole(org.bukkit.command.ConsoleCommandSender sender) Represents a Chat Bound for the console.
The chat bound is a representation of a validated chat signature, which is tied directly to the user's account name. In our case, this is the player's name.- Parameters:
sender- The console to get the bound for.- Returns:
- A ChatType.Bound instance for the console.
-