Class ChatLayout
java.lang.Object
dev.despical.pixelpainter.command.ChatLayout
Provides shared chat layout primitives for panel headings, hints and navigation.
Text is measured with Minecraft bitmap-font advances so centering depends on the
rendered width instead of the character count. Formatting and interactions of the
wrapped components are retained; only spacing is added. Console senders receive the
plain text path of Messages.reply(CommandSender, Component).
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcentered(org.bukkit.command.CommandSender sender, Messages messages, net.kyori.adventure.text.Component component, boolean bold) Sends a component centered for players, or unchanged for the console.static voidheader(org.bukkit.command.CommandSender sender, Messages messages, String title, Object... replacements) Sends the separator, an empty line and the centered bold title to players.static voidnavigation(org.bukkit.command.CommandSender sender, Messages messages, String command, int page, int pages) Sends centered previous and next buttons when more than one page exists.static intpixelWidth(net.kyori.adventure.text.Component component, boolean bold) Measures a component in bitmap-font pixels.static StringWraps text at word boundaries for hover descriptions.
-
Method Details
-
header
public static void header(org.bukkit.command.CommandSender sender, Messages messages, String title, Object... replacements) Sends the separator, an empty line and the centered bold title to players.- Parameters:
sender- command audiencemessages- active messagestitle- title message keyreplacements- alternating placeholder names and values
-
centered
public static void centered(org.bukkit.command.CommandSender sender, Messages messages, net.kyori.adventure.text.Component component, boolean bold) Sends a component centered for players, or unchanged for the console.- Parameters:
sender- command audiencemessages- active messagescomponent- content to centerbold- whether the content is rendered bold
-
pixelWidth
public static int pixelWidth(net.kyori.adventure.text.Component component, boolean bold) Measures a component in bitmap-font pixels.- Parameters:
component- content to measurebold- whether bold glyph widening applies- Returns:
- width in font pixels
-
wrap
-