- rename the Main to T2CodeMain
- amalll bugfix
This commit is contained in:
JaTiTV 2022-06-08 05:13:00 +02:00
parent 3ce11b3d12
commit 72d33dca90
16 changed files with 158 additions and 129 deletions

View File

@ -24,25 +24,18 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:31.0.1-jre" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.checkerframework:checker-qual:3.12.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.errorprone:error_prone_annotations:2.7.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.8" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.md-5:bungeecord-chat:1.16-R0.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.28" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.spigotmc:spigot:remapped-mojang:1.19-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: net.t2code:bungee:1615" level="project" />
<orderEntry type="library" name="Maven: net.t2code:LuckyBox-API:4.2.7" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.MilkBowl:VaultAPI:1.7" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:21.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.21" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: me.clip:placeholderapi:2.11.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.jetbrains:annotations:19.0.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.bencodez:votingplugin:6.9.1" level="project" />

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>12.0</version>
<version>12.1</version>
<packaging>jar</packaging>
<name>T2CodeLib</name>
@ -84,8 +84,9 @@
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<artifactId>spigot</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -3,7 +3,6 @@ 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;

View File

@ -1,8 +1,10 @@
package net.t2code.lib.Spigot.Lib.eco;
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.plugins.PluginCheck;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Spigot.system.T2CodeMain;
import net.t2code.lib.Spigot.system.languages.SelectLibMsg;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@ -13,20 +15,20 @@ public class Eco {
public static boolean moneyRemove(String prefix, Player player, Double price) {
if (vault(prefix, player)) {
return Main.eco.withdrawPlayer(player, price).transactionSuccess();
return T2CodeMain.getEco().withdrawPlayer(player, price).transactionSuccess();
}
return false;
}
public static boolean moneyAdd(String prefix, Player player, Double price) {
if (vault(prefix, player)) {
return Main.eco.depositPlayer(player, price).transactionSuccess();
return T2CodeMain.getEco().depositPlayer(player, price).transactionSuccess();
}
return false;
}
private static boolean vault(String prefix, Player player) {
if (Main.eco == null) {
if (T2CodeMain.getEco() == null) {
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
send.console(prefix + " §4\n" + prefix + " §4Vault could not be found! §9Please download it here: " +
"§6https://www.spigotmc.org/resources/vault.34315/§4\n" + prefix);
@ -75,17 +77,17 @@ public class Eco {
public static boolean votePointsRemove(String prefix, Player player, Integer amount) {
if (votePlugin(prefix, player)) {
return Main.voteUserManager.getVotingPluginUser(player).removePoints(amount);
return VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player).removePoints(amount);
} else return false;
}
public static boolean votePointsAdd(String prefix, Player player, Integer amount) {
if (votePlugin(prefix, player)) {
Bukkit.getScheduler().runTaskAsynchronously(Main.plugin, new Runnable() {
Bukkit.getScheduler().runTaskAsynchronously(T2CodeMain.getPlugin(), new Runnable() {
@Override
public void run() {
Main.voteUserManager.getVotingPluginUser(player).addPoints(amount);
VotingPluginMain.getPlugin().getVotingPluginUserManager().getVotingPluginUser(player).addPoints(amount);
}
});
return true;

View File

@ -1,6 +1,6 @@
package net.t2code.lib.Spigot.Lib.plugins;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Spigot.system.T2CodeMain;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
@ -76,7 +76,7 @@ public class PluginCheck {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
Bukkit.getConsoleSender().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.");
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
T2CodeMain.getPlugin().getPluginLoader().disablePlugin(T2CodeMain.getPlugin());
return true;
} else return false;
}

View File

@ -1,13 +1,8 @@
package net.t2code.lib.Spigot.Lib.update;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.t2code.lib.Spigot.Lib.messages.HoverModule;
import net.t2code.lib.Spigot.Lib.messages.TextBuilder;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

View File

@ -1,26 +1,16 @@
package net.t2code.lib.Spigot.system;
import net.md_5.bungee.protocol.packet.Commands;
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
import net.t2code.lib.Util;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URI;
import java.nio.file.*;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class CmdExecuter implements CommandExecutor, TabCompleter {
@ -31,7 +21,7 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
return false;
}
if (args.length == 0) {
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.autor, Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion);
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), T2CodeMain.getAutor(), T2CodeMain.getVersion(), UpdateAPI.PluginVersionen.get(T2CodeMain.getPlugin().getName()).publicVersion);
return false;
}
switch (args[0].toLowerCase()) {
@ -40,7 +30,7 @@ public class CmdExecuter implements CommandExecutor, TabCompleter {
case "pl":
case "version":
case "ver":
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.autor, Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion);
T2CodeTemplate.sendInfo(sender, Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), T2CodeMain.getAutor(), T2CodeMain.getVersion(), UpdateAPI.PluginVersionen.get(T2CodeMain.getPerm().getName()).publicVersion);
return false;
case "debug":
if (args.length != 2) {

View File

@ -1,6 +1,5 @@
package net.t2code.lib.Spigot.system;
import net.t2code.lib.Spigot.Lib.eco.Vault;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.lib.Spigot.Lib.minecraftVersion.NMSVersion;
@ -22,15 +21,15 @@ import java.util.zip.ZipOutputStream;
public class CreateReportLog {
protected static void create(CommandSender sender) {
send.sender(sender, Main.prefix + " §6A DebugLog is created...");
send.sender(sender, T2CodeMain.getPrefix() + " §6A DebugLog is created...");
String timeStampFile = new SimpleDateFormat("HH_mm_ss-dd_MM_yyyy").format(Calendar.getInstance().getTime());
File directory = new File(Main.getPath() + "/DebugLogs");
File directory = new File(T2CodeMain.getPath() + "/DebugLogs");
if (!directory.exists()) {
directory.mkdir();
}
File file = new File(Main.getPath(), "/DebugLogs/T2CodeLog.txt");
File file = new File(T2CodeMain.getPath(), "/DebugLogs/T2CodeLog.txt");
PrintWriter pWriter = null;
try {
pWriter = new PrintWriter(new FileWriter(file.getPath()));
@ -51,17 +50,17 @@ public class CreateReportLog {
if (Vault.vaultEnable) {
pWriter.println("Vault: " + Bukkit.getPluginManager().getPlugin("Vault").getName() + " - " + Bukkit.getPluginManager().getPlugin("Vault").getDescription().getVersion());
} else pWriter.println("Vault: not connected");
if (Main.eco != null) {
String st = Main.eco.getName();
if (Main.eco.getName().equals("CMIEconomy")) st = "CMI";
if (T2CodeMain.getEco() != null) {
String st = T2CodeMain.getEco().getName();
if (T2CodeMain.getEco().getName().equals("CMIEconomy")) st = "CMI";
if (Bukkit.getPluginManager().getPlugin(st) != null) {
pWriter.println("Economy: " + Main.eco.isEnabled() + " - " + st + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion());
} else pWriter.println("Economy: " + Main.eco.isEnabled() + " - " + st);
pWriter.println("Economy: " + T2CodeMain.getEco().isEnabled() + " - " + st + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion());
} else pWriter.println("Economy: " + T2CodeMain.getEco().isEnabled() + " - " + st);
} else pWriter.println("Economy: not connected via vault");
if (Main.perm != null) {
if (Bukkit.getPluginManager().getPlugin(Main.perm.getName()) != null) {
pWriter.println("Permission: " + Main.perm.isEnabled() + " - " + Main.perm.getName() + " - " + Bukkit.getPluginManager().getPlugin(Main.perm.getName()).getDescription().getVersion());
} else pWriter.println("Permission: " + Main.perm.isEnabled() + " - " + Main.perm.getName());
if (T2CodeMain.getPerm() != null) {
if (Bukkit.getPluginManager().getPlugin(T2CodeMain.getPerm().getName()) != null) {
pWriter.println("Permission: " + T2CodeMain.getPerm().isEnabled() + " - " + T2CodeMain.getPerm().getName() + " - " + Bukkit.getPluginManager().getPlugin(T2CodeMain.getPerm().getName()).getDescription().getVersion());
} else pWriter.println("Permission: " + T2CodeMain.getPerm().isEnabled() + " - " + T2CodeMain.getPerm().getName());
} else pWriter.println("Permission: not connected via vault");
pWriter.println();
pWriter.println("Java: " + System.getProperty("java.version"));
@ -69,7 +68,7 @@ public class CreateReportLog {
pWriter.println("System: " + System.getProperty("os.version"));
pWriter.println("User Home: " + System.getProperty("user.home"));
pWriter.println();
pWriter.println("T2CodeLib: " + Main.plugin.getDescription().getVersion());
pWriter.println("T2CodeLib: " + T2CodeMain.getPlugin().getDescription().getVersion());
pWriter.println();
if (PluginCheck.luckyBox()) {
pWriter.println("T2C-PremiumPlugins: ");
@ -93,7 +92,7 @@ public class CreateReportLog {
}
}
String filePath = Main.getPath() + "/DebugLogs/T2CodeLog.txt";
String filePath = T2CodeMain.getPath() + "/DebugLogs/T2CodeLog.txt";
String log = "logs/latest.log";
String zipPath = "plugins/T2CodeLib/DebugLogs/T2CLog-" + timeStampFile + ".zip";
try (ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(zipPath))) {
@ -128,9 +127,9 @@ public class CreateReportLog {
}
file.delete();
if (sender instanceof Player) {
send.sender(sender, Main.prefix + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
send.console(Main.prefix + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
} else send.sender(sender, Main.prefix + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
send.sender(sender, T2CodeMain.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
send.console(T2CodeMain.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
} else send.sender(sender, T2CodeMain.getPrefix() + " §6A DebugLog zip has been created. you can find it on in the files on your server under the path: §e" + zipPath);
}

View File

@ -4,7 +4,6 @@ package net.t2code.lib.Spigot.system;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
import net.t2code.lib.Util;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerLoginEvent;
@ -13,6 +12,6 @@ public class JoinEvent implements Listener {
@EventHandler
public void onJoinEvent(PlayerLoginEvent event) {
UpdateAPI.join(Main.plugin, Util.getPrefix(), "t2code.lib.updatemsg", event.getPlayer(), Main.spigot, Main.discord);
UpdateAPI.join(T2CodeMain.getPlugin(), Util.getPrefix(), "t2code.lib.updatemsg", event.getPlayer(), T2CodeMain.getSpigot(), T2CodeMain.getDiscord());
}
}

View File

@ -1,12 +1,9 @@
package net.t2code.lib.Spigot.system;
import com.bencodez.votingplugin.VotingPluginHooks;
import com.bencodez.votingplugin.VotingPluginMain;
import com.bencodez.votingplugin.advancedcore.AdvancedCorePlugin;
import com.bencodez.votingplugin.user.UserManager;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
import net.t2code.lib.Spigot.Lib.eco.Vault;
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
@ -26,28 +23,77 @@ import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.util.List;
public final class Main extends JavaPlugin {
public final class T2CodeMain extends JavaPlugin {
public static File getPath() {
return plugin.getDataFolder();
}
public static Main plugin;
public static Economy eco = null;
public static VotingPluginHooks votingPlugin = null;
public static UserManager voteUserManager = null;
public static Permission perm = null;
private static T2CodeMain plugin;
private static Economy eco = null;
private static Permission perm = null;
public static List<String> autor;
public static String version;
private static List<String> autor;
private static String version;
public static String prefix = Util.getPrefix();
public static Integer spigotID = Util.getSpigotID();
public static Integer bstatsID = Util.getBstatsID();
public static String spigot = Util.getSpigot();
public static String discord = Util.getDiscord();
private static String prefix = Util.getPrefix();
private static Integer spigotID = Util.getSpigotID();
private static Integer bstatsID = Util.getBstatsID();
private static String spigot = Util.getSpigot();
private static String discord = Util.getDiscord();
private static Boolean load = false;
public static String getDiscord() {
return discord;
}
public static T2CodeMain getPlugin() {
return plugin;
}
public static Economy getEco() {
return eco;
}
protected static void setEco(Economy eco) {
T2CodeMain.eco = eco;
}
public static Permission getPerm() {
return perm;
}
public static List<String> getAutor() {
return autor;
}
public static String getVersion() {
return version;
}
public static String getPrefix() {
return prefix;
}
public static Integer getSpigotID() {
return spigotID;
}
public static Integer getBstatsID() {
return bstatsID;
}
public static String getSpigot() {
return spigot;
}
public static Boolean getLoad() {
return load;
}
public static void setPerm(Permission perm) {
T2CodeMain.perm = perm;
}
@Override
public void onEnable() {
@ -84,34 +130,28 @@ public final class Main extends JavaPlugin {
}
}
ItemVersion.scan();
send.console(Main.prefix + " §3Server run on: §6" + MCVersion.isVersion + " / " + NMSVersion.isNMS);
send.console(T2CodeMain.prefix + " §3Server run on: §6" + MCVersion.isVersion + " / " + NMSVersion.isNMS);
if (eco != null) {
String st = eco.getName();
if (eco.getName().equals("CMIEconomy")) st = "CMI";
if (Bukkit.getPluginManager().getPlugin(st) != null) {
send.console(Main.prefix + " §3Economy: §6" + eco.getName() + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion() + " §7- §e" +
send.console(T2CodeMain.prefix + " §3Economy: §6" + eco.getName() + " - " + Bukkit.getPluginManager().getPlugin(st).getDescription().getVersion() + " §7- §e" +
(System.currentTimeMillis() - long_) + "ms");
} else send.console(Main.prefix + " §3Economy: §6" + eco.getName() + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} else send.console(Main.prefix + " §3Economy: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} else send.console(T2CodeMain.prefix + " §3Economy: §6" + eco.getName() + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} else send.console(T2CodeMain.prefix + " §3Economy: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
if (perm != null) {
if (Bukkit.getPluginManager().getPlugin(perm.getName()) != null) {
send.console(Main.prefix + " §3Permission plugin: §6" + perm.getName() + " - " + Bukkit.getPluginManager().getPlugin(perm.getName()).getDescription().getVersion()
send.console(T2CodeMain.prefix + " §3Permission plugin: §6" + perm.getName() + " - " + Bukkit.getPluginManager().getPlugin(perm.getName()).getDescription().getVersion()
+ " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} else send.console(Main.prefix + " §3Permission plugin: §6" + perm.getName() + " - §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} else send.console(Main.prefix + " §3Permission plugin: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} else send.console(T2CodeMain.prefix + " §3Permission plugin: §6" + perm.getName() + " - §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} else send.console(T2CodeMain.prefix + " §3Permission plugin: §4not connected via vault!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
if (PluginCheck.papi()) {
send.console(Main.prefix + " §3PlaceholderAPI: §6connected" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
send.console(T2CodeMain.prefix + " §3PlaceholderAPI: §6connected" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
}
if (PluginCheck.votingPlugin()) {
votingPlugin = VotingPluginHooks.getInstance();
voteUserManager = votingPlugin.getUserManager();
send.console(Main.prefix + " §3VotingPlugin: §6connected" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
}
Main.plugin.getCommand("t2code").setExecutor(new CmdExecuter());
T2CodeMain.plugin.getCommand("t2code").setExecutor(new CmdExecuter());
ConfigCreate.configCreate();
LanguagesCreate.langCreate();
SelectLibConfig.onSelect();
@ -125,6 +165,7 @@ public final class Main extends JavaPlugin {
T2CodeTemplate.onLoadFooter(prefix, long_);
}
@Override
public void onDisable() {
// Plugin shutdown logic

View File

@ -1,9 +1,8 @@
package net.t2code.lib.Spigot.Lib.eco;
package net.t2code.lib.Spigot.system;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Util;
import org.bukkit.plugin.RegisteredServiceProvider;
@ -14,12 +13,12 @@ public class Vault {
public static void loadVault() throws InterruptedException {
long long_ = System.currentTimeMillis();
if (Main.plugin.getServer().getPluginManager().getPlugin("Vault") != null) {
if (T2CodeMain.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null) {
vaultEnable = true;
RegisteredServiceProvider<Economy> eco = Main.plugin.getServer().getServicesManager().getRegistration(Economy.class);
RegisteredServiceProvider<Economy> eco = T2CodeMain.getPlugin().getServer().getServicesManager().getRegistration(Economy.class);
if (eco != null) {
Main.eco = eco.getProvider();
if (Main.eco != null) {
T2CodeMain.setEco(eco.getProvider());
if (T2CodeMain.getEco() != null) {
connected = true;
send.console(Util.getPrefix() + " §2Vault / Economy successfully connected!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} else {
@ -30,9 +29,9 @@ public class Vault {
connected = false;
send.console(Util.getPrefix() + " §4Economy could not be connected / found! 2" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
}
RegisteredServiceProvider<Permission> perm = Main.plugin.getServer().getServicesManager().getRegistration(Permission.class);
RegisteredServiceProvider<Permission> perm = T2CodeMain.getPlugin().getServer().getServicesManager().getRegistration(Permission.class);
if (perm != null) {
Main.perm = perm.getProvider();
T2CodeMain.setPerm(perm.getProvider());
}
} else {
vaultEnable = false;

View File

@ -1,7 +1,7 @@
package net.t2code.lib.Spigot.system.config;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Spigot.system.T2CodeMain;
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
import org.bukkit.configuration.file.YamlConfiguration;
@ -31,12 +31,12 @@ public class ConfigCreate {
public static void configCreate() {
Long long_ = Long.valueOf(System.currentTimeMillis());
if (new File(Main.getPath(), "config.yml").exists()){
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Main.prefix + " §5DEBUG: §6" + " §4config.yml are created / updated...");
} else send.console(Main.prefix + " §4config.yml are created...");
if (new File(T2CodeMain.getPath(), "config.yml").exists()){
if (T2CodeMain.getPlugin().getConfig().getBoolean("Plugin.Debug")) send.console(T2CodeMain.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
} else send.console(T2CodeMain.getPrefix() + " §4config.yml are created...");
File config = new File(Main.getPath(), "config.yml");
File config = new File(T2CodeMain.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
Config.set("Plugin.UpdateCheck.OnJoin", UpdateCheckOnJoin, yamlConfiguration);
@ -64,7 +64,7 @@ public class ConfigCreate {
e.printStackTrace();
}
send.console(Main.prefix + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
send.console(T2CodeMain.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
}
}

View File

@ -1,6 +1,6 @@
package net.t2code.lib.Spigot.system.config;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Spigot.system.T2CodeMain;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
@ -16,7 +16,7 @@ public class SelectLibConfig {
public static Boolean InventoriesCloseByServerStop;
public static void onSelect() {
File config = new File(Main.getPath(), "config.yml");
File config = new File(T2CodeMain.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
UpdateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.UpdateCheck.OnJoin");

View File

@ -1,7 +1,7 @@
package net.t2code.lib.Spigot.system.languages;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Spigot.system.T2CodeMain;
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
@ -10,10 +10,10 @@ import java.io.File;
import java.io.IOException;
public class LanguagesCreate {
static Plugin plugin = Main.plugin;
static Plugin plugin = T2CodeMain.getPlugin();
public static void langCreate() {
send.debug(plugin,"§4Language files are created / updated...");
send.debug(plugin, "§4Language files are created / updated...");
Long long_ = Long.valueOf(System.currentTimeMillis());
/**
@ -22,7 +22,7 @@ public class LanguagesCreate {
*
*/
File messagesEN = new File(Main.getPath(), "languages/english_messages.yml");
File messagesEN = new File(T2CodeMain.getPath(), "languages/english_messages.yml");
YamlConfiguration yamlConfigurationEN = YamlConfiguration.loadConfiguration(messagesEN);
Config.set("Plugin.VaultNotSetUp", MSG.EN_VaultNotSetUp, yamlConfigurationEN);
@ -32,7 +32,7 @@ public class LanguagesCreate {
try {
yamlConfigurationEN.save(messagesEN);
} catch (IOException e) {
send.warning(Main.plugin,e.getMessage());
send.warning(T2CodeMain.getPlugin(), e.getMessage());
e.printStackTrace();
}
@ -42,7 +42,7 @@ public class LanguagesCreate {
*
*/
File messagesDE = new File(Main.getPath(), "languages/german_messages.yml");
File messagesDE = new File(T2CodeMain.getPath(), "languages/german_messages.yml");
YamlConfiguration yamlConfigurationDE = YamlConfiguration.loadConfiguration(messagesDE);
Config.set("Plugin.VaultNotSetUp", MSG.DE_VotingPluginNotSetUp, yamlConfigurationDE);
@ -52,7 +52,7 @@ public class LanguagesCreate {
try {
yamlConfigurationDE.save(messagesDE);
} catch (IOException e) {
send.warning(Main.plugin,e.getMessage());
send.warning(T2CodeMain.getPlugin(), e.getMessage());
e.printStackTrace();
}
@ -62,7 +62,7 @@ public class LanguagesCreate {
*
*/
File messagesNO = new File(Main.getPath(), "languages/norwegian_messages.yml");
File messagesNO = new File(T2CodeMain.getPath(), "languages/norwegian_messages.yml");
YamlConfiguration yamlConfigurationNO = YamlConfiguration.loadConfiguration(messagesNO);
Config.set("Plugin.VaultNotSetUp", MSG.NO_VaultNotSetUp, yamlConfigurationNO);
@ -72,10 +72,10 @@ public class LanguagesCreate {
try {
yamlConfigurationNO.save(messagesNO);
} catch (IOException e) {
send.warning(Main.plugin,e.getMessage());
send.warning(T2CodeMain.getPlugin(), e.getMessage());
e.printStackTrace();
}
send.console(Main.prefix + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
send.console(T2CodeMain.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
}
}

View File

@ -2,7 +2,7 @@ package net.t2code.lib.Spigot.system.languages;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import net.t2code.lib.Spigot.system.Main;
import net.t2code.lib.Spigot.system.T2CodeMain;
import net.t2code.lib.Spigot.system.config.SelectLibConfig;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
@ -10,8 +10,8 @@ import org.bukkit.plugin.Plugin;
import java.io.File;
public class SelectLibMsg {
private static Plugin plugin = Main.plugin;
private static String prefix = Main.prefix;
private static Plugin plugin = T2CodeMain.getPlugin();
private static String prefix = T2CodeMain.getPrefix();
public static String selectMSG;
@ -26,7 +26,7 @@ public class SelectLibMsg {
File msg;
msg = new File(Main.getPath(), "languages/" + SelectLibConfig.language + "_messages.yml");
msg = new File(T2CodeMain.getPath(), "languages/" + SelectLibConfig.language + "_messages.yml");
if (!msg.isFile()) {
send.console(Prefix);
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
@ -34,7 +34,7 @@ public class SelectLibMsg {
send.console(Prefix + " §6The default language §eEnglish §6is used!");
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
send.console(Prefix);
msg = new File(Main.getPath(), "languages/" + "english_messages.yml");
msg = new File(T2CodeMain.getPath(), "languages/" + "english_messages.yml");
selectMSG = "english";
} else selectMSG = SelectLibConfig.language;
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg);

View File

@ -1,14 +1,25 @@
name: T2CodeLib
version: ${project.version}
main: net.t2code.lib.Spigot.system.Main
main: net.t2code.lib.Spigot.system.T2CodeMain
api-version: 1.13
prefix: T2CodeLib
authors: [ JaTiTV, Jkobs ]
description: Library from T2Code Plugins
website: T2Code.net
load: STARTUP
softdepend:
- VotingPlugin
- PlaceholderAPI
- PlotSquared
- CMI
- CMILib
- Vault
- Economy
- XConomy
softdepend: [ PlaceholderAPI, VotingPlugin, PlotSquared, CMI, CMILib, Vault, Economy, XConomy ]
loadbefore: [ T2C-Alias ]
loadbefore:
- T2C-Alias
- CommandGUI
commands:
t2code: