Package net.mathias2246.buildmc
Interface MainClass
public interface MainClass
Abstraction for sending messages to players in BuildMC.
This interface exists to provide a consistent way to send messages
to players using Components, regardless of whether the
underlying plugin implementation is Paper or Spigot.
Implementations of this interface handle the differences between server platforms internally, so external code can simply call these methods without worrying about platform-specific APIs.
-
Method Summary
Modifier and TypeMethodDescriptionvoidsendMessage(org.bukkit.command.CommandSender player, net.kyori.adventure.text.Component message) Sends a chat message to a player.voidsendPlayerActionBar(org.bukkit.entity.Player player, net.kyori.adventure.text.Component message) Sends an action bar message to a player.
-
Method Details
-
sendMessage
void sendMessage(org.bukkit.command.CommandSender player, net.kyori.adventure.text.Component message) Sends a chat message to a player.- Parameters:
player- the player to send the message tomessage- the message to send, as aComponent
-
sendPlayerActionBar
void sendPlayerActionBar(org.bukkit.entity.Player player, net.kyori.adventure.text.Component message) Sends an action bar message to a player.- Parameters:
player- the player to send the message tomessage- the message to send, as aComponent
-