13.4_SNAPSHOT-1

This commit is contained in:
2022-11-14 18:45:54 +01:00
parent f70767b361
commit f9b0b512b9
18 changed files with 222 additions and 103 deletions

View File

@@ -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;
}
}