Compare commits
6 Commits
2.7.6
...
5b089a57d8
Author | SHA1 | Date | |
---|---|---|---|
5b089a57d8 | |||
87d0f75a4c | |||
6f3da3e3f4 | |||
|
80255a60eb | ||
f6860e9ab5 | |||
ebbec1f660 |
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>CommandGUI_V2</artifactId>
|
<artifactId>CommandGUI_V2</artifactId>
|
||||||
<version>2.7.5</version>
|
<version>2.7.7</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CommandGUI</name>
|
<name>CommandGUI</name>
|
||||||
|
@@ -1,40 +0,0 @@
|
|||||||
package de.jatitv.commandguiv2.Bungee;
|
|
||||||
|
|
||||||
import net.md_5.bungee.config.Configuration;
|
|
||||||
import net.md_5.bungee.config.ConfigurationProvider;
|
|
||||||
import net.md_5.bungee.config.YamlConfiguration;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class BConfig {
|
|
||||||
|
|
||||||
public static void create() throws IOException {
|
|
||||||
File config = new File(BMain.plugin.getDataFolder(), "config.yml");
|
|
||||||
if (!BMain.plugin.getDataFolder().exists()) BMain.plugin.getDataFolder().mkdir();
|
|
||||||
if (!config.exists()) {
|
|
||||||
config.createNewFile();
|
|
||||||
}
|
|
||||||
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(config);
|
|
||||||
|
|
||||||
configuration.set("MySQL.Enable", false);
|
|
||||||
configuration.set("MySQL.IP", "localhost");
|
|
||||||
configuration.set("MySQL.Port", 3306);
|
|
||||||
configuration.set("MySQL.Database", "database");
|
|
||||||
configuration.set("MySQL.User", "user");
|
|
||||||
configuration.set("MySQL.Password", "");
|
|
||||||
configuration.set("MySQL.SSL", false);
|
|
||||||
ConfigurationProvider.getProvider(YamlConfiguration.class).save(configuration, config);
|
|
||||||
|
|
||||||
|
|
||||||
BMySQL.Enable = configuration.getBoolean("MySQL.Enable");
|
|
||||||
BMySQL.ip = configuration.getString("MySQL.IP");
|
|
||||||
BMySQL.port = configuration.getInt("MySQL.Port");
|
|
||||||
BMySQL.database = configuration.getString("MySQL.Database");
|
|
||||||
BMySQL.user = configuration.getString("MySQL.User");
|
|
||||||
BMySQL.password = configuration.getString("MySQL.Password");
|
|
||||||
BMySQL.SSL = configuration.getBoolean("MySQL.SSL");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,5 +1,6 @@
|
|||||||
package de.jatitv.commandguiv2.Bungee;
|
package de.jatitv.commandguiv2.Bungee;
|
||||||
|
|
||||||
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
|
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.md_5.bungee.BungeeCord;
|
import net.md_5.bungee.BungeeCord;
|
||||||
@@ -10,7 +11,6 @@ import net.md_5.bungee.api.event.PluginMessageEvent;
|
|||||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||||
import net.md_5.bungee.api.plugin.Listener;
|
import net.md_5.bungee.api.plugin.Listener;
|
||||||
import net.md_5.bungee.event.EventHandler;
|
import net.md_5.bungee.event.EventHandler;
|
||||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
@@ -35,7 +35,7 @@ public class BListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Util.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,6 @@ import net.md_5.bungee.api.ProxyServer;
|
|||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
public final class BMain extends Plugin {
|
public final class BMain extends Plugin {
|
||||||
@@ -42,31 +41,11 @@ public final class BMain extends Plugin {
|
|||||||
Bsend.console(prefix + " §2Version: §6" + version);
|
Bsend.console(prefix + " §2Version: §6" + version);
|
||||||
Bsend.console(prefix + " §2Spigot: §6" + spigot);
|
Bsend.console(prefix + " §2Spigot: §6" + spigot);
|
||||||
Bsend.console(prefix + " §2Discord: §6" + discord);
|
Bsend.console(prefix + " §2Discord: §6" + discord);
|
||||||
/* try {
|
|
||||||
BConfig.create();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
plugin.getProxy().registerChannel("cgui:bungee");
|
plugin.getProxy().registerChannel("cgui:bungee");
|
||||||
plugin.getProxy().getPluginManager().registerListener(plugin, new BListener());
|
plugin.getProxy().getPluginManager().registerListener(plugin, new BListener());
|
||||||
BListener.sendToSpigotDeleteAll();
|
BListener.sendToSpigotDeleteAll();
|
||||||
BMetrics metrics = new BMetrics(this, bstatsID);
|
BMetrics.Bstats();
|
||||||
|
|
||||||
/*
|
|
||||||
if (BMySQL.Enable){
|
|
||||||
BMySQL.main();
|
|
||||||
BMySQL.query("CREATE TABLE IF NOT EXISTS `gui-bungeeplayer` (" +
|
|
||||||
" `UUID` VARCHAR(191) NOT NULL COLLATE 'utf8mb4_general_ci'," +
|
|
||||||
" `Name` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci'," +
|
|
||||||
" `Online` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci'," +
|
|
||||||
" UNIQUE INDEX `UUID` (`UUID`)" +
|
|
||||||
")" +
|
|
||||||
"COLLATE='utf8mb4_general_ci'" +
|
|
||||||
"ENGINE=InnoDB" +
|
|
||||||
";");
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
Bsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
Bsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||||
Bsend.console(prefix + "§4==============================================================================");
|
Bsend.console(prefix + "§4==============================================================================");
|
||||||
|
@@ -28,7 +28,6 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import javax.net.ssl.HttpsURLConnection;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
|
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
import net.md_5.bungee.api.plugin.Plugin;
|
||||||
import net.md_5.bungee.config.Configuration;
|
import net.md_5.bungee.config.Configuration;
|
||||||
@@ -37,6 +36,11 @@ import net.md_5.bungee.config.YamlConfiguration;
|
|||||||
|
|
||||||
public class BMetrics {
|
public class BMetrics {
|
||||||
|
|
||||||
|
public static void Bstats() {
|
||||||
|
int pluginId = Util.getBstatsID(); // <-- Replace with the id of your plugin!
|
||||||
|
BMetrics metrics = new BMetrics(BMain.plugin, pluginId);
|
||||||
|
}
|
||||||
|
|
||||||
private final Plugin plugin;
|
private final Plugin plugin;
|
||||||
|
|
||||||
private final MetricsBase metricsBase;
|
private final MetricsBase metricsBase;
|
||||||
@@ -294,7 +298,6 @@ public class BMetrics {
|
|||||||
// Send the data
|
// Send the data
|
||||||
sendData(data);
|
sendData(data);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Util.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
|
||||||
// Something went wrong! :(
|
// Something went wrong! :(
|
||||||
if (logErrors) {
|
if (logErrors) {
|
||||||
errorLogger.accept("Could not submit bStats metrics data", e);
|
errorLogger.accept("Could not submit bStats metrics data", e);
|
||||||
|
@@ -1,107 +0,0 @@
|
|||||||
package de.jatitv.commandguiv2.Bungee;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import net.md_5.bungee.api.plugin.Plugin;
|
|
||||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
|
||||||
|
|
||||||
import java.sql.*;
|
|
||||||
import java.time.ZoneId;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Calendar;
|
|
||||||
|
|
||||||
public class BMySQL {
|
|
||||||
private static Plugin plugin = BMain.plugin;
|
|
||||||
protected static Boolean Enable = false;
|
|
||||||
|
|
||||||
protected static String ip = "localhost";
|
|
||||||
protected static Integer port = 3306;
|
|
||||||
protected static String database;
|
|
||||||
protected static String user = "root";
|
|
||||||
protected static String password = "";
|
|
||||||
protected static String url;
|
|
||||||
protected static Boolean SSL;
|
|
||||||
|
|
||||||
public static void main() {
|
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
||||||
Calendar now = Calendar.getInstance();
|
|
||||||
ZoneId timeZone = now.getTimeZone().toZoneId();
|
|
||||||
Bsend.debug(plugin, "Server TimeZone is : " + timeZone);
|
|
||||||
url = "jdbc:mysql://" + ip + ":" + port + "/" + database + "?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=" + timeZone;
|
|
||||||
// Europe/Berlin
|
|
||||||
if (SSL) {
|
|
||||||
url = url + "&useSSL=true";
|
|
||||||
} else url = url + "&useSSL=false";
|
|
||||||
Bsend.debug(plugin, url);
|
|
||||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
|
||||||
Statement stmt = con.createStatement();
|
|
||||||
stmt.close();
|
|
||||||
Bsend.console(BMain.prefix + " §2MySQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
Bsend.console(BMain.prefix + " §4MySQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
Bsend.error(plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void query(String query) {
|
|
||||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
|
||||||
Statement stmt = con.createStatement();
|
|
||||||
stmt.execute(query);
|
|
||||||
stmt.close();
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
System.err.println(ex.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static ArrayList<String> selectAll(String query) {
|
|
||||||
ArrayList<String> Result = new ArrayList<>();
|
|
||||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
|
||||||
Statement stmt = con.createStatement();
|
|
||||||
ResultSet rs = stmt.executeQuery(query);
|
|
||||||
int columns = rs.getMetaData().getColumnCount();
|
|
||||||
while (rs.next()) {
|
|
||||||
Result.add(rs.getString(1));
|
|
||||||
}
|
|
||||||
rs.close();
|
|
||||||
stmt.close();
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
System.err.println(ex.getMessage());
|
|
||||||
}
|
|
||||||
return Result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String select(String query) {
|
|
||||||
String Ausgabe = "";
|
|
||||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
|
||||||
Statement stmt = con.createStatement();
|
|
||||||
ResultSet rs = stmt.executeQuery(query);
|
|
||||||
int columns = rs.getMetaData().getColumnCount();
|
|
||||||
while (rs.next()) {
|
|
||||||
Ausgabe = String.valueOf(rs.getString(1));
|
|
||||||
}
|
|
||||||
rs.close();
|
|
||||||
stmt.close();
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
System.err.println(ex.getMessage());
|
|
||||||
}
|
|
||||||
return Ausgabe;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int count(String query) {
|
|
||||||
Integer count = 0;
|
|
||||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
|
||||||
Statement stmt = con.createStatement();
|
|
||||||
ResultSet rs = stmt.executeQuery(query);
|
|
||||||
int columns = rs.getMetaData().getColumnCount();
|
|
||||||
while (rs.next()) {
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
rs.close();
|
|
||||||
stmt.close();
|
|
||||||
} catch (SQLException ex) {
|
|
||||||
System.err.println(ex.getMessage());
|
|
||||||
}
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -31,16 +31,12 @@ public final class Main extends JavaPlugin {
|
|||||||
private static Boolean enable = false;
|
private static Boolean enable = false;
|
||||||
public static Boolean legacy = false;
|
public static Boolean legacy = false;
|
||||||
|
|
||||||
public static String prefix = "§8[§4C§9GUI§8]";
|
|
||||||
|
|
||||||
public static String version;
|
public static String version;
|
||||||
|
|
||||||
public static List<String> autor;
|
public static List<String> autor;
|
||||||
|
|
||||||
public static Main plugin;
|
public static Main plugin;
|
||||||
public static List plugins;
|
|
||||||
|
|
||||||
public static String update_version = null;
|
|
||||||
public static Boolean PaPi = false;
|
public static Boolean PaPi = false;
|
||||||
public static Boolean PlotSquaredGUI = false;
|
public static Boolean PlotSquaredGUI = false;
|
||||||
public static Boolean LuckyBox = false;
|
public static Boolean LuckyBox = false;
|
||||||
@@ -53,7 +49,6 @@ public final class Main extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
plugins = Arrays.asList(getServer().getPluginManager().getPlugins());
|
|
||||||
// Plugin startup logic
|
// Plugin startup logic
|
||||||
// Plugin startup logic
|
// Plugin startup logic
|
||||||
Logger logger = this.getLogger();
|
Logger logger = this.getLogger();
|
||||||
@@ -68,7 +63,7 @@ public final class Main extends JavaPlugin {
|
|||||||
if (PluginCheck.papi()) {
|
if (PluginCheck.papi()) {
|
||||||
PaPi = true;
|
PaPi = true;
|
||||||
}
|
}
|
||||||
Load.onLoad(prefix, autor, version, Util.getSpigot(), Util.getSpigotID(), Util.getDiscord(), Util.getBstatsID());
|
Load.onLoad(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getSpigotID(), Util.getDiscord(), Util.getBstatsID());
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -88,13 +83,13 @@ public final class Main extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void addonEnable(Plugin plugin) {
|
public static void addonEnable(Plugin plugin) {
|
||||||
send.console(prefix + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!");
|
send.console(Util.getPrefix() + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean pluginNotFound(String pl, Integer spigotID) {
|
public static Boolean pluginNotFound(String pl, Integer spigotID) {
|
||||||
if (Bukkit.getPluginManager().getPlugin(pl) == null) {
|
if (Bukkit.getPluginManager().getPlugin(pl) == null) {
|
||||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||||
Bukkit.getConsoleSender().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||||
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
||||||
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
||||||
return true;
|
return true;
|
||||||
@@ -104,14 +99,14 @@ public final class Main extends JavaPlugin {
|
|||||||
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) {
|
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) {
|
||||||
if (Bukkit.getPluginManager().getPlugin(pl) == null) {
|
if (Bukkit.getPluginManager().getPlugin(pl) == null) {
|
||||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||||
Bukkit.getConsoleSender().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||||
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
||||||
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
if (Double.parseDouble(Bukkit.getPluginManager().getPlugin(pl).getDescription().getVersion()) < ver) {
|
if (Double.parseDouble(Bukkit.getPluginManager().getPlugin(pl).getDescription().getVersion()) < ver) {
|
||||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||||
Bukkit.getConsoleSender().sendMessage(prefix + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + ".");
|
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + ".");
|
||||||
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -119,10 +114,14 @@ public final class Main extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void sendTryCatch(Class c, StackTraceElement line){
|
||||||
|
send.error(plugin, c.getName() + " Line: " + line.getLineNumber());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
// Plugin shutdown logic
|
// Plugin shutdown logic
|
||||||
if (enable) T2CodeTemplate.onDisable(prefix, autor, version, Util.getSpigot(), Util.getDiscord());
|
if (enable) T2CodeTemplate.onDisable(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||||
MySQL.close();
|
MySQL.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
|
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
||||||
@@ -150,6 +150,7 @@ public class Commands {
|
|||||||
public static void itemOff(Player player) {
|
public static void itemOff(Player player) {
|
||||||
SelectDatabase.setItemStatusFalse(player);
|
SelectDatabase.setItemStatusFalse(player);
|
||||||
UseItem.removeItem(player);
|
UseItem.removeItem(player);
|
||||||
|
send.player(player, SelectMessages.ItemOFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onSetSlot(Player player, Integer setSlot) {
|
public static void onSetSlot(Player player, Integer setSlot) {
|
||||||
|
@@ -15,10 +15,8 @@ public class AliasRegister {
|
|||||||
public static void onRegister() {
|
public static void onRegister() {
|
||||||
Plugin plugin = Main.plugin;
|
Plugin plugin = Main.plugin;
|
||||||
send.debug(plugin, Bukkit.getServer().getClass().getPackage().getName());
|
send.debug(plugin, Bukkit.getServer().getClass().getPackage().getName());
|
||||||
File f = new File(Main.getPath() + "/GUIs/");
|
|
||||||
File[] fileArray = f.listFiles();
|
|
||||||
if (Main.allAliases.toString().equals("[]")) {
|
if (Main.allAliases.toString().equals("[]")) {
|
||||||
send.console(Util.getSpigot() + " §4No GUI files available");
|
send.console(Util.getPrefix() + " §4No GUI files available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (String alias : Main.allAliases) {
|
for (String alias : Main.allAliases) {
|
||||||
|
@@ -22,8 +22,8 @@ public class ConfigCreate {
|
|||||||
public static void configCreate() {
|
public static void configCreate() {
|
||||||
long long_ = System.currentTimeMillis();
|
long long_ = System.currentTimeMillis();
|
||||||
if (new File(Main.getPath(), "config.yml").exists()) {
|
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...");
|
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||||||
} else send.console(Main.prefix + " §4config.yml are created...");
|
} else send.console(Util.getPrefix() + " §4config.yml are created...");
|
||||||
|
|
||||||
File config = new File(Main.getPath(), "config.yml");
|
File config = new File(Main.getPath(), "config.yml");
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
@@ -196,6 +196,6 @@ public class ConfigCreate {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
send.console(Main.prefix + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
send.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.config.gui;
|
package de.jatitv.commandguiv2.Spigot.config.gui;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
@@ -14,7 +15,7 @@ import java.util.List;
|
|||||||
public class CreateGUI {
|
public class CreateGUI {
|
||||||
public static void configCreate() {
|
public static void configCreate() {
|
||||||
long long_ = System.currentTimeMillis();
|
long long_ = System.currentTimeMillis();
|
||||||
send.console(Main.prefix + " §4Default GUI file (GUIs/default.yml) is loaded...");
|
send.console(Util.getPrefix() + " §4Default GUI file (GUIs/default.yml) is loaded...");
|
||||||
File config = new File(Main.getPath(), "GUIs/default.yml");
|
File config = new File(Main.getPath(), "GUIs/default.yml");
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
@@ -49,7 +50,7 @@ public class CreateGUI {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
send.console(Main.prefix + " §2Default GUI file (GUIs/default.yml) was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
send.console(Util.getPrefix() + " §2Default GUI file (GUIs/default.yml) was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void set(String path, String value, YamlConfiguration config) {
|
private static void set(String path, String value, YamlConfiguration config) {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.gui;
|
package de.jatitv.commandguiv2.Spigot.gui;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.GUIListener;
|
import de.jatitv.commandguiv2.Spigot.listener.GUIListener;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
package de.jatitv.commandguiv2.Spigot.listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
||||||
@@ -10,7 +10,6 @@ import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
|||||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Papi;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Placeholder;
|
import de.jatitv.commandguiv2.Spigot.system.Placeholder;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
@@ -1,10 +1,9 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
package de.jatitv.commandguiv2.Spigot.listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.UseItem;
|
import de.jatitv.commandguiv2.Spigot.system.UseItem;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
@@ -1,6 +1,6 @@
|
|||||||
// This claas was created by JaTiTV
|
// This claas was created by JaTiTV
|
||||||
|
|
||||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
package de.jatitv.commandguiv2.Spigot.listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
@@ -1,4 +1,4 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
package de.jatitv.commandguiv2.Spigot.listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
@@ -1,6 +1,6 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
package de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.ItemChange;
|
import de.jatitv.commandguiv2.Spigot.listener.ItemChange;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
@@ -11,8 +11,6 @@ import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
|||||||
import de.jatitv.commandguiv2.api.CGuiAPI;
|
import de.jatitv.commandguiv2.api.CGuiAPI;
|
||||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.NMSVersion;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
@@ -1,4 +1,4 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
package de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
@@ -86,7 +86,7 @@ public class Obj_Select {
|
|||||||
yamlConfiguration_gui.save(config_gui);
|
yamlConfiguration_gui.save(config_gui);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Util.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ public class Debug {
|
|||||||
send.debug(plugin, "§3Version: §e" + Bukkit.getVersion());
|
send.debug(plugin, "§3Version: §e" + Bukkit.getVersion());
|
||||||
send.debug(plugin, "§3Java: §e" + System.getProperty("java.version"));
|
send.debug(plugin, "§3Java: §e" + System.getProperty("java.version"));
|
||||||
send.debug(plugin, "§3Worlds: §e" + String.valueOf(Bukkit.getServer().getWorlds()));
|
send.debug(plugin, "§3Worlds: §e" + String.valueOf(Bukkit.getServer().getWorlds()));
|
||||||
send.debug(plugin, String.valueOf(Main.plugins));
|
send.debug(plugin, String.valueOf(Arrays.asList(Main.plugin.getServer().getPluginManager().getPlugins())));
|
||||||
send.debug(plugin, "§5----------------------------------");
|
send.debug(plugin, "§5----------------------------------");
|
||||||
if (new File(Main.getPath(), "config.yml").exists()) {
|
if (new File(Main.getPath(), "config.yml").exists()) {
|
||||||
File f = new File(String.valueOf(Main.getPath()));
|
File f = new File(String.valueOf(Main.getPath()));
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system;
|
package de.jatitv.commandguiv2.Spigot.system;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.GUIListener;
|
import de.jatitv.commandguiv2.Spigot.listener.GUIListener;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.EventsFrom110;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.EventsFrom110;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help;
|
||||||
@@ -11,8 +11,8 @@ import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
|
|||||||
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
|
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.PluginEvent;
|
import de.jatitv.commandguiv2.Spigot.listener.PluginEvent;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
|
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
|
import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
|
||||||
@@ -20,7 +20,6 @@ import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
|||||||
import de.jatitv.commandguiv2.Spigot.system.database.SQLITE;
|
import de.jatitv.commandguiv2.Spigot.system.database.SQLITE;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.StorageType;
|
import de.jatitv.commandguiv2.Spigot.system.database.StorageType;
|
||||||
import de.jatitv.commandguiv2.Util;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
|
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||||
@@ -184,7 +183,7 @@ public class Load {
|
|||||||
"ENGINE=InnoDB" +
|
"ENGINE=InnoDB" +
|
||||||
";");
|
";");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Util.sendTryCatch(Load.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(Load.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@@ -2,15 +2,10 @@
|
|||||||
|
|
||||||
package de.jatitv.commandguiv2.Spigot.system;
|
package de.jatitv.commandguiv2.Spigot.system;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class Papi extends PlaceholderExpansion {
|
public class Papi extends PlaceholderExpansion {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system;
|
package de.jatitv.commandguiv2.Spigot.system;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@ package de.jatitv.commandguiv2.Spigot.system;
|
|||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import com.mojang.authlib.properties.Property;
|
import com.mojang.authlib.properties.Property;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
|
@@ -54,6 +54,7 @@ public class MySQL {
|
|||||||
send.debugmsg(Main.plugin, "§6Driver: §e" + dbmd.getDriverName());
|
send.debugmsg(Main.plugin, "§6Driver: §e" + dbmd.getDriverName());
|
||||||
send.debugmsg(Main.plugin, "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
send.debugmsg(Main.plugin, "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
||||||
send.debugmsg(Main.plugin, "§6Driver Version: §e" + dbmd.getDriverVersion());
|
send.debugmsg(Main.plugin, "§6Driver Version: §e" + dbmd.getDriverVersion());
|
||||||
|
con.close();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
@@ -73,17 +74,7 @@ public class MySQL {
|
|||||||
Statement stmt = con.createStatement();
|
Statement stmt = con.createStatement();
|
||||||
stmt.execute(query);
|
stmt.execute(query);
|
||||||
stmt.close();
|
stmt.close();
|
||||||
}
|
con.close();
|
||||||
|
|
||||||
public static void query(ArrayList<String> queryList) throws SQLException {
|
|
||||||
Connection con = ds.getConnection();
|
|
||||||
Statement stmt = con.createStatement();
|
|
||||||
for (String query : queryList) {
|
|
||||||
send.debug(Main.plugin, query);
|
|
||||||
stmt.addBatch(query);
|
|
||||||
}
|
|
||||||
stmt.executeBatch();
|
|
||||||
stmt.close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,11 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
package de.jatitv.commandguiv2.Spigot.system.database;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Load;
|
|
||||||
import de.jatitv.commandguiv2.Util;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -28,7 +24,7 @@ public class SelectDatabase {
|
|||||||
try {
|
try {
|
||||||
MySQL.query("UPDATE `gui-item` SET Name='" + player.getName() + "' WHERE UUID='" + player.getUniqueId() + "';");
|
MySQL.query("UPDATE `gui-item` SET Name='" + player.getName() + "' WHERE UUID='" + player.getUniqueId() + "';");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
Util.sendTryCatch(SelectDatabase.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(SelectDatabase.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -49,7 +45,7 @@ public class SelectDatabase {
|
|||||||
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`, `Slot`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`, `Slot`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||||
+ "','" + slot + "') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Slot` = '" + slot + "';");
|
+ "','" + slot + "') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Slot` = '" + slot + "';");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
Util.sendTryCatch(SelectDatabase.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(SelectDatabase.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -72,7 +68,7 @@ public class SelectDatabase {
|
|||||||
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||||
+ "') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Status` = '1';");
|
+ "') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Status` = '1';");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
Util.sendTryCatch(SelectDatabase.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(SelectDatabase.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -95,7 +91,7 @@ public class SelectDatabase {
|
|||||||
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`, `Status`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`, `Status`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||||
+ "', '0') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Status` = '0';");
|
+ "', '0') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Status` = '0';");
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
Util.sendTryCatch(SelectDatabase.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(SelectDatabase.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -47,7 +47,7 @@ public class YML {
|
|||||||
try {
|
try {
|
||||||
yamlConfigurationStorage.save(storage);
|
yamlConfigurationStorage.save(storage);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Util.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
package de.jatitv.commandguiv2;
|
package de.jatitv.commandguiv2;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
@@ -39,8 +38,4 @@ public class Util {
|
|||||||
public static Integer getConfigVersion() {
|
public static Integer getConfigVersion() {
|
||||||
return configVersion;
|
return configVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendTryCatch(Class c, StackTraceElement line){
|
|
||||||
send.error(Main.plugin, c.getName() + " Line: " + line.getLineNumber());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.api;
|
package de.jatitv.commandguiv2.api;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.ItemChange;
|
import de.jatitv.commandguiv2.Spigot.listener.ItemChange;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.Help;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.Help;
|
||||||
|
Reference in New Issue
Block a user