Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
034bf241e5 | |||
b2ebce50ed | |||
1b8bedc4e6 | |||
4b7d8539ea | |||
|
bb230fb3ea | ||
b01bf2d84f | |||
|
32fe2ab579 | ||
c4282817b0 | |||
|
e9ee3e690c | ||
|
c9ee80dd38 | ||
|
b00b201bce | ||
709bd16317 | |||
66dc27483b | |||
623d6f8c12 |
13
pom.xml
13
pom.xml
@@ -6,7 +6,10 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>14.4</version>
|
||||
<version>15.2</version>
|
||||
<!--version>VERSION_snapshot-0</version-->
|
||||
<!--version>VERSION_beta-0</version-->
|
||||
<!--version>VERSION_dev-0</version-->
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>T2CodeLib</name>
|
||||
@@ -115,7 +118,7 @@
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.19.3-R0.1-SNAPSHOT</version>
|
||||
<version>1.20-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -131,7 +134,7 @@
|
||||
<dependency>
|
||||
<groupId>net.md-5</groupId>
|
||||
<artifactId>bungeecord-api</artifactId>
|
||||
<version>1.19-R0.1-SNAPSHOT</version>
|
||||
<version>1.20-R0.1-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
@@ -163,7 +166,7 @@
|
||||
<dependency>
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
<version>2.11.2</version>
|
||||
<version>2.11.3</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -179,7 +182,7 @@
|
||||
<dependency>
|
||||
<groupId>net.kyori</groupId>
|
||||
<artifactId>adventure-text-minimessage</artifactId>
|
||||
<version>4.13.1</version>
|
||||
<version>4.14.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@@ -48,8 +48,13 @@ public class T2CBupdateAPI {
|
||||
private static String pluginVersion;
|
||||
|
||||
public static void onUpdateCheckTimer(Plugin plugin, String prefix, String discord, Integer spigotID, String url) {
|
||||
Integer finalInterval;
|
||||
if (T2CBlibConfig.getUpdateTimer() < 1){
|
||||
finalInterval = 1;
|
||||
} else finalInterval = T2CBlibConfig.getUpdateTimer();
|
||||
ProxyServer.getInstance().getScheduler().schedule(plugin, new Runnable() {
|
||||
public void run() {
|
||||
if (T2CBlibConfig.getUpdateCheckFullDisable()) return;
|
||||
(new T2CBupdateCheckerGit(plugin, spigotID)).getVersion((webData) -> {
|
||||
pluginVersion = plugin.getDescription().getVersion();
|
||||
T2CupdateObject update = new T2CupdateObject(
|
||||
@@ -72,6 +77,6 @@ public class T2CBupdateAPI {
|
||||
}
|
||||
}, pluginVersion, spigotID, url);
|
||||
}
|
||||
}, 0, T2CBlibConfig.getUpdateTimer() * 60 * 20L, TimeUnit.SECONDS);
|
||||
}, 0, finalInterval * 60 * 20L, TimeUnit.SECONDS);
|
||||
}
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ public class T2CBupdateCheckerGit {
|
||||
}
|
||||
|
||||
public void getVersion(Consumer<T2CupdateWebData> consumer, String pluginVersion, Integer spigotID, String gitKey) {
|
||||
if (T2CBlibConfig.getUpdateCheckFullDisable()) return;
|
||||
String RepoURL = "https://git.t2code.net/api/v1/repos/" + gitKey + "/releases?limit=1";
|
||||
if (!T2CBlibConfig.getSeePreReleaseUpdates()) {
|
||||
RepoURL = RepoURL + "&pre-release=false";
|
||||
|
@@ -34,7 +34,7 @@ public class T2CBload {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
T2CBupdateAPI.onUpdateCheckTimer(plugin, prefix, discord, spigotID,url);
|
||||
T2CBupdateAPI.onUpdateCheckTimer(plugin, prefix, discord, spigotID, url);
|
||||
|
||||
//API
|
||||
plugin.getProxy().registerChannel("t2c:bcmd");
|
||||
|
@@ -43,8 +43,6 @@ public class T2CodeBMain extends Plugin {
|
||||
mmIsLoad = false;
|
||||
}
|
||||
T2CBload.onLoad(plugin, Util.getPrefix(), autor, orgVersion, Util.getSpigot(), Util.getDiscord(), Util.getSpigotID(), Util.getBstatsID(),Util.getGit());
|
||||
String[] fv = orgVersion.split("_");
|
||||
plugin.getDescription().setVersion(fv[0]);
|
||||
version = plugin.getDescription().getVersion();
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package net.t2code.t2codelib.BUNGEE.system.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import net.md_5.bungee.config.ConfigurationProvider;
|
||||
import net.md_5.bungee.config.YamlConfiguration;
|
||||
@@ -22,6 +23,8 @@ public class T2CBlibConfig {
|
||||
}
|
||||
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(config);
|
||||
T2CBconfig.set("UpdateCheck.TimerInMin", 60, configuration);
|
||||
T2CBconfig.set("UpdateCheck.SeePreReleaseUpdates", true, configuration);
|
||||
T2CBconfig.set("Plugin.UpdateCheck.AllPlugins.FullDisable", false, configuration);
|
||||
|
||||
T2CBconfig.set("API.CommandGUI.Enable", false, configuration);
|
||||
T2CBconfig.set("API.AutoResponse.Enable", false, configuration);
|
||||
@@ -37,35 +40,24 @@ public class T2CBlibConfig {
|
||||
|
||||
updateTimer = configuration.getInt("UpdateCheck.TimerInMin");
|
||||
seePreReleaseUpdates = configuration.getBoolean("UpdateCheck.SeePreReleaseUpdates");
|
||||
updateCheckFullDisable = configuration.getBoolean("Plugin.UpdateCheck.AllPlugins.FullDisable");
|
||||
|
||||
apiCommandGUIEnable = configuration.getBoolean("API.CommandGUI.Enable");
|
||||
apiAutoResponse = configuration.getBoolean("API.AutoResponse.Enable");
|
||||
apiOpSecurity = configuration.getBoolean("API.OPSecurity.Enable");
|
||||
}
|
||||
|
||||
@Getter
|
||||
private static Integer updateTimer;
|
||||
@Getter
|
||||
private static Boolean seePreReleaseUpdates;
|
||||
@Getter
|
||||
private static Boolean updateCheckFullDisable;
|
||||
@Getter
|
||||
private static Boolean apiCommandGUIEnable;
|
||||
@Getter
|
||||
private static Boolean apiAutoResponse;
|
||||
@Getter
|
||||
private static Boolean apiOpSecurity;
|
||||
|
||||
public static Integer getUpdateTimer() {
|
||||
return updateTimer;
|
||||
}
|
||||
|
||||
public static Boolean getSeePreReleaseUpdates() {
|
||||
return seePreReleaseUpdates;
|
||||
}
|
||||
|
||||
public static Boolean getApiCommandGUIEnable() {
|
||||
return apiCommandGUIEnable;
|
||||
}
|
||||
|
||||
public static Boolean getApiAutoResponse() {
|
||||
return apiAutoResponse;
|
||||
}
|
||||
|
||||
public static Boolean getApiOpSecurity() {
|
||||
return apiOpSecurity;
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
import net.t2code.t2codelib.Util;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
@@ -19,13 +20,14 @@ public class T2CplmsgBcmd implements Listener {
|
||||
try {
|
||||
String channel = stream.readUTF();
|
||||
String input = stream.readUTF();
|
||||
String serverID = stream.readUTF();
|
||||
if (channel.equals("T2Code-Console")) {
|
||||
ProxyServer.getInstance().getConsole().sendMessage("Command Console: "+ input);
|
||||
ProxyServer.getInstance().getConsole().sendMessage(Util.getPrefix()+" [§6"+serverID+"§r] §cT2C BCMD Command Console: §r"+ input);
|
||||
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), input);
|
||||
} else {
|
||||
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(channel);
|
||||
if (player != null) {
|
||||
ProxyServer.getInstance().getConsole().sendMessage("Command " + player +": "+ input);
|
||||
ProxyServer.getInstance().getConsole().sendMessage(Util.getPrefix()+" [§6"+serverID+"§r] §cT2C BCMD Command §r" + player +": "+ input);
|
||||
ProxyServer.getInstance().getPluginManager().dispatchCommand(player, input);
|
||||
}
|
||||
}
|
||||
|
@@ -43,6 +43,7 @@ public class T2CmcVersion {
|
||||
nms1_19_R1 = nms.contains("1_19_R1");
|
||||
nms1_19_R2 = nms.contains("1_19_R2");
|
||||
nms1_20_R1 = nms.contains("1_20_R1");
|
||||
nms1_20_R2 = nms.contains("1_20_R2");
|
||||
}
|
||||
|
||||
private static String mcVersion;
|
||||
@@ -83,6 +84,7 @@ public class T2CmcVersion {
|
||||
private static boolean nms1_19_R1;
|
||||
private static boolean nms1_19_R2;
|
||||
private static boolean nms1_20_R1;
|
||||
private static boolean nms1_20_R2;
|
||||
|
||||
public static String getMcVersion() {
|
||||
return mcVersion;
|
||||
@@ -231,4 +233,7 @@ public class T2CmcVersion {
|
||||
public static boolean isNms1_20_R1() {
|
||||
return nms1_20_R1;
|
||||
}
|
||||
public static boolean isNms1_20_R2() {
|
||||
return nms1_20_R2;
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,6 @@ import com.google.gson.JsonObject;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
@@ -13,6 +12,7 @@ import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class T2CnameHistory {
|
||||
public static class NameLookup {
|
||||
@@ -93,7 +93,7 @@ public class T2CnameHistory {
|
||||
con.setReadTimeout(2000);
|
||||
con.connect();
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
String response = in.readLine();
|
||||
String response = in.lines().collect(Collectors.joining());
|
||||
in.close();
|
||||
return response;
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package net.t2code.t2codelib.SPIGOT.api.update;
|
||||
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||
import net.t2code.t2codelib.UpdateType;
|
||||
import net.t2code.t2codelib.T2CupdateObject;
|
||||
import net.t2code.t2codelib.T2CupdateWebData;
|
||||
@@ -180,6 +181,7 @@ public class T2CupdateAPI {
|
||||
}
|
||||
|
||||
public static void onUpdateCheck(Plugin plugin, String prefix, String gitKey, Integer spigotID, String discord, Boolean updateCheckOnJoin, Boolean seePreReleaseUpdates, Integer timeInterval) {
|
||||
if (SelectLibConfig.getUpdateCheckFullDisable()) return;
|
||||
new T2CupdateCheckerGit((JavaPlugin) plugin, prefix, gitKey, spigotID, discord, updateCheckOnJoin, seePreReleaseUpdates, timeInterval);
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
package net.t2code.t2codelib.SPIGOT.api.update;
|
||||
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||
import net.t2code.t2codelib.T2CupdateObject;
|
||||
import net.t2code.t2codelib.T2CupdateWebData;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -30,9 +32,15 @@ public class T2CupdateCheckerGit {
|
||||
}
|
||||
String finalRepoURL = RepoURL;
|
||||
|
||||
Integer finalInterval;
|
||||
if (timeInterval < 1){
|
||||
finalInterval = 1;
|
||||
} else finalInterval = timeInterval;
|
||||
|
||||
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (SelectLibConfig.getUpdateCheckFullDisable()) return;
|
||||
getVersion((webData) -> {
|
||||
T2CupdateObject update = new T2CupdateObject(
|
||||
plugin.getName(),
|
||||
@@ -65,7 +73,7 @@ public class T2CupdateCheckerGit {
|
||||
|
||||
}, plugin.getDescription().getVersion(), spigotID, finalRepoURL, updateCheckOnJoin, seePreReleaseUpdates, timeInterval);
|
||||
}
|
||||
}, 0L, timeInterval * 60 * 20L);
|
||||
}, 0L, finalInterval * 60 * 20L);
|
||||
}
|
||||
|
||||
public void getVersion(Consumer<T2CupdateWebData> consumer, String pluginVersion, Integer spigotID, String URL, Boolean updateCheckOnJoin, Boolean seePreReleaseUpdates, Integer timeInterval) {
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package net.t2code.t2codelib.SPIGOT.system;
|
||||
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
||||
import net.t2code.t2codelib.Util;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -7,6 +9,7 @@ import org.bukkit.entity.Player;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class T2CbungeeCommandSenderReciver {
|
||||
|
||||
@@ -24,18 +27,22 @@ public class T2CbungeeCommandSenderReciver {
|
||||
}
|
||||
}
|
||||
output.writeUTF(information);
|
||||
output.writeUTF(String.valueOf(Util.getServerUUID()));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
player.sendPluginMessage(T2CodeLibMain.getPlugin(), "t2c:bcmd", stream.toByteArray());
|
||||
}else {
|
||||
for(Player player : Bukkit.getOnlinePlayers()){
|
||||
player.sendPluginMessage(T2CodeLibMain.getPlugin(), "t2c:bcmd", stream.toByteArray());
|
||||
return;
|
||||
}
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received T2CbungeeCommandSenderReciver: t2c:bcmd - " + Arrays.toString(stream.toByteArray()) + " Player: " + player.getName());
|
||||
} else {
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
player.sendPluginMessage(T2CodeLibMain.getPlugin(), "t2c:bcmd", stream.toByteArray());
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage received T2CbungeeCommandSenderReciver: t2c:bcmd - " + Arrays.toString(stream.toByteArray()) + " Player: " + player.getName());
|
||||
return;
|
||||
}
|
||||
//todo
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -61,10 +61,10 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
}
|
||||
T2CmcVersion.onCheck();
|
||||
|
||||
if (T2CmcVersion.isMc1_20()) {
|
||||
if (T2CmcVersion.isNms1_20_R2()) {
|
||||
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||
T2Csend.console(prefix);
|
||||
T2Csend.warning(plugin, "The 1.20.* is a very fresh / new version. If there are any bugs in our plugins, please report them to us via our Discord: http://dc.t2code.net");
|
||||
T2Csend.warning(plugin, "The 1.20.* (R2) is a very fresh / new version. If there are any bugs in our plugins, please report them to us via our Discord: http://dc.t2code.net");
|
||||
T2Csend.console(prefix);
|
||||
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||
if (!SelectLibConfig.getT2cTestDevelopment()) {
|
||||
@@ -96,6 +96,9 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
T2Csend.console(prefix + " §3PlaceholderAPI: §6connected" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
}
|
||||
|
||||
T2Csend.console(prefix + " §3Kyori MiniMessage Support: "+ (getMmIsLoad() ? "§2load" : "§4not load") + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
|
||||
|
||||
plugin.getCommand("t2code").setExecutor(new CmdExecuter());
|
||||
ConfigCreate.configCreate();
|
||||
T2CitemVersion.scan();
|
||||
@@ -108,6 +111,7 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
Metrics.Bstats(plugin, Util.getBstatsID());
|
||||
if (SelectLibConfig.getBungee()) {
|
||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bcmd");
|
||||
T2Csend.debug(plugin, "registerIncomingPluginChannel §et2c:bcmd");
|
||||
|
||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bonlp");
|
||||
if (!Bukkit.getMessenger().isIncomingChannelRegistered(plugin, "t2c:bonlp")) {
|
||||
|
@@ -1,8 +1,11 @@
|
||||
package net.t2code.t2codelib.SPIGOT.system.cmd;
|
||||
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||
import net.t2code.t2codelib.SPIGOT.api.bungeePlayers.T2CbungeePlayers;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2CbungeeCommandSenderReciver;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||
import net.t2code.t2codelib.T2CupdateObject;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||
import net.t2code.t2codelib.Util;
|
||||
@@ -38,18 +41,31 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
||||
Commands.info(sender);
|
||||
return false;
|
||||
case "updateinfo":
|
||||
Commands.updateInfo(sender,args);
|
||||
Commands.updateInfo(sender, args);
|
||||
return false;
|
||||
case "reloadconfig":
|
||||
SelectLibConfig.onSelect();
|
||||
T2Csend.sender(sender, Util.getPrefix() + " §2Config successfully reloaded");
|
||||
return false;
|
||||
case "debug":
|
||||
Commands.debug(sender,args);
|
||||
Commands.debug(sender, args);
|
||||
return false;
|
||||
case "test":
|
||||
T2Csend.sender(sender, T2CbungeePlayers.getBungeePlayers().toString());
|
||||
return false;
|
||||
case "serverid":
|
||||
T2Csend.sender(sender, ("[prefix] <red>T2C ServerID:</red> <gold><hover:show_text:'<yellow>copy</yellow>'>" +
|
||||
"<click:copy_to_clipboard:[id]>[id]</click></hover></gold>").replace("[prefix]", Util.getPrefix()).replace("[id]", String.valueOf(Util.getServerUUID())));
|
||||
return false;
|
||||
case "bcmd":
|
||||
String cmd = "";
|
||||
for (String s : args) {
|
||||
cmd = cmd + s + " ";
|
||||
}
|
||||
cmd = cmd.replace("bcmd ", "");
|
||||
T2CbungeeCommandSenderReciver.sendToBungee(null, cmd, true);
|
||||
T2Cdebug.debug(T2CodeLibMain.getPlugin(), "PluginMessage BCMD: " + cmd);
|
||||
return false;
|
||||
|
||||
default:
|
||||
T2Csend.sender(sender, "§4Use: §7/t2code debug createReportLog");
|
||||
@@ -61,6 +77,8 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
||||
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
|
||||
put("debug", "t2code.admin");
|
||||
put("info", "t2code.admin");
|
||||
put("serverid", "t2code.admin");
|
||||
put("bcmd", "t2code.admin");
|
||||
put("reloadconfig", "t2code.admin");
|
||||
put("updateinfo", "t2code.admin");
|
||||
}};
|
||||
@@ -81,17 +99,23 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("debug")) {
|
||||
if (sender.hasPermission("t2code.admin")) {
|
||||
if (hasPermission(p, arg1.get("debug"))) {
|
||||
if (passend("createReportLog",args[1])) list.add("createReportLog");
|
||||
if (passend("deleteReportLog",args[1])) list.add("deleteReportLog");
|
||||
if (passend("createReportLog", args[1])) list.add("createReportLog");
|
||||
if (passend("deleteReportLog", args[1])) list.add("deleteReportLog");
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("bcmd")) {
|
||||
if (sender.hasPermission("t2code.admin")) {
|
||||
list.add("<command>");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("updateinfo")) {
|
||||
if (sender.hasPermission("t2code.admin")) {
|
||||
if (hasPermission(p, arg1.get("updateinfo"))) {
|
||||
for (Map.Entry<String, T2CupdateObject> pl : T2CupdateAPI.pluginVersions.entrySet()){
|
||||
if (passend(pl.getValue().pluginName,args[1])) list.add(pl.getValue().pluginName);
|
||||
for (Map.Entry<String, T2CupdateObject> pl : T2CupdateAPI.pluginVersions.entrySet()) {
|
||||
if (passend(pl.getValue().pluginName, args[1])) list.add(pl.getValue().pluginName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,11 +123,11 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
|
||||
}
|
||||
|
||||
|
||||
if (args.length == 3 && args[0].equalsIgnoreCase("debug")&& args[1].equalsIgnoreCase("deleteReportLog")) {
|
||||
if (args.length == 3 && args[0].equalsIgnoreCase("debug") && args[1].equalsIgnoreCase("deleteReportLog")) {
|
||||
if (sender.hasPermission("t2code.admin")) {
|
||||
if (hasPermission(p, arg1.get("debug"))) {
|
||||
for (String st : ReportLogStorage.list){
|
||||
if (passend(st,args[2])) list.add(st);
|
||||
for (String st : ReportLogStorage.list) {
|
||||
if (passend(st, args[2])) list.add(st);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ package net.t2code.t2codelib.SPIGOT.system.cmd;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2CbungeeCommandSenderReciver;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||
import net.t2code.t2codelib.Util;
|
||||
import org.bukkit.Bukkit;
|
||||
|
@@ -29,7 +29,10 @@ import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
@@ -101,18 +104,30 @@ public class CreateReportLog {
|
||||
pWriter.println("T2C-LuckyBox isV: " + LuckyBoxAPI.isV());
|
||||
pWriter.println();
|
||||
}
|
||||
|
||||
pWriter.println("OfflinePlayers amount: " + Bukkit.getOfflinePlayers().length);
|
||||
pWriter.println("OfflinePlayers: ");
|
||||
for (OfflinePlayer player : Bukkit.getOfflinePlayers()) {
|
||||
|
||||
ArrayList<OfflinePlayer> players = new ArrayList<>();
|
||||
Collections.addAll(players, Bukkit.getOfflinePlayers());
|
||||
players.sort(Comparator.comparing(OfflinePlayer::getName));
|
||||
for (OfflinePlayer player : players) {
|
||||
pWriter.println(" - " + player.getName() + " - " + player.getUniqueId());
|
||||
}
|
||||
|
||||
pWriter.println();
|
||||
pWriter.println("Plugins amount: " + Bukkit.getPluginManager().getPlugins().length);
|
||||
pWriter.println("Plugins: ");
|
||||
for (Plugin pl : Bukkit.getPluginManager().getPlugins()) {
|
||||
|
||||
ArrayList<Plugin> plugins = new ArrayList<>();
|
||||
Collections.addAll(plugins, Bukkit.getPluginManager().getPlugins());
|
||||
plugins.sort(Comparator.comparing(Plugin::getName));
|
||||
for (Plugin pl : plugins) {
|
||||
pWriter.println(" - " + pl.getName() + " - " + pl.getDescription().getVersion() + " - Enabled: " + pl.isEnabled() + " - Autors: "
|
||||
+ pl.getDescription().getAuthors() + " - SoftDepend: " + pl.getDescription().getSoftDepend() + " - Depend: " + pl.getDescription().getDepend()
|
||||
+ " LoadBefore: " + pl.getDescription().getLoadBefore() + " - Website: " + pl.getDescription().getWebsite());
|
||||
}
|
||||
|
||||
} catch (IOException ioe) {
|
||||
ioe.printStackTrace();
|
||||
} finally {
|
||||
|
@@ -22,9 +22,11 @@ public class ConfigCreate {
|
||||
File config = new File(T2CodeLibMain.getPath(), "config.yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
|
||||
T2Cconfig.set("Plugin.UpdateCheck.OnJoin", true, yamlConfiguration);
|
||||
T2Cconfig.set("Plugin.UpdateCheck.TimeInterval", 60, yamlConfiguration);
|
||||
T2Cconfig.set("Plugin.UpdateCheck.SeePreReleaseUpdates", true, yamlConfiguration);
|
||||
T2Cconfig.set("Plugin.UpdateCheck.AllPlugins.FullDisable", false, yamlConfiguration);
|
||||
T2Cconfig.set("Plugin.language", "english", yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("BungeeCord.Enable", T2CodeLibMain.getIsBungee(), yamlConfiguration);
|
||||
|
@@ -17,6 +17,8 @@ public class SelectLibConfig {
|
||||
@Getter
|
||||
private static Boolean seePreReleaseUpdates;
|
||||
@Getter
|
||||
private static Boolean updateCheckFullDisable;
|
||||
@Getter
|
||||
private static Boolean debug;
|
||||
@Getter
|
||||
private static String language;
|
||||
@@ -36,6 +38,7 @@ public class SelectLibConfig {
|
||||
updateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.UpdateCheck.OnJoin");
|
||||
updateCheckTimeInterval = yamlConfiguration.getInt("Plugin.UpdateCheck.TimeInterval");
|
||||
seePreReleaseUpdates = yamlConfiguration.getBoolean("Plugin.UpdateCheck.SeePreReleaseUpdates");
|
||||
updateCheckFullDisable = yamlConfiguration.getBoolean("Plugin.UpdateCheck.AllPlugins.FullDisable");
|
||||
debug = yamlConfiguration.getBoolean("Plugin.Debug");
|
||||
language = yamlConfiguration.getString("Plugin.language");
|
||||
bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
||||
|
Reference in New Issue
Block a user