Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
7f706cce49 | |||
a84b185812 | |||
|
82905c0d66 | ||
868d36e1b5 | |||
|
f35b4efe4f | ||
14741afb8d |
@@ -45,10 +45,10 @@
|
|||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.11.1" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.11.1" level="project" />
|
||||||
<orderEntry type="library" name="Maven: org.jetbrains:annotations:19.0.0" level="project" />
|
<orderEntry type="library" name="Maven: org.jetbrains:annotations:19.0.0" level="project" />
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.bencodez:votingplugin:6.9.2" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: com.bencodez:votingplugin:6.9.3" level="project" />
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-velocity:2.2.1" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-velocity:2.2.1" level="project" />
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-base:2.2.1" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bstats:bstats-base:2.2.1" level="project" />
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.bencodez:advancedcore:master-1634c37011-1" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.bencodez:advancedcore:master-28bd248b49-1" level="project" />
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: com.zaxxer:HikariCP:3.4.1" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: com.zaxxer:HikariCP:3.4.1" level="project" />
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
|
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-simple:1.7.5" level="project" />
|
||||||
|
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<version>12.4</version>
|
<version>12.6</version>
|
||||||
<!-- <classifier>dev-1</classifier> -->
|
<!-- <classifier>dev-1</classifier> -->
|
||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.eco;
|
package net.t2code.lib.Spigot.Lib.eco;
|
||||||
|
|
||||||
import com.bencodez.votingplugin.VotingPluginMain;
|
import com.bencodez.votingplugin.VotingPluginMain;
|
||||||
import com.bencodez.votingplugin.user.VotingPluginUser;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
import net.t2code.lib.Spigot.system.T2CodeMain;
|
||||||
|
@@ -5,7 +5,6 @@ import net.md_5.bungee.api.chat.TextComponent;
|
|||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
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.config.SelectLibConfig;
|
|
||||||
import net.t2code.lib.Util;
|
import net.t2code.lib.Util;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@@ -40,6 +40,9 @@ public class PluginCheck {
|
|||||||
public static Boolean cgui(){
|
public static Boolean cgui(){
|
||||||
return Bukkit.getPluginManager().getPlugin("CommandGUI") != null;
|
return Bukkit.getPluginManager().getPlugin("CommandGUI") != null;
|
||||||
}
|
}
|
||||||
|
public static Boolean functiongui(){
|
||||||
|
return Bukkit.getPluginManager().getPlugin("T2C-CommandGUI") != null;
|
||||||
|
}
|
||||||
public static Boolean plotSquaredGUI(){
|
public static Boolean plotSquaredGUI(){
|
||||||
return Bukkit.getPluginManager().getPlugin("PlotSquaredGUI") != null;
|
return Bukkit.getPluginManager().getPlugin("PlotSquaredGUI") != null;
|
||||||
}
|
}
|
||||||
|
@@ -1,22 +1,42 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.plugins;
|
package net.t2code.lib.Spigot.Lib.plugins;
|
||||||
|
|
||||||
|
import net.t2code.lib.Spigot.system.T2CodeMain;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
public class T2CPluginManager {
|
public class T2CPluginManager {
|
||||||
|
|
||||||
public static void restart(String plugin) {
|
public static void restart(String plugin) {
|
||||||
|
if (Bukkit.getPluginManager().getPlugin(plugin) == null) return;
|
||||||
Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)).onEnable();
|
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
||||||
Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)).onDisable();
|
T2CodeMain.getPlugin().getPluginLoader().enablePlugin(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(plugin)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void enable(String 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) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
package net.t2code.lib.Spigot.Lib.replace;
|
package net.t2code.lib.Spigot.Lib.replace;
|
||||||
|
|
||||||
import me.clip.placeholderapi.PlaceholderAPI;
|
import me.clip.placeholderapi.PlaceholderAPI;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import net.t2code.lib.Spigot.system.T2CodeMain;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@@ -34,7 +34,7 @@ public class UpdateAPI {
|
|||||||
public void run() {
|
public void run() {
|
||||||
join(plugin, prefix, perm, player, spigot, discord);
|
join(plugin, prefix, perm, player, spigot, discord);
|
||||||
}
|
}
|
||||||
}.runTaskLater(plugin, 20L);
|
}.runTaskLaterAsynchronously(plugin, 20L);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String publicVersion = UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion;
|
String publicVersion = UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion;
|
||||||
@@ -45,12 +45,12 @@ public class UpdateAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void use(Plugin plugin, String prefix, Player player, String pluginVersion, String publicVersion, String spigot, String discord) {
|
private static void use(Plugin plugin, String prefix, Player player, String pluginVersion, String publicVersion, String spigot, String discord) {
|
||||||
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, player);
|
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, player);
|
||||||
}
|
}
|
||||||
}, 200L);
|
}.runTaskLaterAsynchronously(plugin, 200L);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion) {
|
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion) {
|
||||||
@@ -74,27 +74,29 @@ public class UpdateAPI {
|
|||||||
send.console("§4=========== " + Prefix + " §4===========");
|
send.console("§4=========== " + Prefix + " §4===========");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion, Player player) {
|
public static void sendUpdateMsg(String prefix, String Spigot, String Discord, String pluginVersion, String publicVersion, Player player) {
|
||||||
if (publicVersion.equals("§4No public version found!")) {
|
if (publicVersion.equals("§4No public version found!")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send.player(player, Prefix);
|
String st = "[prefix]<br>" +
|
||||||
|
"<click:open_url:'[link]'><hover:show_text:'<gold>You can download it here: <yellow>[link]</yellow></gold>'>[prefix] <gold>A new</gold> [value]<gold>version was found!</gold></hover></click><br>" +
|
||||||
|
"<click:open_url:'[link]'><hover:show_text:'<gold>You can download it here: <yellow>[link]</yellow></gold>'>[prefix] <red>[plv]</red> <gray>-></gray> <green>[puv]</green></hover></click><br>" +
|
||||||
|
"<click:open_url:'[dc]'><hover:show_text:'<yellow>[dc]</yellow>'>[prefix] <gold>You can find more information on Discord.</gold></hover></click><br>" +
|
||||||
|
"[prefix]";
|
||||||
|
String value = "";
|
||||||
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")) {
|
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")) {
|
||||||
if (publicVersion.toLowerCase().contains("dev")) {
|
if (publicVersion.toLowerCase().contains("dev")) {
|
||||||
HoverModule.modulePlayer(Prefix + " §6A new §4DEV§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
value = "<dark_red>DEV </dark_red>";
|
||||||
}
|
}
|
||||||
if (publicVersion.toLowerCase().contains("beta")) {
|
if (publicVersion.toLowerCase().contains("beta")) {
|
||||||
HoverModule.modulePlayer(Prefix + " §6A new §2BETA§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
value = "<green>BETA </green>";
|
||||||
}
|
}
|
||||||
if (publicVersion.toLowerCase().contains("snapshot")) {
|
if (publicVersion.toLowerCase().contains("snapshot")) {
|
||||||
HoverModule.modulePlayer(Prefix + " §6A new §eSNAPSHOT§6 version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
value = "<yellow>SNAPSHOT </yellow>";
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
HoverModule.modulePlayer(Prefix + " §6A new version was found!", "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
|
||||||
}
|
}
|
||||||
HoverModule.modulePlayer(Prefix + " §c" + pluginVersion + " §7-> §a" + publicVersion, "§6You can download it here: §e" + Spigot, "OPEN_URL", Spigot, player);
|
send.player(player, st.replace("[prefix]", prefix).replace("[value]", value).replace("[link]", Spigot)
|
||||||
HoverModule.modulePlayer(Prefix + " §6You can find more information on Discord.", "§e" + Discord, "OPEN_URL", Discord, player);
|
.replace("[plv]",pluginVersion).replace("[puv]",publicVersion).replace("[dc]",Discord));
|
||||||
send.player(player, Prefix);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Boolean noUpdate = true;
|
private static Boolean noUpdate = true;
|
||||||
@@ -183,7 +185,7 @@ public class UpdateAPI {
|
|||||||
"§4No public version found!"
|
"§4No public version found!"
|
||||||
);
|
);
|
||||||
UpdateAPI.PluginVersionen.put(plugin.getName(), update);
|
UpdateAPI.PluginVersionen.put(plugin.getName(), update);
|
||||||
this.plugin.getLogger().severe(Prefix + "§4 Cannot look for updates: " + var10.getMessage());
|
this.plugin.getLogger().severe("§4 Cannot look for updates: " + var10.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -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." +
|
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!");
|
" Please report all bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
|
||||||
send.console(prefix + " §4 §e-------------------");
|
send.console(prefix + " §4 §e-------------------");
|
||||||
try {
|
|
||||||
Thread.sleep(5000);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user