13.4_SNAPSHOT-1
This commit is contained in:
@@ -18,6 +18,7 @@ import net.t2code.t2codelib.SPIGOT.system.config.languages.LanguagesCreate;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.languages.SelectLibMsg;
|
||||
import net.t2code.t2codelib.Util;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
@@ -32,7 +33,7 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
private static List<String> autor;
|
||||
private static String version;
|
||||
|
||||
private static Boolean nmIsLoad = true;
|
||||
private static Boolean mmIsLoad = true;
|
||||
private static Boolean load = false;
|
||||
|
||||
@Override
|
||||
@@ -41,7 +42,11 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
plugin = this;
|
||||
autor = plugin.getDescription().getAuthors();
|
||||
version = plugin.getDescription().getVersion();
|
||||
adventure = BukkitAudiences.create(this);
|
||||
try {
|
||||
adventure = BukkitAudiences.create(this);
|
||||
} catch (Exception e) {
|
||||
mmIsLoad = false;
|
||||
}
|
||||
long long_ = T2Ctemplate.onLoadHeader(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||
String prefix = Util.getPrefix();
|
||||
|
||||
@@ -58,10 +63,12 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
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.console(prefix);
|
||||
T2Csend.console(prefix + " §4!!!!!!!!!!!!!!!!!!!!");
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
if (!SelectLibConfig.getT2cTestDevelopment()) {
|
||||
try {
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
T2Csend.console(prefix + " §3Server run on: §6" + T2CmcVersion.getMcVersion() + " / " + T2CmcVersion.getNms());
|
||||
@@ -100,6 +107,7 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
|
||||
ReportLogStorage.load();
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new JoinEvent(), plugin);
|
||||
checkIsBungee();
|
||||
T2Ctemplate.onLoadFooter(prefix, long_);
|
||||
load = true;
|
||||
}
|
||||
@@ -117,7 +125,7 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
|
||||
Vault.vaultDisable();
|
||||
T2Ctemplate.onDisable(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||
if (nmIsLoad) {
|
||||
if (mmIsLoad) {
|
||||
if (this.adventure != null) {
|
||||
this.adventure.close();
|
||||
this.adventure = null;
|
||||
@@ -167,7 +175,20 @@ public final class T2CodeLibMain extends JavaPlugin {
|
||||
return adventure;
|
||||
}
|
||||
|
||||
public static Boolean getNmIsLoad() {
|
||||
return nmIsLoad;
|
||||
private static void checkIsBungee() {
|
||||
File config = new File("spigot.yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
isBungee = yamlConfiguration.getBoolean("settings.bungeecord");
|
||||
}
|
||||
|
||||
private static Boolean isBungee;
|
||||
|
||||
public static Boolean getIsBungee() {
|
||||
return isBungee;
|
||||
}
|
||||
|
||||
public static Boolean getMmIsLoad() {
|
||||
return mmIsLoad;
|
||||
}
|
||||
}
|
||||
|
@@ -1,15 +0,0 @@
|
||||
package net.t2code.t2codelib.SPIGOT.system;
|
||||
|
||||
public enum UpdateType {
|
||||
PRERELEASE("<light_purple>Pre-Release</light_purple>"),
|
||||
DEVELOPMENT("<dark_red>DEV</dark_red>"),
|
||||
BETA("<gold>BETA</gold>"),
|
||||
SNAPSHOT("<yellow>SNAPSHOT</yellow>"),
|
||||
STABLE("<dark_green>STABLE</dark_green>");
|
||||
|
||||
public String text;
|
||||
|
||||
UpdateType(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
}
|
@@ -52,6 +52,6 @@ public class Commands {
|
||||
}
|
||||
|
||||
public static void updateInfo(CommandSender sender, String[] args) {
|
||||
T2Csend.sender(sender, T2CupdateAPI.updateInfo(sender, args, sender instanceof Player));
|
||||
T2Csend.sender(sender, T2CupdateAPI.updateInfo(args, sender instanceof Player));
|
||||
}
|
||||
}
|
||||
|
@@ -17,10 +17,12 @@ import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
@@ -45,13 +47,15 @@ public class CreateReportLog {
|
||||
try {
|
||||
pWriter = new PrintWriter(new FileWriter(file.getPath()));
|
||||
String timeStamp = new SimpleDateFormat("HH:mm:ss dd.MM.yyyy").format(Calendar.getInstance().getTime());
|
||||
pWriter.println("Created on: " + timeStamp);
|
||||
pWriter.println("Created on: " + timeStamp + " - from: " + sender.getName());
|
||||
pWriter.println();
|
||||
pWriter.println("Server Bukkit version: " + T2CmcVersion.getBukkitVersion());
|
||||
pWriter.println("Server run on: " + T2CmcVersion.getMcVersion());
|
||||
pWriter.println("Server NMS: " + T2CmcVersion.getNms());
|
||||
pWriter.println();
|
||||
pWriter.println("Online Mode: " + Bukkit.getOnlineMode());
|
||||
pWriter.println("Bungee Mode: " + T2CodeLibMain.getIsBungee());
|
||||
pWriter.println("Server Port: " + Bukkit.getServer().getPort());
|
||||
pWriter.println();
|
||||
pWriter.println("Worlds: " + Bukkit.getWorlds());
|
||||
pWriter.println("OP-Player:");
|
||||
for (OfflinePlayer player : Bukkit.getOperators()) {
|
||||
@@ -92,7 +96,6 @@ public class CreateReportLog {
|
||||
pWriter.println("T2C-LuckyBox isV: " + LuckyBoxAPI.isV());
|
||||
pWriter.println();
|
||||
}
|
||||
pWriter.println();
|
||||
pWriter.println("OfflinePlayers: ");
|
||||
for (OfflinePlayer player : Bukkit.getOfflinePlayers()) {
|
||||
pWriter.println(" - " + player.getName() + " - " + player.getUniqueId());
|
||||
@@ -102,7 +105,7 @@ public class CreateReportLog {
|
||||
pWriter.println("Plugins: ");
|
||||
for (Plugin pl : Bukkit.getPluginManager().getPlugins()) {
|
||||
pWriter.println(" - " + pl.getName() + " - " + pl.getDescription().getVersion() + " - Enabled: " + pl.isEnabled() + " - Autors: "
|
||||
+ pl.getDescription().getAuthors()+" - SoftDepend: " + pl.getDescription().getSoftDepend() + " - Depend: " + pl.getDescription().getDepend()
|
||||
+ pl.getDescription().getAuthors() + " - SoftDepend: " + pl.getDescription().getSoftDepend() + " - Depend: " + pl.getDescription().getDepend()
|
||||
+ " LoadBefore: " + pl.getDescription().getLoadBefore() + " - Website: " + pl.getDescription().getWebsite());
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
@@ -154,11 +157,11 @@ public class CreateReportLog {
|
||||
"<gold><hover:show_text:'<yellow>Download the debug file</yellow>'>here</hover></gold></click>. Please enter the following key " +
|
||||
"in the ticket: <gold><click:copy_to_clipboard:[key]><hover:show_text:'<yellow>Copy to clipboard</yellow>'>[key]</hover></click></gold></green>" +
|
||||
"<br><dark_red>Do not share the download URL with anyone!</dark_red><br><click:run_command:'/t2code debug deleteReportLog [key]'>" +
|
||||
"<green>You can <b>delte </b>yor Debug-File by clicking me.</green></click>").replace("[key]",fileID).replace("[url]",downloadURL));
|
||||
"<green>You can <b>delte </b>yor Debug-File by clicking me.</green></click>").replace("[key]", fileID).replace("[url]", downloadURL));
|
||||
}
|
||||
T2Csend.console(Util.getPrefix() + (" §6A DebugLog zip has been created. You can download it here: [url].\n§6Please enter the following key in the ticket:" +
|
||||
" §e[key].\n§4Do not share the download URL with anyone!\nYou can delte yor Debug-File with the following command: /t2code debug deleteReportLog [key].")
|
||||
.replace("[key]",fileID).replace("[url]",downloadURL));
|
||||
.replace("[key]", fileID).replace("[url]", downloadURL));
|
||||
ReportLogStorage.add(fileID);
|
||||
}
|
||||
|
||||
@@ -231,11 +234,11 @@ public class CreateReportLog {
|
||||
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||
con.setRequestMethod("GET");
|
||||
int response = con.getResponseCode();
|
||||
if(response == 200){
|
||||
if (response == 200) {
|
||||
ReportLogStorage.remove(arg);
|
||||
T2Csend.sender(sender,"<green>Deleted report: <yellow>" + arg);
|
||||
}else {
|
||||
T2Csend.sender(sender,"<green>Error while deleting report: <yellow>" + arg);
|
||||
T2Csend.sender(sender, "<green>Deleted report: <yellow>" + arg);
|
||||
} else {
|
||||
T2Csend.sender(sender, "<green>Error while deleting report: <yellow>" + arg);
|
||||
}
|
||||
con.disconnect();
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ import java.io.File;
|
||||
public class SelectLibConfig {
|
||||
|
||||
private static Boolean UpdateCheckOnJoin;
|
||||
private static Boolean t2cTestDevelopment;
|
||||
private static Boolean t2cTestDevelopment = false;
|
||||
private static Integer UpdateCheckTimeInterval;
|
||||
private static Boolean Debug;
|
||||
private static String language;
|
||||
|
Reference in New Issue
Block a user