This commit is contained in:
JaTiTV 2022-07-14 21:37:58 +02:00
parent 8f05d5c677
commit 14741afb8d
4 changed files with 29 additions and 11 deletions

View File

@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>12.4</version>
<version>12.5</version>
<!-- <classifier>dev-1</classifier> -->
<groupId>net.t2code</groupId>

View File

@ -40,6 +40,9 @@ public class PluginCheck {
public static Boolean cgui(){
return Bukkit.getPluginManager().getPlugin("CommandGUI") != null;
}
public static Boolean functiongui(){
return Bukkit.getPluginManager().getPlugin("T2C-CommandGUI") != null;
}
public static Boolean plotSquaredGUI(){
return Bukkit.getPluginManager().getPlugin("PlotSquaredGUI") != null;
}

View File

@ -1,22 +1,42 @@
package net.t2code.lib.Spigot.Lib.plugins;
import net.t2code.lib.Spigot.system.T2CodeMain;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import java.util.Objects;
public class T2CPluginManager {
public static void restart(String plugin) {
Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)).onEnable();
Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)).onDisable();
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
}
public static void enable(String plugin) {
Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)).onEnable();
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
}
public static void disable(String plugin) {
Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)).onDisable();
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
}
public static void restart(Plugin plugin) {
if (plugin == null) return;
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(plugin);
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(plugin);
}
public static void enable(Plugin plugin) {
if (plugin == null) return;
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(plugin);
}
public static void disable(Plugin plugin) {
if (plugin == null) return;
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(plugin);
}
}

View File

@ -110,11 +110,6 @@ public final class T2CodeMain extends JavaPlugin {
send.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! §4This is a trial version! §eSome features may not be working as expected." +
" Please report all bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
send.console(prefix + " §4 §e-------------------");
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
try {