mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Build the studio link button in core
- Keep relocated Adventure types out of the plugin module
This commit is contained in:
1 parent
2ae765ca16
commit
c6a7225fa8
2 files changed
+17
-14
No files matched your search
@@ -32,6 +32,9 @@ import art.arcane.volmlib.util.math.M;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.event.ClickEvent;
|
||||
import net.kyori.adventure.text.event.HoverEvent;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.Sound;
|
||||
@@ -326,6 +329,17 @@ public class VolmitSender implements CommandSender {
|
||||
deliver(ComponentText.component(component));
|
||||
}
|
||||
|
||||
/** A green line that copies {@code payload} to a player's clipboard when clicked; a console gets nothing. */
|
||||
public void sendCopyButton(String label, String hover, String payload) {
|
||||
if (!isPlayer()) {
|
||||
return;
|
||||
}
|
||||
sendComponent(Component.text(label)
|
||||
.color(NamedTextColor.GREEN)
|
||||
.clickEvent(ClickEvent.copyToClipboard(payload))
|
||||
.hoverEvent(HoverEvent.showText(Component.text(hover))));
|
||||
}
|
||||
|
||||
private void deliver(ComponentText message) {
|
||||
ComponentMessenger.send(s, message);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user