9.0 #1

Merged
JaTiTV merged 13 commits from CloseInventory into main 2021-12-31 16:19:31 +00:00
Showing only changes of commit 07293cded4 - Show all commits

View File

@ -2,6 +2,7 @@ package net.t2code.lib.Spigot.Lib.messages;
import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent; import net.md_5.bungee.api.chat.TextComponent;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI; import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
import net.t2code.lib.Spigot.system.Main; import net.t2code.lib.Spigot.system.Main;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -78,19 +79,30 @@ public class T2CodeTemplate {
public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, List autor, String pluginVersion, String publicVersion) { public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, List autor, String pluginVersion, String publicVersion) {
send.sender(sender, prefix + "§4======= " + prefix + " §4======="); send.sender(sender, prefix + "§4======= " + prefix + " §4=======");
send.sender(sender, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", "")); send.sender(sender, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
if (sender instanceof Player) {
TextComponent comp2 = new TextBuilder(prefix + " §2Version: §6" + pluginVersion)
.addHover("§8Click to copy").addClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, Replace.removeColorCode(prefix) +" - "+ pluginVersion).build();
sender.spigot().sendMessage(comp2);
if (!publicVersion.equalsIgnoreCase(pluginVersion)) {
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, (Player) sender);
}
TextComponent comp3 = new TextBuilder(prefix + " §2Spigot: §6" + spigot)
.addHover("§8Open Spigot").addClickEvent(ClickEvent.Action.OPEN_URL, spigot).build();
sender.spigot().sendMessage(comp3);
TextComponent comp4 = new TextBuilder(prefix + " §2Discord: §6" + discord)
.addHover("§8Open Discord").addClickEvent(ClickEvent.Action.OPEN_URL, discord).build();
sender.spigot().sendMessage(comp4);
} else {
if (publicVersion.equalsIgnoreCase(pluginVersion)) { if (publicVersion.equalsIgnoreCase(pluginVersion)) {
send.sender(sender, prefix + " §2Version: §6" + pluginVersion); send.sender(sender, prefix + " §2Version: §6" + pluginVersion);
} else { } else {
if (sender instanceof Player) { UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion);
Player player = (Player) sender;
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, player);
}
} }
send.sender(sender, prefix + " §2Spigot: §6" + spigot); send.sender(sender, prefix + " §2Spigot: §6" + spigot);
send.sender(sender, prefix + " §2Discord: §6" + discord); send.sender(sender, prefix + " §2Discord: §6" + discord);
}
send.sender(sender, prefix + "§4======= " + prefix + " §4======="); send.sender(sender, prefix + "§4======= " + prefix + " §4=======");
} }
} }