mirror of
https://github.com/Samsuik/Sakura.git
synced 2026-01-06 15:41:49 +00:00
Update sakura branding
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
|
||||
@@ -31,6 +_,11 @@
|
||||
import net.kyori.adventure.text.event.ClickEvent;
|
||||
import net.kyori.adventure.text.format.TextDecoration;
|
||||
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
||||
+// Sakura start - customise version command
|
||||
+import net.kyori.adventure.text.event.HoverEvent;
|
||||
+import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
+import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
+// Sakura end - customise version command
|
||||
|
||||
@Deprecated(forRemoval = true)
|
||||
public class VersionCommand extends BukkitCommand {
|
||||
@@ -43,6 +_,15 @@
|
||||
return versionFetcher;
|
||||
}
|
||||
|
||||
+ // Sakura start - customise version command
|
||||
+ private static final String VERSION_MESSAGE = """
|
||||
+ <dark_purple>.
|
||||
+ <dark_purple>| <white>This server is running <gradient:red:light_purple>Sakura</gradient>
|
||||
+ <dark_purple>| <white>Commit<dark_gray>: \\<<commit>> <gray>targeting </gray>(<yellow>MC</yellow>: <gray><version></gray>)
|
||||
+ <dark_purple>| <white>Github<dark_gray>: \\<<yellow><click:open_url:'https://github.com/Samsuik/Sakura'>link</click></yellow>>
|
||||
+ <dark_purple>'""";
|
||||
+ // Sakura end - customise version command
|
||||
+
|
||||
public VersionCommand(@NotNull String name) {
|
||||
super(name);
|
||||
|
||||
@@ -54,11 +_,16 @@
|
||||
|
||||
@Override
|
||||
public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) {
|
||||
- if (!testPermission(sender)) return true;
|
||||
-
|
||||
- if (args.length == 0) {
|
||||
+ // Sakura start - customise version command
|
||||
+ if (args.length == 0 || !this.testPermission(sender)) {
|
||||
+ sender.sendMessage(MiniMessage.miniMessage().deserialize(VERSION_MESSAGE,
|
||||
+ Placeholder.component("commit", Component.text("hover", NamedTextColor.YELLOW)
|
||||
+ .hoverEvent(HoverEvent.showText(Component.text(Bukkit.getGitInformation())))),
|
||||
+ Placeholder.unparsed("version", Bukkit.getMinecraftVersion())
|
||||
+ ));
|
||||
//sender.sendMessage("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")"); // Paper - moved to setVersionMessage
|
||||
- sendVersion(sender);
|
||||
+ //sendVersion(sender);
|
||||
+ // Sakura end - customise version command
|
||||
} else {
|
||||
StringBuilder name = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user