make action list not bold

This commit is contained in:
Pyrbu 2023-06-13 23:55:34 +02:00
parent fa890e3924
commit 8f82afeb0b
4 changed files with 10 additions and 14 deletions

@ -9,7 +9,6 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -32,18 +31,18 @@ public class ConsoleCommandAction extends InteractionAction {
@Override @Override
public Component getInfo(String id, int index, CommandContext context) { public Component getInfo(String id, int index, CommandContext context) {
return Component.text(index + ") ", NamedTextColor.GOLD) return Component.text(index + ") ", NamedTextColor.GOLD)
.append(Component.text("[EDIT]", NamedTextColor.DARK_GREEN, TextDecoration.BOLD) .append(Component.text("[EDIT]", NamedTextColor.DARK_GREEN)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click to edit this action", NamedTextColor.GRAY))) Component.text("Click to edit this action", NamedTextColor.GRAY)))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND,
"/" + context.getLabel() + " action edit " + id + " " + index + " consolecommand " + " " + getInteractionType().name() + " " + getCooldown()/1000 + " " + command)) "/" + context.getLabel() + " action edit " + id + " " + index + " consolecommand " + " " + getInteractionType().name() + " " + getCooldown()/1000 + " " + command))
.append(Component.text(" | ", NamedTextColor.GRAY).decoration(TextDecoration.BOLD, false)) .append(Component.text(" | ", NamedTextColor.GRAY))
.append(Component.text("[DELETE]", NamedTextColor.RED, TextDecoration.BOLD) .append(Component.text("[DELETE]", NamedTextColor.RED)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click to delete this action", NamedTextColor.GRAY))) Component.text("Click to delete this action", NamedTextColor.GRAY)))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND,
"/" + context.getLabel() + " action delete " + id + " " + index))) "/" + context.getLabel() + " action delete " + id + " " + index)))
.append(Component.text(" | ", NamedTextColor.GRAY).style(style -> style.decoration(TextDecoration.BOLD, false))) .append(Component.text(" | ", NamedTextColor.GRAY))
.append(Component.text("Console Command: ", NamedTextColor.GREEN) .append(Component.text("Console Command: ", NamedTextColor.GREEN)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click Type: " + getInteractionType().name() + " Cooldown: " + getCooldown()/1000, NamedTextColor.GREEN)))) Component.text("Click Type: " + getInteractionType().name() + " Cooldown: " + getCooldown()/1000, NamedTextColor.GREEN))))

@ -9,7 +9,6 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer; import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -35,13 +34,13 @@ public class MessageAction extends InteractionAction {
@Override @Override
public Component getInfo(String id, int index, CommandContext context) { public Component getInfo(String id, int index, CommandContext context) {
return Component.text(index + ") ", NamedTextColor.GOLD) return Component.text(index + ") ", NamedTextColor.GOLD)
.append(Component.text("[EDIT]", NamedTextColor.DARK_GREEN, TextDecoration.BOLD) .append(Component.text("[EDIT]", NamedTextColor.DARK_GREEN)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click to edit this action", NamedTextColor.GRAY))) Component.text("Click to edit this action", NamedTextColor.GRAY)))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND,
"/" + context.getLabel() + " action edit " + id + " " + index + " message " + getInteractionType().name() + " " + getCooldown()/1000 + " " + message)) "/" + context.getLabel() + " action edit " + id + " " + index + " message " + getInteractionType().name() + " " + getCooldown()/1000 + " " + message))
.append(Component.text(" | ", NamedTextColor.GRAY)) .append(Component.text(" | ", NamedTextColor.GRAY))
.append(Component.text("[DELETE]", NamedTextColor.RED, TextDecoration.BOLD) .append(Component.text("[DELETE]", NamedTextColor.RED)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click to delete this action", NamedTextColor.GRAY))) Component.text("Click to delete this action", NamedTextColor.GRAY)))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND,

@ -9,7 +9,6 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class PlayerCommandAction extends InteractionAction { public class PlayerCommandAction extends InteractionAction {
@ -31,13 +30,13 @@ public class PlayerCommandAction extends InteractionAction {
@Override @Override
public Component getInfo(String id, int index, CommandContext context) { public Component getInfo(String id, int index, CommandContext context) {
return Component.text(index + ") ", NamedTextColor.GOLD) return Component.text(index + ") ", NamedTextColor.GOLD)
.append(Component.text("[EDIT]", NamedTextColor.DARK_GREEN, TextDecoration.BOLD) .append(Component.text("[EDIT]", NamedTextColor.DARK_GREEN)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click to edit this action", NamedTextColor.GRAY))) Component.text("Click to edit this action", NamedTextColor.GRAY)))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND,
"/" + context.getLabel() + " action edit " + id + " " + index + " playercommand " + " " + getInteractionType().name() + " " + getCooldown()/1000 + " " + command)) "/" + context.getLabel() + " action edit " + id + " " + index + " playercommand " + " " + getInteractionType().name() + " " + getCooldown()/1000 + " " + command))
.append(Component.text(" | ", NamedTextColor.GRAY)) .append(Component.text(" | ", NamedTextColor.GRAY))
.append(Component.text("[DELETE]", NamedTextColor.RED, TextDecoration.BOLD) .append(Component.text("[DELETE]", NamedTextColor.RED)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click to delete this action", NamedTextColor.GRAY))) Component.text("Click to delete this action", NamedTextColor.GRAY)))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND,

@ -8,7 +8,6 @@ import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent; import net.kyori.adventure.text.event.ClickEvent;
import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class SwitchServerAction extends InteractionAction { public class SwitchServerAction extends InteractionAction {
@ -29,13 +28,13 @@ public class SwitchServerAction extends InteractionAction {
@Override @Override
public Component getInfo(String id, int index, CommandContext context) { public Component getInfo(String id, int index, CommandContext context) {
return Component.text(index + ") ", NamedTextColor.GOLD) return Component.text(index + ") ", NamedTextColor.GOLD)
.append(Component.text("[EDIT]", NamedTextColor.DARK_GREEN, TextDecoration.BOLD) .append(Component.text("[EDIT]", NamedTextColor.DARK_GREEN)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click to edit this action", NamedTextColor.GRAY))) Component.text("Click to edit this action", NamedTextColor.GRAY)))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND,
"/" + context.getLabel() + " action edit " + id + " " + index + " switcserver " + " " + getInteractionType().name() + " " + getCooldown()/1000 + " " + server)) "/" + context.getLabel() + " action edit " + id + " " + index + " switcserver " + " " + getInteractionType().name() + " " + getCooldown()/1000 + " " + server))
.append(Component.text(" | ", NamedTextColor.GRAY)) .append(Component.text(" | ", NamedTextColor.GRAY))
.append(Component.text("[DELETE]", NamedTextColor.RED, TextDecoration.BOLD) .append(Component.text("[DELETE]", NamedTextColor.RED)
.hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT, .hoverEvent(HoverEvent.hoverEvent(HoverEvent.Action.SHOW_TEXT,
Component.text("Click to delete this action", NamedTextColor.GRAY))) Component.text("Click to delete this action", NamedTextColor.GRAY)))
.clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND, .clickEvent(ClickEvent.clickEvent(ClickEvent.Action.SUGGEST_COMMAND,