Compare commits
15 Commits
9.0_Snapsh
...
10.7
Author | SHA1 | Date | |
---|---|---|---|
dd433b26ea | |||
5725251c18 | |||
daed92b022 | |||
8a76bcb2c7 | |||
8debd90a6c | |||
a50f779b16 | |||
ac9972601c | |||
|
ad5d7e09ea | ||
|
c564cdead1 | ||
2db5be7d56 | |||
|
9f19d2b039 | ||
3cb557c0e1 | |||
da2e9ff6a4 | |||
|
68d89e2e9e | ||
c171a1674d |
114
.gitignore
vendored
Normal file
114
.gitignore
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
# User-specific stuff
|
||||
.idea/
|
||||
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
target/
|
||||
target\
|
||||
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
.flattened-pom.xml
|
||||
|
||||
# Common working directory
|
||||
run/
|
8
.idea/artifacts/T2CodeLib_9_0_Snapshot_2.xml
generated
8
.idea/artifacts/T2CodeLib_9_0_Snapshot_2.xml
generated
@@ -1,8 +0,0 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="jar" name="T2CodeLib_9.0_Snapshot_2">
|
||||
<output-path>$PROJECT_DIR$/../../Plugins/T2CodeLib/.jar</output-path>
|
||||
<root id="archive" name="T2CodeLib_9.0_Snapshot_2.jar">
|
||||
<element id="module-output" name="T2CodeLib" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
13
.idea/libraries/Maven__net_t2code_bungee_1615.xml
generated
13
.idea/libraries/Maven__net_t2code_bungee_1615.xml
generated
@@ -1,13 +0,0 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Maven: net.t2code:bungee:1615">
|
||||
<CLASSES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/net/t2code/bungee/1615/bungee-1615.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/net/t2code/bungee/1615/bungee-1615-javadoc.jar!/" />
|
||||
</JAVADOC>
|
||||
<SOURCES>
|
||||
<root url="jar://$MAVEN_REPOSITORY$/net/t2code/bungee/1615/bungee-1615-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>9.0</version>
|
||||
<version>10.7</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>T2CodeLib</name>
|
||||
|
@@ -1,5 +1,12 @@
|
||||
package net.t2code.lib.Bungee.Lib.messages;
|
||||
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.t2code.lib.Bungee.Lib.update.BUpdateAPI;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BT2CodeTemplate {
|
||||
@@ -15,6 +22,7 @@ public class BT2CodeTemplate {
|
||||
Bsend.console(prefix + " §8-------------------------------");
|
||||
return long_;
|
||||
}
|
||||
|
||||
public static void onLoadSeparateStroke(String prefix) {
|
||||
Bsend.console(prefix + " §8-------------------------------");
|
||||
}
|
||||
@@ -35,4 +43,16 @@ public class BT2CodeTemplate {
|
||||
Bsend.console(prefix + "§4============================= " + prefix + " §4=============================");
|
||||
}
|
||||
|
||||
public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, String autor, String pluginVersion, String publicVersion) {
|
||||
Bsend.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
||||
Bsend.sender(sender, prefix + " §2Autor: §6" + autor);
|
||||
if (publicVersion.equalsIgnoreCase(pluginVersion)) {
|
||||
Bsend.sender(sender, prefix + " §2Version: §6" + pluginVersion);
|
||||
} else {
|
||||
BUpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, sender);
|
||||
}
|
||||
Bsend.sender(sender, prefix + " §2Spigot: §6" + spigot);
|
||||
Bsend.sender(sender, prefix + " §2Discord: §6" + discord);
|
||||
Bsend.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,78 @@
|
||||
package net.t2code.lib.Bungee.Lib.plugins;
|
||||
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.t2code.lib.Bungee.BMain;
|
||||
import net.t2code.lib.Spigot.system.Main;
|
||||
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class BPluginCheck {
|
||||
public static Boolean pluginCheck(String pluginName){
|
||||
return (ProxyServer.getInstance().getPluginManager().getPlugin(pluginName) != null);
|
||||
}
|
||||
public static Plugin pluginInfos(String pluginName){
|
||||
return (ProxyServer.getInstance().getPluginManager().getPlugin(pluginName));
|
||||
}
|
||||
public static Boolean papi(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("PlaceholderAPI") != null;
|
||||
}
|
||||
public static Boolean vault(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("Vault") != null;
|
||||
}
|
||||
public static Boolean plotSquared(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("PlotSquared") != null;
|
||||
}
|
||||
public static Boolean plugManGUI(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("PlugManGUI") != null;
|
||||
}
|
||||
public static Boolean cmi(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("CMI") != null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* T2Code Plugins
|
||||
* @return
|
||||
*/
|
||||
public static Boolean cgui(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("CommandGUI") != null;
|
||||
}
|
||||
public static Boolean plotSquaredGUI(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("PlotSquaredGUI") != null;
|
||||
}
|
||||
public static Boolean luckyBox(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("T2C-LuckyBox") != null;
|
||||
}
|
||||
public static Boolean opSec(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("OPSecurity") != null;
|
||||
}
|
||||
public static Boolean papiTest(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("PaPiTest") != null;
|
||||
}
|
||||
public static Boolean booster(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("Booster") != null;
|
||||
}
|
||||
public static Boolean antiMapCopy(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("AAntiMapCopy") != null;
|
||||
}
|
||||
public static Boolean loreEditor(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("LoreEditor") != null;
|
||||
}
|
||||
public static Boolean t2cAlias(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("T2C-Alias") != null;
|
||||
}
|
||||
public static Boolean t2cWarp(){
|
||||
return ProxyServer.getInstance().getPluginManager().getPlugin("T2C-Warp") != null;
|
||||
}
|
||||
|
||||
public static Boolean pluginNotFound(Plugin plugin, String prefix, String pl, Integer spigotID) {
|
||||
if (ProxyServer.getInstance().getPluginManager().getPlugin(pl) == null) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||
ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
||||
BMain.plugin.getProxy().getPluginManager().getPlugin(plugin.getDescription().getName()).onDisable();
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
}
|
@@ -1,10 +1,12 @@
|
||||
package net.t2code.lib.Bungee.Lib.update;
|
||||
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
||||
import net.t2code.lib.Spigot.Lib.update.UpdateObject;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
@@ -15,6 +17,7 @@ import java.util.function.Consumer;
|
||||
|
||||
public class BUpdateAPI {
|
||||
public static HashMap<String, UpdateObject> bungeePluginVersionen = new HashMap<String, UpdateObject>();
|
||||
|
||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String foundVersion, String update_version) {
|
||||
Bsend.console("§4=========== " + Prefix + " §4===========");
|
||||
Bsend.console("§6A new version was found!");
|
||||
@@ -23,6 +26,14 @@ public class BUpdateAPI {
|
||||
Bsend.console("§6You can find more information on Discord: §e" + Discord);
|
||||
Bsend.console("§4=========== " + Prefix + " §4===========");
|
||||
}
|
||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String foundVersion, String update_version, CommandSender sender) {
|
||||
Bsend.sender(sender,"§4=========== " + Prefix + " §4===========");
|
||||
Bsend.sender(sender,"§6A new version was found!");
|
||||
Bsend.sender(sender,"§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version);
|
||||
Bsend.sender(sender,"§6You can download it here: §e" + Spigot);
|
||||
Bsend.sender(sender,"§6You can find more information on Discord: §e" + Discord);
|
||||
Bsend.sender(sender,"§4=========== " + Prefix + " §4===========");
|
||||
}
|
||||
private static Boolean noUpdate = true;
|
||||
private static String pluginVersion;
|
||||
public static void onUpdateCheckTimer(Plugin plugin, String Prefix, String Spigot, String Discord, Integer SpigotID) {
|
||||
|
@@ -0,0 +1,85 @@
|
||||
package net.t2code.lib.Bungee.Lib.yamlConfiguration;
|
||||
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BConfig {
|
||||
public static void set(String path, String value, Configuration configuration) {
|
||||
if (!configuration.contains(path)) {
|
||||
configuration.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
public static void set(String path, Configuration configuration) {
|
||||
configuration.set(path, null);
|
||||
}
|
||||
|
||||
public static void set(String path, Integer value, Configuration configuration) {
|
||||
if (!configuration.contains(path)) {
|
||||
configuration.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
public static void set(String path, Double value, Configuration configuration) {
|
||||
if (!configuration.contains(path)) {
|
||||
configuration.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
public static void set(String path, Boolean value, Configuration configuration) {
|
||||
if (!configuration.contains(path)) {
|
||||
configuration.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
public static void set(String path, List<String> value, Configuration configuration) {
|
||||
if (!configuration.contains(path)) {
|
||||
configuration.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String select(String prefix, String path, Configuration configuration) {
|
||||
return Replace.replace(prefix, configuration.getString(path));
|
||||
}
|
||||
|
||||
|
||||
public static Integer selectInt(String path, Configuration configuration) {
|
||||
return (configuration.getInt(path));
|
||||
}
|
||||
|
||||
public static Boolean selectBoolean(String path, Configuration configuration) {
|
||||
return (configuration.getBoolean(path));
|
||||
}
|
||||
|
||||
public static Double selectDouble(String path, Configuration configuration) {
|
||||
return (configuration.getDouble(path));
|
||||
}
|
||||
|
||||
public static List<String> selectList(String path, Configuration configuration) {
|
||||
return (configuration.getStringList(path));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<String> selectList(String prefix, String path, Configuration configuration) {
|
||||
List<String> output = new ArrayList<>();
|
||||
List<String> input = configuration.getStringList(path);
|
||||
for (String st : input) {
|
||||
output.add(Replace.replace(prefix, st));
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static void select(String prefix, List<String> value, String path, Configuration configuration) {
|
||||
List<String> output = new ArrayList<>();
|
||||
List<String> input = configuration.getStringList(path);
|
||||
for (String st : input) {
|
||||
output.add(Replace.replace(prefix, st));
|
||||
}
|
||||
value = output;
|
||||
}
|
||||
}
|
@@ -4,18 +4,21 @@ import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||
import net.t2code.lib.Spigot.system.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class T2CodeTemplate {
|
||||
public static Long onLoadHeader(String prefix, List autor, String version, String spigot, String discord) {
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord) {
|
||||
return onLoadHeader(prefix, autor, version, spigot, discord, null, null);
|
||||
}
|
||||
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord, Boolean isPremium) {
|
||||
return onLoadHeader(prefix, autor, version, spigot, discord, isPremium, null);
|
||||
}
|
||||
|
||||
public static Long onLoadHeader(String prefix, List<String> autor, String version, String spigot, String discord, Boolean isPremium, Boolean isVerify) {
|
||||
Long long_ = System.currentTimeMillis();
|
||||
// send.console(prefix +" §4===================== " + prefix + " §4=====================");
|
||||
send.console(prefix + " §4 _______ §7___ §4_____ ");
|
||||
send.console(prefix + " §4 |__ __|§7__ \\ §4/ ____|");
|
||||
@@ -28,6 +31,17 @@ public class T2CodeTemplate {
|
||||
send.console(prefix + " §4 §e| §2Version: §6" + version);
|
||||
send.console(prefix + " §4 §e| §2Spigot: §6" + spigot);
|
||||
send.console(prefix + " §4 §e| §2Discord: §6" + discord);
|
||||
if (isPremium != null) {
|
||||
if (isPremium) {
|
||||
send.console(prefix + " §4 §e| §6Premium: §2true");
|
||||
} else send.console(prefix + " §4 §e| §6Premium: §4false");
|
||||
if (isVerify != null) {
|
||||
if (isVerify) {
|
||||
send.console(prefix + " §4 §e| §6Verify: §2true");
|
||||
} else send.console(prefix + " §4 §e| §6Verify: §4false");
|
||||
} else send.console(prefix + " §4 §e| §6Verify: §4false");
|
||||
}
|
||||
|
||||
send.console(prefix + " §4 §e-------------------");
|
||||
if (version.toLowerCase().contains("dev") || version.toLowerCase().contains("snapshot") || version.toLowerCase().contains("beta")) {
|
||||
send.console(prefix + " §eYou are running §4" + version + " §eof " + prefix + "§e! Some features may not be working as expected. Please report all bugs here: http://dc.t2code.net §4UpdateChecker & bStats may be disabled!");
|
||||
@@ -43,7 +57,7 @@ public class T2CodeTemplate {
|
||||
}
|
||||
|
||||
public static Long onLoadHeader(String prefix) {
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
Long long_ = System.currentTimeMillis();
|
||||
send.console(prefix + "§4===================== " + prefix + " §4=====================");
|
||||
return long_;
|
||||
}
|
||||
@@ -54,17 +68,17 @@ public class T2CodeTemplate {
|
||||
|
||||
public static void onLoadFooter(String prefix, Long long_, String version) {
|
||||
onLoadSeparateStroke(prefix);
|
||||
send.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
send.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
// send.console(prefix +" §4===================== " + prefix + "§4=====================");
|
||||
}
|
||||
|
||||
public static void onLoadFooter(String prefix, Long long_) {
|
||||
onLoadSeparateStroke(prefix);
|
||||
send.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
send.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
// send.console(prefix +" §4===================== " + prefix + "§4=====================");
|
||||
}
|
||||
|
||||
public static void onDisable(String prefix, List autor, String version, String spigot, String discord) {
|
||||
public static void onDisable(String prefix, List<String> autor, String version, String spigot, String discord) {
|
||||
//send.console(prefix + "§4===================== " + prefix + " §7- §6" + version + " §4=====================");
|
||||
//send.console(prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||
//send.console(prefix + " §2Version: §6" + version);
|
||||
@@ -76,13 +90,13 @@ public class T2CodeTemplate {
|
||||
send.console(prefix + " §4Plugin successfully disabled.");
|
||||
}
|
||||
|
||||
public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, List autor, String pluginVersion, String publicVersion) {
|
||||
public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, List<String> autor, String pluginVersion, String publicVersion, Boolean isPremium) {
|
||||
send.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
||||
send.sender(sender, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||
if (sender instanceof Player) {
|
||||
|
||||
TextComponent comp2 = new TextBuilder(prefix + " §2Version: §6" + pluginVersion)
|
||||
.addHover("§8Click to copy").addClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, Replace.removeColorCode(prefix) +" - "+ pluginVersion).build();
|
||||
.addHover("§8Click to copy").addClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, Replace.removeColorCode(prefix) + " - " + pluginVersion).build();
|
||||
sender.spigot().sendMessage(comp2);
|
||||
if (!publicVersion.equalsIgnoreCase(pluginVersion)) {
|
||||
UpdateAPI.sendUpdateMsg(prefix, spigot, discord, pluginVersion, publicVersion, (Player) sender);
|
||||
@@ -103,6 +117,15 @@ public class T2CodeTemplate {
|
||||
send.sender(sender, prefix + " §2Discord: §6" + discord);
|
||||
|
||||
}
|
||||
if (isPremium != null) {
|
||||
if (isPremium) {
|
||||
send.sender(sender, prefix + " §6Premium: §2true");
|
||||
} else send.sender(sender, prefix + " §6Premium: §4false");
|
||||
}
|
||||
send.sender(sender, prefix + "§4======= " + prefix + " §4=======");
|
||||
}
|
||||
|
||||
public static void sendInfo(CommandSender sender, String prefix, String spigot, String discord, List<String> autor, String pluginVersion, String publicVersion) {
|
||||
sendInfo(sender, prefix, spigot, discord, autor, pluginVersion, publicVersion, null);
|
||||
}
|
||||
}
|
||||
|
@@ -40,8 +40,8 @@ public class PluginCheck {
|
||||
public static Boolean plotSquaredGUI(){
|
||||
return Bukkit.getPluginManager().getPlugin("PlotSquaredGUI") != null;
|
||||
}
|
||||
public static Boolean wbs(){
|
||||
return Bukkit.getPluginManager().getPlugin("WonderBagShop") != null;
|
||||
public static Boolean luckyBox(){
|
||||
return Bukkit.getPluginManager().getPlugin("T2C-LuckyBox") != null;
|
||||
}
|
||||
public static Boolean opSec(){
|
||||
return Bukkit.getPluginManager().getPlugin("OPSecurity") != null;
|
||||
|
@@ -5,9 +5,6 @@ import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class Register {
|
||||
public static void listener(Listener listener, Plugin plugin) {
|
||||
@@ -35,4 +32,8 @@ public class Register {
|
||||
plugin.getServer().getPluginManager().getPermission(permission).setDefault(setDefault);
|
||||
plugin.getServer().getPluginManager().getPermission(permission).getChildren().put(children, setBoolean);
|
||||
}
|
||||
public static void permissionDescription(String permission, String description, Plugin plugin) {
|
||||
plugin.getServer().getPluginManager().getPermission(permission).setDescription(description);
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -4,7 +4,6 @@ import me.clip.placeholderapi.PlaceholderAPI;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
@@ -26,18 +26,17 @@ public class UpdateAPI {
|
||||
|
||||
public static void join(Plugin plugin, String prefix, String perm, Player player, String spigot, String discord) {
|
||||
String pluginVersion = plugin.getDescription().getVersion();
|
||||
String publicVersion = UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion;
|
||||
if (!player.hasPermission(perm) || !player.isOp()) {
|
||||
return;
|
||||
}
|
||||
if (publicVersion == null) {
|
||||
if (UpdateAPI.PluginVersionen.get(plugin.getName()) == null) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
join(plugin, prefix, perm, player, spigot, discord);
|
||||
}
|
||||
}.runTaskLater(plugin, 20L);
|
||||
} else use(plugin, prefix, player, pluginVersion, publicVersion, spigot, discord);
|
||||
} else use(plugin, prefix, player, pluginVersion, UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion, spigot, discord);
|
||||
}
|
||||
|
||||
private static void use(Plugin plugin, String prefix, Player player, String pluginVersion, String publicVersion, String spigot, String discord) {
|
||||
@@ -55,7 +54,19 @@ public class UpdateAPI {
|
||||
|
||||
public static void sendUpdateMsg(String Prefix, String Spigot, String Discord, String pluginVersion, String publicVersion) {
|
||||
send.console("§4=========== " + Prefix + " §4===========");
|
||||
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")){
|
||||
if (publicVersion.toLowerCase().contains("dev")){
|
||||
send.console("§6A new §4DEV§6 version was found!");
|
||||
}
|
||||
if (publicVersion.toLowerCase().contains("beta")){
|
||||
send.console("§6A new §2BETA§6 version was found!");
|
||||
}
|
||||
if (publicVersion.toLowerCase().contains("snapshot")){
|
||||
send.console("§6A new §eSNAPSHOT§6 version was found!");
|
||||
}
|
||||
} else {
|
||||
send.console("§6A new version was found!");
|
||||
}
|
||||
send.console("§6Your version: §c" + pluginVersion + " §7- §6Current version: §a" + publicVersion);
|
||||
send.console("§6You can download it here: §e" + Spigot);
|
||||
send.console("§6You can find more information on Discord: §e" + Discord);
|
||||
@@ -67,9 +78,27 @@ public class UpdateAPI {
|
||||
return;
|
||||
}
|
||||
send.player(player, Prefix);
|
||||
if (publicVersion.toLowerCase().contains("dev") || publicVersion.toLowerCase().contains("beta") || publicVersion.toLowerCase().contains("snapshot")){
|
||||
if (publicVersion.toLowerCase().contains("dev")){
|
||||
TextComponent comp = new TextBuilder(Prefix + " §6A new §4DEV§6 version was found!")
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp);
|
||||
}
|
||||
if (publicVersion.toLowerCase().contains("beta")){
|
||||
TextComponent comp = new TextBuilder(Prefix + " §6A new §2BETA§6 version was found!")
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp);
|
||||
}
|
||||
if (publicVersion.toLowerCase().contains("snapshot")){
|
||||
TextComponent comp = new TextBuilder(Prefix + " §6A new §eSNAPSHOT§6 version was found!")
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp);
|
||||
}
|
||||
} else {
|
||||
TextComponent comp = new TextBuilder(Prefix + " §6A new version was found!")
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp);
|
||||
}
|
||||
TextComponent comp1 = new TextBuilder(Prefix + " §c" + pluginVersion + " §7-> §a" + publicVersion)
|
||||
.addHover("§6You can download it here: §e" + Spigot).addClickEvent(ClickEvent.Action.OPEN_URL, Spigot).build();
|
||||
player.spigot().sendMessage(comp1);
|
||||
|
@@ -21,7 +21,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public final class Main extends JavaPlugin {
|
||||
|
||||
@@ -108,9 +107,11 @@ public final class Main extends JavaPlugin {
|
||||
LanguagesCreate.langCreate();
|
||||
SelectLibConfig.onSelect();
|
||||
SelectLibMsg.onSelect(prefix);
|
||||
if (!Util.getSnapshot()){
|
||||
UpdateAPI.onUpdateCheck(plugin, prefix, spigot, spigotID, discord);
|
||||
|
||||
Metrics.Bstats(plugin, bstatsID);
|
||||
}
|
||||
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new JoinEvent(), plugin);
|
||||
T2CodeTemplate.onLoadFooter(prefix, long_);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package net.t2code.lib;
|
||||
|
||||
public class Util {
|
||||
private static Boolean Snapshot = true;
|
||||
private static Boolean Snapshot = false;
|
||||
|
||||
private static String Prefix = "§8[§4T2Code§5Lib§8]";
|
||||
private static Integer SpigotID = 96388;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
name: T2CodeLib
|
||||
version: 9.0
|
||||
version: 10.7
|
||||
main: net.t2code.lib.Bungee.BMain
|
||||
author: JaTiTV, Jkobs
|
||||
description: Libarie from T2Code Plugins
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
name: T2CodeLib
|
||||
version: 9.0
|
||||
version: 10.7
|
||||
main: net.t2code.lib.Spigot.system.Main
|
||||
api-version: 1.13
|
||||
prefix: T2CodeLib
|
||||
|
Reference in New Issue
Block a user