Compare commits

..

No commits in common. "1c962a54d69782610063490e2ab72a60b880f3ec" and "6cbae613a358082e3ef5c7777f39e11a70437b0e" have entirely different histories.

8 changed files with 22 additions and 56 deletions

View File

@ -1,7 +1,7 @@
<component name="ArtifactManager"> <component name="ArtifactManager">
<artifact type="jar" name="T2CodeLib_9.0_Snapshot_2"> <artifact type="jar" name="T2CodeLib_9.0_Snapshot_1">
<output-path>$PROJECT_DIR$/../../Plugins/T2CodeLib/.jar</output-path> <output-path>$PROJECT_DIR$/../../Plugins/T2CodeLib/.jar</output-path>
<root id="archive" name="T2CodeLib_9.0_Snapshot_2.jar"> <root id="archive" name="T2CodeLib_9.0_Snapshot_1.jar">
<element id="module-output" name="T2CodeLib" /> <element id="module-output" name="T2CodeLib" />
</root> </root>
</artifact> </artifact>

View File

@ -2,7 +2,6 @@ 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;
@ -79,30 +78,19 @@ 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 {
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion); if (sender instanceof Player) {
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=======");
} }
} }

View File

@ -63,19 +63,6 @@ public class Replace {
return rp; return rp;
} }
public static String removeColorCode(String value){
String text = value.replace("&", "§");
while(text.contains("§")){
int stelle = text.indexOf("§");
if(text.length() >= stelle+2) {
text = text.substring(0, stelle) + text.substring(stelle + 2);
}else{
text = text.substring(0, stelle) + text.substring(stelle + 1);
}
}
return (text);
}
public static List<String> replacePrice(String prefix,Player player, List<String> Text, String price) { public static List<String> replacePrice(String prefix,Player player, List<String> Text, String price) {
List<String> rp = new ArrayList(); List<String> rp = new ArrayList();

View File

@ -4,7 +4,6 @@ import net.md_5.bungee.protocol.packet.Commands;
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate; import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI; import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
import net.t2code.lib.Util;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
@ -23,25 +22,18 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream; import java.util.zip.ZipOutputStream;
public class CmdExecuter implements CommandExecutor, TabCompleter { public class CmdExecuter implements CommandExecutor, TabCompleter {
private static Plugin plugin = Main.plugin;
private static String prefix = Main.prefix;
private static List autor = Main.autor;
private static String version = Main.version;
private static String spigot = Main.spigot;
private static String discord = Main.discord;
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!sender.hasPermission("t2code.admin")){
send.sender(sender,"§4No Permission §8t2code.admin");
return false;
}
if (args.length == 0) { if (args.length == 0) {
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.autor, Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion); T2CodeTemplate.sendInfo(sender, prefix, spigot, discord, autor, version, UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion);
} else { } else {
switch (args[0].toLowerCase()) {
case "info":
case "plugin":
case "pl":
case "version":
case "ver":
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.autor, Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion);
return false;
}
if ("debug".equals(args[0].toLowerCase())) { if ("debug".equals(args[0].toLowerCase())) {
if (args.length != 2) { if (args.length != 2) {
send.sender(sender,"§4Use: §7/t2code debug createReportLog"); send.sender(sender,"§4Use: §7/t2code debug createReportLog");
@ -61,7 +53,6 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
//TabCompleter //TabCompleter
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{ private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
put("debug", "t2code.admin"); put("debug", "t2code.admin");
put("info", "t2code.admin");
}}; }};
@Override @Override