Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
c590255d38 | |||
5d646fce48 | |||
5b089a57d8 | |||
87d0f75a4c | |||
6f3da3e3f4 | |||
|
80255a60eb | ||
f6860e9ab5 | |||
ebbec1f660 | |||
|
5674b54593 | ||
381afeba89 |
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>CommandGUI_V2</artifactId>
|
<artifactId>CommandGUI_V2</artifactId>
|
||||||
<version>2.7.4</version>
|
<version>2.8.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CommandGUI</name>
|
<name>CommandGUI</name>
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>11.8</version>
|
<version>12.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
|
@@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -77,7 +72,8 @@ public final class Main extends JavaPlugin {
|
|||||||
if (PluginCheck.plotSquaredGUI()) {
|
if (PluginCheck.plotSquaredGUI()) {
|
||||||
PlotSquaredGUI = true;
|
PlotSquaredGUI = true;
|
||||||
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
|
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
|
||||||
}if (PluginCheck.luckyBox()) {
|
}
|
||||||
|
if (PluginCheck.luckyBox()) {
|
||||||
LuckyBox = true;
|
LuckyBox = true;
|
||||||
addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox"));
|
addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox"));
|
||||||
}
|
}
|
||||||
@@ -88,13 +84,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 +100,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 +115,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,7 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
|
import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
@@ -17,7 +17,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CmdExecuter_GUITab implements CommandExecutor, TabCompleter {
|
public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
|
||||||
private static String prefix = Util.getPrefix();
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -30,7 +30,7 @@ public class CmdExecuter_GUITab implements CommandExecutor, TabCompleter {
|
|||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
Commands.gui(player);
|
Commands.gui(player);
|
||||||
} else {
|
} else {
|
||||||
if (args[0].equals("admin")) {
|
if (args[0].equals(SelectConfig.adminSubCommand)) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
Help.sendHelp(sender, prefix);
|
Help.sendHelp(sender, prefix);
|
||||||
return false;
|
return false;
|
||||||
@@ -106,7 +106,7 @@ public class CmdExecuter_GUITab implements CommandExecutor, TabCompleter {
|
|||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
|
|
||||||
Tab.tab(list, sender, 0, args, arg1);
|
Tab.tab(list, sender, 0, args, arg1);
|
||||||
Tab.tab(list, sender, 0, "admin", 1, args, arg2);
|
Tab.tab(list, sender, 0, SelectConfig.adminSubCommand, 1, args, arg2);
|
||||||
Tab.tab(list, sender, 1, "give", 2, args, "commandgui.giveitem.other", true);
|
Tab.tab(list, sender, 1, "give", 2, args, "commandgui.giveitem.other", true);
|
||||||
|
|
||||||
// if (args.length == 1) {
|
// if (args.length == 1) {
|
@@ -23,7 +23,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
|||||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
if (SelectConfig.UseItem_AllowToggle) {
|
if (SelectConfig.UseItem_AllowToggle) {
|
||||||
Help.sendGUIItemHelp(sender, prefix);
|
Help.sendGUIItemHelp(sender);
|
||||||
} else send.sender(sender, "§4UseItem toggle is disabled!");// todo
|
} else send.sender(sender, "§4UseItem toggle is disabled!");// todo
|
||||||
} else {
|
} else {
|
||||||
if (args.length == 1 || args.length == 2) {
|
if (args.length == 1 || args.length == 2) {
|
||||||
|
@@ -1,27 +1,23 @@
|
|||||||
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;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
||||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.UseItem;
|
import de.jatitv.commandguiv2.Spigot.system.UseItem;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
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.Permissions;
|
import de.jatitv.commandguiv2.Spigot.system.Permissions;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
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.update.UpdateAPI;
|
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -63,8 +59,8 @@ public class Commands {
|
|||||||
send.console(Util.getPrefix() + " §6Plugin reload...");
|
send.console(Util.getPrefix() + " §6Plugin reload...");
|
||||||
send.console(Util.getPrefix() + "§8-------------------------------");
|
send.console(Util.getPrefix() + "§8-------------------------------");
|
||||||
|
|
||||||
CmdExecuter_GUITab.arg1.clear();
|
CmdExecuter_GUI.arg1.clear();
|
||||||
CmdExecuter_GUITab.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
||||||
|
|
||||||
SelectConfig.onSelect();
|
SelectConfig.onSelect();
|
||||||
Main.plugin.reloadConfig();
|
Main.plugin.reloadConfig();
|
||||||
@@ -143,7 +139,7 @@ public class Commands {
|
|||||||
UseItem.addUseItem(player);
|
UseItem.addUseItem(player);
|
||||||
send.player(player, SelectMessages.ItemON);
|
send.player(player, SelectMessages.ItemON);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(SelectMessages.NoInventorySpace);
|
send.player(player,SelectMessages.NoInventorySpace);
|
||||||
if (SelectConfig.Sound_NoInventorySpace_Enable && SelectConfig.Sound_Enable) {
|
if (SelectConfig.Sound_NoInventorySpace_Enable && SelectConfig.Sound_Enable) {
|
||||||
player.playSound(player.getLocation(), SelectConfig.Sound_NoInventorySpace, 3, 1);
|
player.playSound(player.getLocation(), SelectConfig.Sound_NoInventorySpace, 3, 1);
|
||||||
}
|
}
|
||||||
@@ -154,11 +150,12 @@ 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) {
|
||||||
if (!SelectConfig.UseItem_AllowSetSlot) {
|
if (!SelectConfig.UseItem_AllowSetSlot) {
|
||||||
player.sendMessage(Util.getPrefix() + " §4Function disabled");
|
send.player(player,Util.getPrefix() + " §4Function disabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +170,7 @@ public class Commands {
|
|||||||
|
|
||||||
if (Events.useItemHashMap.get(player.getName())) {
|
if (Events.useItemHashMap.get(player.getName())) {
|
||||||
if (Objects.equals(Events.useItemSlotHashMap.get(player.getName()), setSlot)) {
|
if (Objects.equals(Events.useItemSlotHashMap.get(player.getName()), setSlot)) {
|
||||||
player.sendMessage(SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
|
send.player(player,SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -200,9 +197,9 @@ public class Commands {
|
|||||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) {
|
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) {
|
||||||
OpenGUI.openGUI(player, SelectConfig.DefaultGUI, true);
|
OpenGUI.openGUI(player, SelectConfig.DefaultGUI, true);
|
||||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
} else send.player(player,SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
||||||
.replace("[perm]", "commandgui.command"));
|
.replace("[perm]", "commandgui.command"));
|
||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
} else send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,9 +209,9 @@ public class Commands {
|
|||||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + gui.key) || player.hasPermission("commandgui.bypass")) {
|
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + gui.key) || player.hasPermission("commandgui.bypass")) {
|
||||||
OpenGUI.openGUI(player, arg, true);
|
OpenGUI.openGUI(player, arg, true);
|
||||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + gui.key)
|
} else send.player(player,SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + gui.key)
|
||||||
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
|
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
|
||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
|
} else send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
|
||||||
} else player.sendMessage(SelectMessages.GUInotFound);
|
} else send.player(player,SelectMessages.guiNotFound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,43 +8,104 @@ 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.replace.Replace;
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class Help {
|
public class Help {
|
||||||
private static String prefix = Util.getPrefix();
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
public static void sendHelp(CommandSender sender, String Prefix) {
|
public static void sendHelp(CommandSender sender, String Prefix) {
|
||||||
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
|
||||||
if (sender.hasPermission("commandgui.command")) {
|
|
||||||
Gui gui = Main.guiHashMap.get(SelectConfig.DefaultGUI);
|
Gui gui = Main.guiHashMap.get(SelectConfig.DefaultGUI);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpCgui.replace("[gui]", Replace.replace(prefix,gui.guiName)));
|
|
||||||
for (String alias : Main.allAliases) {
|
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
||||||
if (Main.guiHashMap.get(alias).guiEnable || sender.hasPermission("commandgui.bypass")) {
|
cgui(sender, gui);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix,Main.guiHashMap.get(alias).guiName)));
|
open(sender);
|
||||||
}
|
help(sender);
|
||||||
}
|
gUIItemHelp(sender);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpHelp);
|
info(sender);
|
||||||
}
|
give(sender);
|
||||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
createDefaultGUI(sender);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_on);
|
reload(sender);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_off);
|
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
|
||||||
}
|
|
||||||
if (sender.hasPermission("commandgui.command.info")) {
|
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpInfo);
|
|
||||||
}
|
|
||||||
if (sender.hasPermission("commandgui.admin")) {
|
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath()+ "\\GUIs\\default.yml"));
|
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpReload);
|
|
||||||
}
|
|
||||||
send.sender(sender, Prefix + " §8-------------------------");
|
send.sender(sender, Prefix + " §8-------------------------");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendGUIItemHelp(CommandSender sender, String Prefix) {
|
|
||||||
|
private static void cgui(CommandSender sender, Gui gui) {
|
||||||
|
if (!sender.hasPermission("commandgui.command")) return;
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCgui.replace("[gui]", Replace.replace(prefix, gui.guiName)));
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpCgui.replace("[gui]", Replace.replace(prefix, gui.guiName)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void open(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.command")) return;
|
||||||
|
|
||||||
|
for (String alias : Main.allAliases) {
|
||||||
|
if (Main.guiHashMap.get(alias).guiEnable || sender.hasPermission("commandgui.bypass")) {
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
|
||||||
|
} else
|
||||||
|
send.sender(sender, prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void help(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.command")) return;
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpHelp);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpHelp);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void info(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.command.info")) return;
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpInfo);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void give(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.admin")) return;
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpGive);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpGive);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void createDefaultGUI(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.admin")) return;
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void reload(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.admin")) return;
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpReload);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpReload);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void gUIItemHelp(CommandSender sender) {
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_on);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_on);
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_off);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_off);
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_Slot);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
||||||
|
}
|
||||||
|
public static void sendGUIItemHelp(CommandSender sender) {
|
||||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
||||||
send.sender(sender, Prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
|
send.sender(sender, prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_on);
|
gUIItemHelp(sender);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_off);
|
send.sender(sender, prefix + " §8------------------------------");
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
|
||||||
send.sender(sender, Prefix + " §8------------------------------");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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) {
|
||||||
|
@@ -5,6 +5,7 @@ import de.jatitv.commandguiv2.Spigot.Main;
|
|||||||
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
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.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -26,9 +27,9 @@ public class RegisterCommand extends Command {
|
|||||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + alias) || player.hasPermission("commandgui.bypass")) {
|
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + alias) || player.hasPermission("commandgui.bypass")) {
|
||||||
OpenGUI.openGUI(player, alias, true);
|
OpenGUI.openGUI(player, alias, true);
|
||||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + alias)
|
} else send.player(player,SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + alias)
|
||||||
.replace("[perm]", "commandgui.command." + alias));
|
.replace("[perm]", "commandgui.command." + alias));
|
||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
} else send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||||
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -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);
|
||||||
@@ -32,6 +32,7 @@ public class ConfigCreate {
|
|||||||
|
|
||||||
Config.set("Plugin.Debug", false, yamlConfiguration);
|
Config.set("Plugin.Debug", false, yamlConfiguration);
|
||||||
Config.set("Plugin.HelpAlias", true, yamlConfiguration);
|
Config.set("Plugin.HelpAlias", true, yamlConfiguration);
|
||||||
|
Config.set("Plugin.AdminSubCommand", "admin", yamlConfiguration);
|
||||||
Config.set("Plugin.language", "english", yamlConfiguration);
|
Config.set("Plugin.language", "english", yamlConfiguration);
|
||||||
Config.set("Plugin.Currency", "$", yamlConfiguration);
|
Config.set("Plugin.Currency", "$", yamlConfiguration);
|
||||||
Config.set("Plugin.DefaultGUI", "default", yamlConfiguration);
|
Config.set("Plugin.DefaultGUI", "default", yamlConfiguration);
|
||||||
@@ -196,6 +197,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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -19,6 +19,7 @@ import java.util.List;
|
|||||||
public class SelectConfig {
|
public class SelectConfig {
|
||||||
public static Boolean Debug;
|
public static Boolean Debug;
|
||||||
public static Boolean HelpAlias;
|
public static Boolean HelpAlias;
|
||||||
|
public static String adminSubCommand;
|
||||||
public static String language;
|
public static String language;
|
||||||
public static String Currency;
|
public static String Currency;
|
||||||
|
|
||||||
@@ -129,6 +130,7 @@ public class SelectConfig {
|
|||||||
|
|
||||||
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
|
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
|
||||||
HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
|
HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
|
||||||
|
adminSubCommand = yamlConfiguration.getString("Plugin.AdminSubCommand");
|
||||||
language = yamlConfiguration.getString("Plugin.language");
|
language = yamlConfiguration.getString("Plugin.language");
|
||||||
Currency = yamlConfiguration.getString("Plugin.Currency");
|
Currency = yamlConfiguration.getString("Plugin.Currency");
|
||||||
DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI");
|
DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI");
|
||||||
|
@@ -2,6 +2,8 @@ package de.jatitv.commandguiv2.Spigot.config.configConverter;
|
|||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.functions.CreateFunctions;
|
import de.jatitv.commandguiv2.Spigot.config.functions.CreateFunctions;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.FunctionItemEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum;
|
||||||
import de.jatitv.commandguiv2.Util;
|
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;
|
||||||
@@ -84,7 +86,6 @@ public class ConfigConverterUnderV5 {
|
|||||||
String configFilePath = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.File.Path");
|
String configFilePath = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.File.Path");
|
||||||
String configOptionPath = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Option.Path");
|
String configOptionPath = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Option.Path");
|
||||||
String configOptionPremat = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Option.Premat");
|
String configOptionPremat = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Option.Premat");
|
||||||
// Boolean ConfigChatInput = ;
|
|
||||||
|
|
||||||
String configStringValueLeft = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Value.LeftClick.String");
|
String configStringValueLeft = yamlConfigurationOld.getString("Slots." + key + ".SetConfig.Value.LeftClick.String");
|
||||||
Boolean configBooleanValueLeft = yamlConfigurationOld.getBoolean("Slots." + key + ".SetConfig.Value.LeftClick.Boolean");
|
Boolean configBooleanValueLeft = yamlConfigurationOld.getBoolean("Slots." + key + ".SetConfig.Value.LeftClick.Boolean");
|
||||||
@@ -103,10 +104,11 @@ public class ConfigConverterUnderV5 {
|
|||||||
|
|
||||||
setNew(key, slotNumber, slotEnable, key, permRequired, yamlConfiguration);
|
setNew(key, slotNumber, slotEnable, key, permRequired, yamlConfiguration);
|
||||||
CreateFunctions.createFunction(key, empty, itemAmount, playerHeadEnable, base64Enable, base64Value, playerWhoHasOpenedTheGUI, playerName, itemMaterial, itemName, lore,
|
CreateFunctions.createFunction(key, empty, itemAmount, playerHeadEnable, base64Enable, base64Value, playerWhoHasOpenedTheGUI, playerName, itemMaterial, itemName, lore,
|
||||||
customSoundEnable, customSoundNoSound, customSoundSound, costEnable, price, commandEnable, commandBungeeCommand, commandAsConsole, command, serverChange,
|
customSoundEnable, customSoundNoSound, customSoundSound, costEnable, "vault", "DIRT;5", 0, price, commandEnable, commandBungeeCommand, commandAsConsole, command, serverChange,
|
||||||
serverChangeServer, openGUIEnable, openGUI, togglePermission, togglePermissionPerm, toggleUseItem, messageEnable, message, setConfigEnable, configFilePath,
|
serverChangeServer, openGUIEnable, openGUI, togglePermission, togglePermissionPerm, toggleUseItem, messageEnable, message, setConfigEnable, configFilePath,
|
||||||
configOptionPath, configOptionPremat, configStringValueLeft, configBooleanValueLeft, configIntegerValueLeft, configDoubleValueLeft, configListValueLeft,
|
configOptionPath, configOptionPremat, configStringValueLeft, configBooleanValueLeft, configIntegerValueLeft, configDoubleValueLeft, configListValueLeft,
|
||||||
configStringValueRight, configBooleanValueRight, configIntegerValueRight, configDoubleValueRight, configListValueRight, pluginReloadEnable, pluginReloadCommand);
|
configStringValueRight, configBooleanValueRight, configIntegerValueRight, configDoubleValueRight, configListValueRight, pluginReloadEnable, pluginReloadCommand,
|
||||||
|
false, FunctionVoteEnum.ADD,0,false, FunctionItemEnum.REMOVE,"DIRT;5");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.config.functions;
|
package de.jatitv.commandguiv2.Spigot.config.functions;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.FunctionItemEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum;
|
||||||
|
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,33 +17,35 @@ public class CreateFunctions {
|
|||||||
public static void create() {
|
public static void create() {
|
||||||
createFunction("UseItem", false, 1, false, false, "", false, "", "",
|
createFunction("UseItem", false, 1, false, false, "", false, "", "",
|
||||||
"&6Toggle UseItem", Arrays.asList("&bYou currently have the UseItem set to: %commandgui_useitem%"), false, false,
|
"&6Toggle UseItem", Arrays.asList("&bYou currently have the UseItem set to: %commandgui_useitem%"), false, false,
|
||||||
"", false, 0.0, false, false, false, Arrays.asList(), false,
|
"", false, "VAULT", "DIRT;5", 0, 0.0, false, false, false, Arrays.asList(), false,
|
||||||
"", false, "", false, "", true, true,
|
"", false, "", false, "", true, true,
|
||||||
Arrays.asList("&bYour UseItem was set to: %commandgui_useitem%&b."), false, "", "", "String",
|
Arrays.asList("&bYour UseItem was set to: %commandgui_useitem%&b."), false, "", "", "String",
|
||||||
"", false, 0, 0.0, Arrays.asList(), "", false,
|
"", false, 0, 0.0, Arrays.asList(), "", false,
|
||||||
0, 0.0, Arrays.asList(), false, "");
|
0, 0.0, Arrays.asList(), false, "",
|
||||||
|
false, FunctionVoteEnum.ADD, 0, false, FunctionItemEnum.REMOVE, "DIRT;5");
|
||||||
|
|
||||||
createFunction("SupportDiscord", false, 1, true, true, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19",
|
createFunction("SupportDiscord", false, 1, true, true, "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19",
|
||||||
false, "", "",
|
false, "", "",
|
||||||
"&3Support Discord", Arrays.asList("&8-----------------", "&bIf you need help setting up the plugin,", "&bfeel free to contact me on the Suport Discord.",
|
"&3Support Discord", Arrays.asList("&8-----------------", "&bIf you need help setting up the plugin,", "&bfeel free to contact me on the Suport Discord.",
|
||||||
"&8-----------------", "&eIf you find any errors or bugs,", "&eplease contact me so I can fix them.", "&8-----------------", "&5Discord: §7http://dc.t2code.net"),
|
"&8-----------------", "&eIf you find any errors or bugs,", "&eplease contact me so I can fix them.", "&8-----------------", "&5Discord: §7http://dc.t2code.net"),
|
||||||
false, false, "", false, 0.0, false, false,
|
false, false, "", false, "VAULT", "DIRT;5", 0, 0.0, false, false,
|
||||||
false, Arrays.asList(), false, "", false, "", false, "",
|
false, Arrays.asList(), false, "", false, "", false, "",
|
||||||
false, true, Arrays.asList("&6You can find more information on Discord: &ehttp://dc.t2code.net"), false, "",
|
false, true, Arrays.asList("&6You can find more information on Discord: &ehttp://dc.t2code.net"), false, "",
|
||||||
"", "String", "", false, 0, 0.0, Arrays.asList(),
|
"", "String", "", false, 0, 0.0, Arrays.asList(),
|
||||||
"", false, 0, 0.0, Arrays.asList(), false, "");
|
"", false, 0, 0.0, Arrays.asList(), false, "",
|
||||||
|
false, FunctionVoteEnum.ADD, 0, false, FunctionItemEnum.REMOVE, "DIRT;5");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createFunction(String fileName, Boolean empty, Integer itemAmount, Boolean playerHeadEnable, Boolean base64Enable, String base64Value, Boolean playerWhoHasOpenedTheGUI,
|
public static void createFunction(String fileName, Boolean empty, Integer itemAmount, Boolean playerHeadEnable, Boolean base64Enable, String base64Value, Boolean playerWhoHasOpenedTheGUI,
|
||||||
String playerName, String itemMaterial, String name, List<String> lore, Boolean customSoundEnable, Boolean customSoundNoSound, String customSoundSound,
|
String playerName, String itemMaterial, String name, List<String> lore, Boolean customSoundEnable, Boolean customSoundNoSound, String customSoundSound,
|
||||||
Boolean costEnable, Double price, Boolean commandEnable, Boolean commandBungeeCommand, Boolean commandAsConsole, List<String> command,
|
Boolean costEnable, String ecoModule, String ecoItem, Integer ecoVotePoints, Double ecoPrice, Boolean commandEnable, Boolean commandBungeeCommand,
|
||||||
Boolean serverChange, String serverChangeServer, Boolean openGUIEnable, String openGUI, Boolean togglePermission, String togglePermissionPerm,
|
Boolean commandAsConsole, List<String> command, Boolean serverChange, String serverChangeServer, Boolean openGUIEnable, String openGUI,
|
||||||
Boolean toggleUseItem, Boolean messageEnable, List<String> message, Boolean setConfigEnable, String configFilePath, String configOptionPath,
|
Boolean togglePermission, String togglePermissionPerm, Boolean toggleUseItem, Boolean messageEnable, List<String> message, Boolean setConfigEnable,
|
||||||
String configOptionPremat, String configStringValueLeft, Boolean configBooleanValueLeft, Integer configIntegerValueLeft, Double configDoubleValueLeft,
|
String configFilePath, String configOptionPath, String configOptionPremat, String configStringValueLeft, Boolean configBooleanValueLeft,
|
||||||
List<String> configListValueLeft, String configStringValueRight, Boolean configBooleanValueRight, Integer configIntegerValueRight, Double configDoubleValueRight,
|
Integer configIntegerValueLeft, Double configDoubleValueLeft, List<String> configListValueLeft, String configStringValueRight,
|
||||||
List<String> configListValueRight, Boolean pluginReloadEnable, String pluginReloadCommand) {
|
Boolean configBooleanValueRight, Integer configIntegerValueRight, Double configDoubleValueRight, List<String> configListValueRight,
|
||||||
|
Boolean pluginReloadEnable, String pluginReloadCommand, Boolean functionVotePoints, FunctionVoteEnum functionVotePointsMode,
|
||||||
|
Integer functionVotePointsAmount, Boolean functionItem, FunctionItemEnum functionItemMode, String functionItemItem) {
|
||||||
long long_ = System.currentTimeMillis();
|
long long_ = System.currentTimeMillis();
|
||||||
|
|
||||||
File config = new File(Main.getPath(), "Functions/" + fileName + ".yml");
|
File config = new File(Main.getPath(), "Functions/" + fileName + ".yml");
|
||||||
@@ -50,7 +55,7 @@ public class CreateFunctions {
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
send.console(Main.prefix + " §4Function GUI file (Functions/" + config.getName() + ") is loaded...");
|
send.console(Util.getPrefix() + " §4Function GUI file (Functions/" + config.getName() + ") is loaded...");
|
||||||
|
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
@@ -70,7 +75,10 @@ public class CreateFunctions {
|
|||||||
set("Slots.Function.CustomSound.NoSound", customSoundNoSound, yamlConfiguration);
|
set("Slots.Function.CustomSound.NoSound", customSoundNoSound, yamlConfiguration);
|
||||||
set("Slots.Function.CustomSound.Sound", customSoundSound == null ? "" : customSoundSound, yamlConfiguration);
|
set("Slots.Function.CustomSound.Sound", customSoundSound == null ? "" : customSoundSound, yamlConfiguration);
|
||||||
set("Slots.Function.Cost.Enable", costEnable, yamlConfiguration);
|
set("Slots.Function.Cost.Enable", costEnable, yamlConfiguration);
|
||||||
set("Slots.Function.Cost.Price", price, yamlConfiguration);
|
set("Slots.Function.Cost.EcoModule", ecoModule, yamlConfiguration);
|
||||||
|
set("Slots.Function.Cost.Item", ecoItem, yamlConfiguration);
|
||||||
|
set("Slots.Function.Cost.VotePoints", ecoVotePoints, yamlConfiguration);
|
||||||
|
set("Slots.Function.Cost.Price", ecoPrice, yamlConfiguration);
|
||||||
set("Slots.Function.Command.Enable", commandEnable, yamlConfiguration);
|
set("Slots.Function.Command.Enable", commandEnable, yamlConfiguration);
|
||||||
set("Slots.Function.Command.BungeeCommand", commandBungeeCommand, yamlConfiguration);
|
set("Slots.Function.Command.BungeeCommand", commandBungeeCommand, yamlConfiguration);
|
||||||
set("Slots.Function.Command.CommandAsConsole", commandAsConsole, yamlConfiguration);
|
set("Slots.Function.Command.CommandAsConsole", commandAsConsole, yamlConfiguration);
|
||||||
@@ -104,12 +112,20 @@ public class CreateFunctions {
|
|||||||
set("Slots.Function.SetConfig.PluginReload.Enable", pluginReloadEnable, yamlConfiguration);
|
set("Slots.Function.SetConfig.PluginReload.Enable", pluginReloadEnable, yamlConfiguration);
|
||||||
set("Slots.Function.SetConfig.PluginReload.Command", pluginReloadCommand == null ? "" : pluginReloadCommand, yamlConfiguration);
|
set("Slots.Function.SetConfig.PluginReload.Command", pluginReloadCommand == null ? "" : pluginReloadCommand, yamlConfiguration);
|
||||||
|
|
||||||
|
set("Slots.Function.FunctionVotePoints.Enable", functionVotePoints, yamlConfiguration);
|
||||||
|
set("Slots.Function.FunctionVotePoints.Mode", functionVotePointsMode.toString(), yamlConfiguration);
|
||||||
|
set("Slots.Function.FunctionVotePoints.Amount", functionVotePointsAmount, yamlConfiguration);
|
||||||
|
|
||||||
|
set("Slots.Function.FunctionItem.Enable", functionItem, yamlConfiguration);
|
||||||
|
set("Slots.Function.FunctionItem.Mode", functionItemMode.toString(), yamlConfiguration);
|
||||||
|
set("Slots.Function.FunctionItem.Item", functionItemItem, yamlConfiguration);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfiguration.save(config);
|
yamlConfiguration.save(config);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
send.console(Main.prefix + " §2Function file (Functions/" + config.getName() + ") was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
send.console(Util.getPrefix() + " §2Function file (Functions/" + config.getName() + ") was loaded." + " §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,6 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.config.languages;
|
package de.jatitv.commandguiv2.Spigot.config.languages;
|
||||||
|
|
||||||
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 org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@@ -46,7 +47,9 @@ public class LanguagesCreate {
|
|||||||
set("UseItem.DisabledInWorld", MSG.EN_UseItemDisabledInWorld, yamlConfigurationEN);
|
set("UseItem.DisabledInWorld", MSG.EN_UseItemDisabledInWorld, yamlConfigurationEN);
|
||||||
|
|
||||||
set("Cost.Buy_msg", MSG.EN_Buy_msg, yamlConfigurationEN);
|
set("Cost.Buy_msg", MSG.EN_Buy_msg, yamlConfigurationEN);
|
||||||
set("Cost.No_money", MSG.EN_No_money, yamlConfigurationEN);
|
set("Cost.No.Money", MSG.EN_No_money, yamlConfigurationEN);
|
||||||
|
set("Cost.No.Item", MSG.EN_No_moneyItem, yamlConfigurationEN);
|
||||||
|
set("Cost.No.Vote", MSG.EN_No_moneyVote, yamlConfigurationEN);
|
||||||
set("Cost.NoInventorySpace", MSG.EN_NoInventorySpace, yamlConfigurationEN);
|
set("Cost.NoInventorySpace", MSG.EN_NoInventorySpace, yamlConfigurationEN);
|
||||||
|
|
||||||
set("ServerChange.onServerChange", MSG.EN_onServerChange, yamlConfigurationEN);
|
set("ServerChange.onServerChange", MSG.EN_onServerChange, yamlConfigurationEN);
|
||||||
@@ -60,6 +63,14 @@ public class LanguagesCreate {
|
|||||||
set("Player.PlayerNotFond", MSG.EN_PlayerNotFond, yamlConfigurationEN);
|
set("Player.PlayerNotFond", MSG.EN_PlayerNotFond, yamlConfigurationEN);
|
||||||
set("Player.PlayerNoInventorySpace", MSG.EN_PlayerNoInventorySpace, yamlConfigurationEN);
|
set("Player.PlayerNoInventorySpace", MSG.EN_PlayerNoInventorySpace, yamlConfigurationEN);
|
||||||
|
|
||||||
|
set("FunctionItem.Add", MSG.EN_FunctionItemAdd,yamlConfigurationEN);
|
||||||
|
set("FunctionItem.Remove", MSG.EN_FunctionItemRemove,yamlConfigurationEN);
|
||||||
|
set("FunctionItem.RemoveError", MSG.EN_FunctionItemRemoveError,yamlConfigurationEN);
|
||||||
|
|
||||||
|
set("FunctionVote.Add", MSG.EN_FunctionVoteAdd,yamlConfigurationEN);
|
||||||
|
set("FunctionVote.Remove", MSG.EN_FunctionVoteRemove,yamlConfigurationEN);
|
||||||
|
set("FunctionVote.RemoveError", MSG.EN_FunctionVoteRemoveError,yamlConfigurationEN);
|
||||||
|
|
||||||
set("Help.CGUI", MSG.EN_Help_CGUI, yamlConfigurationEN);
|
set("Help.CGUI", MSG.EN_Help_CGUI, yamlConfigurationEN);
|
||||||
set("Help.Help", MSG.EN_Help_Help, yamlConfigurationEN);
|
set("Help.Help", MSG.EN_Help_Help, yamlConfigurationEN);
|
||||||
set("Help.Info", MSG.EN_Help_Info, yamlConfigurationEN);
|
set("Help.Info", MSG.EN_Help_Info, yamlConfigurationEN);
|
||||||
@@ -71,6 +82,17 @@ public class LanguagesCreate {
|
|||||||
set("Help.UseItem_Off", MSG.EN_GUIItemHelp_off, yamlConfigurationEN);
|
set("Help.UseItem_Off", MSG.EN_GUIItemHelp_off, yamlConfigurationEN);
|
||||||
set("Help.UseItem_Slot", MSG.EN_GUIItemHelp_Slot, yamlConfigurationEN);
|
set("Help.UseItem_Slot", MSG.EN_GUIItemHelp_Slot, yamlConfigurationEN);
|
||||||
|
|
||||||
|
set("Help.Player.CGUI", MSG.EN_PlayerHelp_CGUI, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Help", MSG.EN_PlayerHelp_Help, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Info", MSG.EN_PlayerHelp_Info, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Open", MSG.EN_PlayerHelp_Open, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Give", MSG.EN_PlayerHelp_Give, yamlConfigurationEN);
|
||||||
|
set("Help.Player.CreateDefaultGUI", MSG.EN_PlayerHelp_CreateDefaultGUI, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Reload", MSG.EN_PlayerHelp_Reload, yamlConfigurationEN);
|
||||||
|
set("Help.Player.UseItem_On", MSG.EN_GUIItemPlayerHelp_on, yamlConfigurationEN);
|
||||||
|
set("Help.Player.UseItem_Off", MSG.EN_GUIItemPlayerHelp_off, yamlConfigurationEN);
|
||||||
|
set("Help.Player.UseItem_Slot", MSG.EN_GUIItemPlayerHelp_Slot, yamlConfigurationEN);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfigurationEN.save(messagesEN);
|
yamlConfigurationEN.save(messagesEN);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -110,7 +132,9 @@ public class LanguagesCreate {
|
|||||||
set("UseItem.DisabledInWorld", MSG.DE_UseItemDisabledInWorld, yamlConfigurationDE);
|
set("UseItem.DisabledInWorld", MSG.DE_UseItemDisabledInWorld, yamlConfigurationDE);
|
||||||
|
|
||||||
set("Cost.Buy_msg", MSG.DE_Buy_msg, yamlConfigurationDE);
|
set("Cost.Buy_msg", MSG.DE_Buy_msg, yamlConfigurationDE);
|
||||||
set("Cost.No_money", MSG.DE_No_money, yamlConfigurationDE);
|
set("Cost.No.Money", MSG.DE_No_money, yamlConfigurationDE);
|
||||||
|
set("Cost.No.Item", MSG.DE_No_moneyItem, yamlConfigurationDE);
|
||||||
|
set("Cost.No.Vote", MSG.DE_No_moneyVote, yamlConfigurationDE);
|
||||||
set("Cost.NoInventorySpace", MSG.DE_NoInventorySpace, yamlConfigurationDE);
|
set("Cost.NoInventorySpace", MSG.DE_NoInventorySpace, yamlConfigurationDE);
|
||||||
|
|
||||||
set("ServerChange.onServerChange", MSG.DE_onServerChange, yamlConfigurationDE);
|
set("ServerChange.onServerChange", MSG.DE_onServerChange, yamlConfigurationDE);
|
||||||
@@ -124,6 +148,14 @@ public class LanguagesCreate {
|
|||||||
set("Player.PlayerNotFond", MSG.DE_PlayerNotFond, yamlConfigurationDE);
|
set("Player.PlayerNotFond", MSG.DE_PlayerNotFond, yamlConfigurationDE);
|
||||||
set("Player.PlayerNoInventorySpace", MSG.DE_PlayerNoInventorySpace, yamlConfigurationDE);
|
set("Player.PlayerNoInventorySpace", MSG.DE_PlayerNoInventorySpace, yamlConfigurationDE);
|
||||||
|
|
||||||
|
set("FunctionItem.Add", MSG.DE_FunctionItemAdd,yamlConfigurationDE);
|
||||||
|
set("FunctionItem.Remove", MSG.DE_FunctionItemRemove,yamlConfigurationDE);
|
||||||
|
set("FunctionItem.RemoveError", MSG.DE_FunctionItemRemoveError,yamlConfigurationDE);
|
||||||
|
|
||||||
|
set("FunctionVote.Add", MSG.DE_FunctionVoteAdd,yamlConfigurationDE);
|
||||||
|
set("FunctionVote.Remove", MSG.DE_FunctionVoteRemove,yamlConfigurationDE);
|
||||||
|
set("FunctionVote.RemoveError", MSG.DE_FunctionVoteRemoveError,yamlConfigurationDE);
|
||||||
|
|
||||||
set("Help.CGUI", MSG.DE_Help_CGUI, yamlConfigurationDE);
|
set("Help.CGUI", MSG.DE_Help_CGUI, yamlConfigurationDE);
|
||||||
set("Help.Help", MSG.DE_Help_Help, yamlConfigurationDE);
|
set("Help.Help", MSG.DE_Help_Help, yamlConfigurationDE);
|
||||||
set("Help.Info", MSG.DE_Help_Info, yamlConfigurationDE);
|
set("Help.Info", MSG.DE_Help_Info, yamlConfigurationDE);
|
||||||
@@ -135,6 +167,17 @@ public class LanguagesCreate {
|
|||||||
set("Help.UseItem_Off", MSG.DE_GUIItemHelp_off, yamlConfigurationDE);
|
set("Help.UseItem_Off", MSG.DE_GUIItemHelp_off, yamlConfigurationDE);
|
||||||
set("Help.UseItem_Slot", MSG.DE_GUIItemHelp_Slot, yamlConfigurationDE);
|
set("Help.UseItem_Slot", MSG.DE_GUIItemHelp_Slot, yamlConfigurationDE);
|
||||||
|
|
||||||
|
set("Help.Player.CGUI", MSG.DE_PlayerHelp_CGUI, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Help", MSG.DE_PlayerHelp_Help, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Info", MSG.DE_PlayerHelp_Info, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Open", MSG.DE_PlayerHelp_Open, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Give", MSG.DE_PlayerHelp_Give, yamlConfigurationDE);
|
||||||
|
set("Help.Player.CreateDefaultGUI", MSG.DE_PlayerHelp_CreateDefaultGUI, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Reload", MSG.DE_PlayerHelp_Reload, yamlConfigurationDE);
|
||||||
|
set("Help.Player.UseItem_On", MSG.DE_GUIItemPlayerHelp_on, yamlConfigurationDE);
|
||||||
|
set("Help.Player.UseItem_Off", MSG.DE_GUIItemPlayerHelp_off, yamlConfigurationDE);
|
||||||
|
set("Help.Player.UseItem_Slot", MSG.DE_GUIItemPlayerHelp_Slot, yamlConfigurationDE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfigurationDE.save(messagesDE);
|
yamlConfigurationDE.save(messagesDE);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -175,7 +218,9 @@ public class LanguagesCreate {
|
|||||||
set("UseItem.DisabledInWorld", MSG.NO_UseItemDisabledInWorld, yamlConfigurationNO);
|
set("UseItem.DisabledInWorld", MSG.NO_UseItemDisabledInWorld, yamlConfigurationNO);
|
||||||
|
|
||||||
set("Cost.Buy_msg", MSG.NO_Buy_msg, yamlConfigurationNO);
|
set("Cost.Buy_msg", MSG.NO_Buy_msg, yamlConfigurationNO);
|
||||||
set("Cost.No_money", MSG.NO_No_money, yamlConfigurationNO);
|
set("Cost.No.Money", MSG.NO_No_money, yamlConfigurationNO);
|
||||||
|
set("Cost.No.Item", MSG.NO_No_moneyItem, yamlConfigurationNO);
|
||||||
|
set("Cost.No.Vote", MSG.NO_No_moneyVote, yamlConfigurationNO);
|
||||||
set("Cost.NoInventorySpace", MSG.NO_NoInventorySpace, yamlConfigurationNO);
|
set("Cost.NoInventorySpace", MSG.NO_NoInventorySpace, yamlConfigurationNO);
|
||||||
|
|
||||||
set("ServerChange.onServerChange", MSG.NO_onServerChange, yamlConfigurationNO);
|
set("ServerChange.onServerChange", MSG.NO_onServerChange, yamlConfigurationNO);
|
||||||
@@ -189,6 +234,14 @@ public class LanguagesCreate {
|
|||||||
set("Player.PlayerNotFond", MSG.NO_PlayerNotFond, yamlConfigurationNO);
|
set("Player.PlayerNotFond", MSG.NO_PlayerNotFond, yamlConfigurationNO);
|
||||||
set("Player.PlayerNoInventorySpace", MSG.NO_PlayerNoInventorySpace, yamlConfigurationNO);
|
set("Player.PlayerNoInventorySpace", MSG.NO_PlayerNoInventorySpace, yamlConfigurationNO);
|
||||||
|
|
||||||
|
set("FunctionItem.Add", MSG.NO_FunctionItemAdd,yamlConfigurationNO);
|
||||||
|
set("FunctionItem.Remove", MSG.NO_FunctionItemRemove,yamlConfigurationNO);
|
||||||
|
set("FunctionItem.RemoveError", MSG.NO_FunctionItemRemoveError,yamlConfigurationNO);
|
||||||
|
|
||||||
|
set("FunctionVote.Add", MSG.NO_FunctionVoteAdd,yamlConfigurationNO);
|
||||||
|
set("FunctionVote.Remove", MSG.NO_FunctionVoteRemove,yamlConfigurationNO);
|
||||||
|
set("FunctionVote.RemoveError", MSG.NO_FunctionVoteRemoveError,yamlConfigurationNO);
|
||||||
|
|
||||||
set("Help.CGUI", MSG.NO_Help_CGUI, yamlConfigurationNO);
|
set("Help.CGUI", MSG.NO_Help_CGUI, yamlConfigurationNO);
|
||||||
set("Help.Help", MSG.NO_Help_Help, yamlConfigurationNO);
|
set("Help.Help", MSG.NO_Help_Help, yamlConfigurationNO);
|
||||||
set("Help.Info", MSG.NO_Help_Info, yamlConfigurationNO);
|
set("Help.Info", MSG.NO_Help_Info, yamlConfigurationNO);
|
||||||
@@ -200,6 +253,17 @@ public class LanguagesCreate {
|
|||||||
set("Help.UseItem_Off", MSG.NO_GUIItemHelp_off, yamlConfigurationNO);
|
set("Help.UseItem_Off", MSG.NO_GUIItemHelp_off, yamlConfigurationNO);
|
||||||
set("Help.UseItem_Slot", MSG.NO_GUIItemHelp_Slot, yamlConfigurationNO);
|
set("Help.UseItem_Slot", MSG.NO_GUIItemHelp_Slot, yamlConfigurationNO);
|
||||||
|
|
||||||
|
set("Help.Player.CGUI", MSG.NO_PlayerHelp_CGUI, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Help", MSG.NO_PlayerHelp_Help, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Info", MSG.NO_PlayerHelp_Info, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Open", MSG.NO_PlayerHelp_Open, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Give", MSG.NO_PlayerHelp_Give, yamlConfigurationNO);
|
||||||
|
set("Help.Player.CreateDefaultGUI", MSG.NO_PlayerHelp_CreateDefaultGUI, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Reload", MSG.NO_PlayerHelp_Reload, yamlConfigurationNO);
|
||||||
|
set("Help.Player.UseItem_On", MSG.NO_GUIItemPlayerHelp_on, yamlConfigurationNO);
|
||||||
|
set("Help.Player.UseItem_Off", MSG.NO_GUIItemPlayerHelp_off, yamlConfigurationNO);
|
||||||
|
set("Help.Player.UseItem_Slot", MSG.NO_GUIItemPlayerHelp_Slot, yamlConfigurationNO);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfigurationNO.save(messagesNO);
|
yamlConfigurationNO.save(messagesNO);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -208,7 +272,7 @@ public class LanguagesCreate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
send.console(Main.prefix + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
send.console(Util.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void set(String path, String value, YamlConfiguration config) {
|
private static void set(String path, String value, YamlConfiguration config) {
|
||||||
|
@@ -27,7 +27,9 @@ public class MSG {
|
|||||||
public static String EN_NoPermissionForItem = "[prefix] &cFor &b[item] &cyou lack the permission &6[perm]&c!";
|
public static String EN_NoPermissionForItem = "[prefix] &cFor &b[item] &cyou lack the permission &6[perm]&c!";
|
||||||
|
|
||||||
public static String EN_Buy_msg = "[prefix] &2You bought [itemname] &2for &6[price]&2.";
|
public static String EN_Buy_msg = "[prefix] &2You bought [itemname] &2for &6[price]&2.";
|
||||||
public static String EN_No_money = "[prefix] &cYou don't have enough money!";
|
public static String EN_No_money = "[prefix] &cYou don't have enough money!/*/&cYou need: &6[price]&c.";
|
||||||
|
public static String EN_No_moneyItem = "[prefix] &cYou don't have enough items of &6[item] &cin your inventory!/*/&cYou need: &6[amount]&c.";
|
||||||
|
public static String EN_No_moneyVote = "[prefix] &cYou do not have enough vote points!/*/&cYou need: &6[amount]&c.";
|
||||||
public static String EN_NoInventorySpace = "[prefix] &cYou have no room in your inventory!";
|
public static String EN_NoInventorySpace = "[prefix] &cYou have no room in your inventory!";
|
||||||
|
|
||||||
public static String EN_onServerChange = "[prefix] &2You will be connected to the server &e[server]§2.";
|
public static String EN_onServerChange = "[prefix] &2You will be connected to the server &e[server]§2.";
|
||||||
@@ -50,6 +52,14 @@ public class MSG {
|
|||||||
public static String EN_PlayerNotFond = "[prefix] &cThe player &6[player] &cwas not found or is not online!";
|
public static String EN_PlayerNotFond = "[prefix] &cThe player &6[player] &cwas not found or is not online!";
|
||||||
public static String EN_PlayerNoInventorySpace = "[prefix] &6[player] &chas no free space in his inventory!";
|
public static String EN_PlayerNoInventorySpace = "[prefix] &6[player] &chas no free space in his inventory!";
|
||||||
|
|
||||||
|
public static String EN_FunctionItemAdd = "[prefix] &2You have &6[amount] [item] &2placed in your inventory.";
|
||||||
|
public static String EN_FunctionItemRemove = "[prefix] &2You have been &6[amount] [item] &2removed.";
|
||||||
|
public static String EN_FunctionItemRemoveError = "[prefix] &cYou don't have so many items!/*/&cYou need &6[amount] [item]&c!";
|
||||||
|
|
||||||
|
public static String EN_FunctionVoteAdd = "[prefix] &2You were given &6[amount] &2Vote points.";
|
||||||
|
public static String EN_FunctionVoteRemove = "[prefix] &2You have been removed &6[amount] &2Vote points.";
|
||||||
|
public static String EN_FunctionVoteRemoveError = "[prefix] &cYou don't have so many VotePoints!/*/&cYou need &6[amount]&c!";
|
||||||
|
|
||||||
public static String EN_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &eOpen the default GUI &7(&r[gui]&7)&e.";
|
public static String EN_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &eOpen the default GUI &7(&r[gui]&7)&e.";
|
||||||
public static String EN_Help_Open = "&8''&b/commandgui [gui]&8'' &eOpen the GUI: &6[guiname]&e.";
|
public static String EN_Help_Open = "&8''&b/commandgui [gui]&8'' &eOpen the GUI: &6[guiname]&e.";
|
||||||
public static String EN_Help_Help = "&8''&b/commandguihelp&8'' &eOpen this help.";
|
public static String EN_Help_Help = "&8''&b/commandguihelp&8'' &eOpen this help.";
|
||||||
@@ -60,7 +70,18 @@ public class MSG {
|
|||||||
|
|
||||||
public static String EN_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eActivate the GUIItem for you.";
|
public static String EN_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eActivate the GUIItem for you.";
|
||||||
public static String EN_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDisable the GUIItem for yourself.";
|
public static String EN_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDisable the GUIItem for yourself.";
|
||||||
public static String EN_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSet the slot for GUIItem for you.";
|
public static String EN_GUIItemHelp_Slot = "&8''&b/gui-item slot &7<slot>&8'' &eSet the slot where you want to have the GUIItem.";
|
||||||
|
public static String EN_PlayerHelp_CGUI = "&b/commandgui &8| &b/cgui/*/&eOpen the default GUI &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui";
|
||||||
|
public static String EN_PlayerHelp_Open = "&b/commandgui [gui]/*/&eOpen the GUI: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui ";
|
||||||
|
public static String EN_PlayerHelp_Help = "&b/commandguihelp/*/&eOpen this help./*/SUGGEST_COMMAND/*//commandguihelp";
|
||||||
|
public static String EN_PlayerHelp_Info = "&b/commandgui admin info/*/&eCall the info from &4Command&9GUI &e./*/SUGGEST_COMMAND/*//commandgui admin info";
|
||||||
|
public static String EN_PlayerHelp_Give = "&b/commandgui admin give &7<player>/*/&eGive a player the GUI item./*/SUGGEST_COMMAND/*//commandgui admin give ";
|
||||||
|
public static String EN_PlayerHelp_CreateDefaultGUI = "&b/commandgui admin createdefaultgui/*/&eCreate a default GUI &7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui";
|
||||||
|
public static String EN_PlayerHelp_Reload = "&b/commandgui admin reload/*/&eReload the plugin./*/SUGGEST_COMMAND/*//commandgui admin reload";
|
||||||
|
|
||||||
|
public static String EN_GUIItemPlayerHelp_on = "&b/gui-item on/*/&eActivate the GUIItem for you./*/SUGGEST_COMMAND/*//gui-item on";
|
||||||
|
public static String EN_GUIItemPlayerHelp_off = "&b/gui-item off/*/&eDisable the GUIItem for yourself./*/SUGGEST_COMMAND/*//gui-item off";
|
||||||
|
public static String EN_GUIItemPlayerHelp_Slot = "&b/gui-item slot &7<slot>/*/&eSet the slot where you want to have the GUIItem./*/SUGGEST_COMMAND/*//gui-item slot ";
|
||||||
|
|
||||||
// DE
|
// DE
|
||||||
public static String DE_VaultNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
public static String DE_VaultNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
||||||
@@ -85,7 +106,9 @@ public class MSG {
|
|||||||
public static String DE_UseItemDisabledInWorld = "[prefix] &cDas UseItem ist in dieser Welt deaktiviert!";
|
public static String DE_UseItemDisabledInWorld = "[prefix] &cDas UseItem ist in dieser Welt deaktiviert!";
|
||||||
|
|
||||||
public static String DE_Buy_msg = "[prefix] &2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.";
|
public static String DE_Buy_msg = "[prefix] &2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.";
|
||||||
public static String DE_No_money = "[prefix] &cDu hast nicht gen[ue]gend Geld!";
|
public static String DE_No_money = "[prefix] &cDu hast nicht gen[ue]gend Geld!/*/&cDu ben[oe]tigst [price].";
|
||||||
|
public static String DE_No_moneyItem = "[prefix] &cDu hast nicht gen[ue]gent Items von &6[item] &cim Inventar!/*/&cDu ben[oe]tigst: &6[amount]&c.";
|
||||||
|
public static String DE_No_moneyVote = "[prefix] &cDu hast nicht gen[ue]gent Vote Punkte!/*/&cDu ben[oe]tigst: &6[amount]&c.";
|
||||||
public static String DE_NoInventorySpace = "[prefix] &cDu hast keinen Platz in deinem Inventar!";
|
public static String DE_NoInventorySpace = "[prefix] &cDu hast keinen Platz in deinem Inventar!";
|
||||||
|
|
||||||
public static String DE_onServerChange = "[prefix] &2Du wirst auf den Server §e[server] §2verbunden.";
|
public static String DE_onServerChange = "[prefix] &2Du wirst auf den Server §e[server] §2verbunden.";
|
||||||
@@ -99,6 +122,14 @@ public class MSG {
|
|||||||
public static String DE_PlayerNotFond = "[prefix] &cDer Spieler &6[player] &cwurde nicht gefunden oder ist nicht Online!";
|
public static String DE_PlayerNotFond = "[prefix] &cDer Spieler &6[player] &cwurde nicht gefunden oder ist nicht Online!";
|
||||||
public static String DE_PlayerNoInventorySpace = "[prefix] &6[player] &chat keinen freien Platz in seinem Inventar!";
|
public static String DE_PlayerNoInventorySpace = "[prefix] &6[player] &chat keinen freien Platz in seinem Inventar!";
|
||||||
|
|
||||||
|
public static String DE_FunctionItemAdd = "[prefix] &2Dir wurden &6[amount] [item] &2in dein Inventar gelegt.";
|
||||||
|
public static String DE_FunctionItemRemove = "[prefix] &2Dir wurden &6[amount] [item] &2entfernt.";
|
||||||
|
public static String DE_FunctionItemRemoveError = "[prefix] &cDu hast nicht so viele Items!/*/&cDu benötigets &6[amount] [item]&c!";
|
||||||
|
|
||||||
|
public static String DE_FunctionVoteAdd = "[prefix] &2Dir wurden &6[amount] &2Vote Punkte gegeben.";
|
||||||
|
public static String DE_FunctionVoteRemove = "[prefix] &2Dir wurden &6[amount] &2Vote Punkte entfernt.";
|
||||||
|
public static String DE_FunctionVoteRemoveError = "[prefix] &cDu hast nicht so viele VotePunkte!/*/&cDu benötigets &6[amount]&c!";
|
||||||
|
|
||||||
public static String DE_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &e[OE]ffne die default GUI &7(&r[gui]&7)&e.";
|
public static String DE_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &e[OE]ffne die default GUI &7(&r[gui]&7)&e.";
|
||||||
public static String DE_Help_Open = "&8''&b/commandgui [gui]&8'' &e[OE]ffne die GUI: &6[guiname]&e.";
|
public static String DE_Help_Open = "&8''&b/commandgui [gui]&8'' &e[OE]ffne die GUI: &6[guiname]&e.";
|
||||||
public static String DE_Help_Help = "&8''&b/commandguihelp&8'' &e[OE]ffne diese help.";
|
public static String DE_Help_Help = "&8''&b/commandguihelp&8'' &e[OE]ffne diese help.";
|
||||||
@@ -109,7 +140,21 @@ public class MSG {
|
|||||||
|
|
||||||
public static String DE_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiviere f[ue]r dich das GUIItem.";
|
public static String DE_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiviere f[ue]r dich das GUIItem.";
|
||||||
public static String DE_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiviere f[ue]r dich das GUIItem.";
|
public static String DE_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiviere f[ue]r dich das GUIItem.";
|
||||||
public static String DE_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSetze den Slot für GUIItem für Sie einstellen.";
|
public static String DE_GUIItemHelp_Slot = "&8''&b/gui-item slot &7<slot>&8'' &eStelle den Slot ein, auf den du das GUIItem haben möchtest.";
|
||||||
|
|
||||||
|
public static String DE_PlayerHelp_CGUI = "&b/commandgui &8| &b/cgui/*/&e[OE]ffne die default GUI &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui";
|
||||||
|
public static String DE_PlayerHelp_Open = "&b/commandgui [gui]/*/&e[OE]ffne die GUI: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui ";
|
||||||
|
public static String DE_PlayerHelp_Help = "&b/commandguihelp/*/&e[OE]ffne diese help./*/SUGGEST_COMMAND/*//commandguihelp";
|
||||||
|
public static String DE_PlayerHelp_Info = "&b/commandgui admin info/*/&eRufe die Infos von &4Command&9GUI &eauf./*/SUGGEST_COMMAND/*//commandgui admin info";
|
||||||
|
public static String DE_PlayerHelp_Give = "&b/commandgui admin give &7<player>/*/&eGebe einem Spieler das GUI-Item./*/SUGGEST_COMMAND/*//commandgui admin give ";
|
||||||
|
public static String DE_PlayerHelp_CreateDefaultGUI = "&b/commandgui admin createdefaultgui/*/&eLasse eine default GUI erstellen &7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui";
|
||||||
|
public static String DE_PlayerHelp_Reload = "&b/commandgui admin reload/*/&eLade das Plugin neu./*/SUGGEST_COMMAND/*//commandgui admin reload";
|
||||||
|
|
||||||
|
public static String DE_GUIItemPlayerHelp_on = "&b/gui-item on/*/&eAktiviere f[ue]r dich das GUIItem./*/SUGGEST_COMMAND/*//gui-item on";
|
||||||
|
public static String DE_GUIItemPlayerHelp_off = "&b/gui-item off/*/&eDeaktiviere f[ue]r dich das GUIItem./*/SUGGEST_COMMAND/*//gui-item off";
|
||||||
|
public static String DE_GUIItemPlayerHelp_Slot = "&b/gui-item slot &7<slot>/*/&eStelle den Slot ein, auf den du das GUIItem haben möchtest./*/SUGGEST_COMMAND/*//gui-item slot ";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// FR
|
// FR
|
||||||
@@ -138,7 +183,9 @@ public class MSG {
|
|||||||
public static String NO_UseItemDisabledInWorld = "[prefix] &cUseItem er deaktivert i denne verden!";
|
public static String NO_UseItemDisabledInWorld = "[prefix] &cUseItem er deaktivert i denne verden!";
|
||||||
|
|
||||||
public static String NO_Buy_msg = "[prefix] &2Du kjøpte [itemname] &2for &6[price]&2.";
|
public static String NO_Buy_msg = "[prefix] &2Du kjøpte [itemname] &2for &6[price]&2.";
|
||||||
public static String NO_No_money = "[prefix] &cDu har ikke nok penger!";
|
public static String NO_No_money = "[prefix] &cDu har ikke nok penger!/*/&cDu trenger &6[price]&c.";
|
||||||
|
public static String NO_No_moneyItem = "[prefix] &cDu har ikke nok varer av &6[item] &ci inventaret ditt!/*/&cDu trenger: &6[amount]&c.";
|
||||||
|
public static String NO_No_moneyVote = "[prefix] &cDu har ikke nok stemmepoeng!/*/&cDu trenger: &6[amount]&c.";
|
||||||
public static String NO_NoInventorySpace = "[prefix] &cDu har ikke nok plass i inventaret ditt!";
|
public static String NO_NoInventorySpace = "[prefix] &cDu har ikke nok plass i inventaret ditt!";
|
||||||
|
|
||||||
public static String NO_onServerChange = "[prefix] &2Du vil bli tilkoblet serveren &e[server]&2.";
|
public static String NO_onServerChange = "[prefix] &2Du vil bli tilkoblet serveren &e[server]&2.";
|
||||||
@@ -152,6 +199,14 @@ public class MSG {
|
|||||||
public static String NO_PlayerNotFond = "[prefix] &cSpilleren &6[player] &cble ikke funnet eller er ikke pålogget!";
|
public static String NO_PlayerNotFond = "[prefix] &cSpilleren &6[player] &cble ikke funnet eller er ikke pålogget!";
|
||||||
public static String NO_PlayerNoInventorySpace = "[prefix] &6[player] &char ikke nok plass i inventaret sitt!";
|
public static String NO_PlayerNoInventorySpace = "[prefix] &6[player] &char ikke nok plass i inventaret sitt!";
|
||||||
|
|
||||||
|
public static String NO_FunctionItemAdd = "[prefix] &2Du har &6[amount] [item] &2plassert i beholdningen din.";
|
||||||
|
public static String NO_FunctionItemRemove = "[prefix] &2Du har blitt &6[amount] [item] &2fjernet.";
|
||||||
|
public static String NO_FunctionItemRemoveError = "[prefix] &cDu har ikke så mange varer!/*/&cDu trenger &6[amount] [item]&c!";
|
||||||
|
|
||||||
|
public static String NO_FunctionVoteAdd = "[prefix] &2Du fikk &6[amount] &2stemmepoeng.";
|
||||||
|
public static String NO_FunctionVoteRemove = "[prefix] &2Du har blitt fjernet &6[amount] &2Stemmepoeng.";
|
||||||
|
public static String NO_FunctionVoteRemoveError = "[prefix] &cDu har ikke så mange stemmepoeng!/*/&cDu trenger &6[amount]&c!";
|
||||||
|
|
||||||
public static String NO_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &eÅpne default GUIen &7(&r[gui]&7)&e.";
|
public static String NO_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &eÅpne default GUIen &7(&r[gui]&7)&e.";
|
||||||
public static String NO_Help_Open = "&8''&b/commandgui [gui]&8'' &eÅpne GUIen: &6[guiname]&e.";
|
public static String NO_Help_Open = "&8''&b/commandgui [gui]&8'' &eÅpne GUIen: &6[guiname]&e.";
|
||||||
public static String NO_Help_Help = "&8''&b/commandguihelp&8'' &eSender denne hjelpe meldingen.";
|
public static String NO_Help_Help = "&8''&b/commandguihelp&8'' &eSender denne hjelpe meldingen.";
|
||||||
@@ -162,5 +217,17 @@ public class MSG {
|
|||||||
|
|
||||||
public static String NO_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiverer en GUI gjenstand for deg.";
|
public static String NO_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiverer en GUI gjenstand for deg.";
|
||||||
public static String NO_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiverer en GUI gjenstand for deg.";
|
public static String NO_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiverer en GUI gjenstand for deg.";
|
||||||
public static String NO_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSett sporet for GUIItem for deg.";
|
public static String NO_GUIItemHelp_Slot = "&8''&b/gui-item slot &7<slot>&8'' &eSett sporet for GUIItem for deg.";
|
||||||
|
|
||||||
|
public static String NO_PlayerHelp_CGUI = "&b/commandgui &8| &b/cgui/*/&eÅpne default GUIen &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui";
|
||||||
|
public static String NO_PlayerHelp_Open = "&b/commandgui [gui]/*/&eÅpne GUIen: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui ";
|
||||||
|
public static String NO_PlayerHelp_Help = "&b/commandguihelp/*/&eSender denne hjelpe meldingen./*/SUGGEST_COMMAND/*//commandguihelp";
|
||||||
|
public static String NO_PlayerHelp_Info = "&b/commandgui admin info/*/&eKall informasjon fra &4Command&9GUI&e./*/SUGGEST_COMMAND/*//commandgui admin info";
|
||||||
|
public static String NO_PlayerHelp_Give = "&b/commandgui admin give &7<player>/*/&eGi en spiller GUI gjenstanden./*/SUGGEST_COMMAND/*//commandgui admin give ";
|
||||||
|
public static String NO_PlayerHelp_CreateDefaultGUI = "&b/commandgui admin createdefaultgui/*/&eLag en normalverdi GUI &7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui";
|
||||||
|
public static String NO_PlayerHelp_Reload = "&b/commandgui admin reload/*/&eLast inn pluginet på nytt./*/SUGGEST_COMMAND/*//commandgui admin reload";
|
||||||
|
|
||||||
|
public static String NO_GUIItemPlayerHelp_on = "&b/gui-item on/*/&eAktiverer en GUI gjenstand for deg./*/SUGGEST_COMMAND/*//gui-item on";
|
||||||
|
public static String NO_GUIItemPlayerHelp_off = "&b/gui-item off/*/&eDeaktiverer en GUI gjenstand for deg./*/SUGGEST_COMMAND/*//gui-item off";
|
||||||
|
public static String NO_GUIItemPlayerHelp_Slot = "&b/gui-item slot &7<slot>/*/&eSett sporet for GUIItem for deg./*/SUGGEST_COMMAND/*//gui-item slot ";
|
||||||
}
|
}
|
||||||
|
@@ -8,6 +8,7 @@ import net.t2code.lib.Spigot.Lib.replace.Replace;
|
|||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class SelectMessages {
|
public class SelectMessages {
|
||||||
|
|
||||||
@@ -36,12 +37,14 @@ public class SelectMessages {
|
|||||||
public static String UseItemDisabledInWorld;
|
public static String UseItemDisabledInWorld;
|
||||||
|
|
||||||
public static String Buy_msg;
|
public static String Buy_msg;
|
||||||
public static String No_money;
|
public static String noMoney;
|
||||||
|
public static String noMoneyItem;
|
||||||
|
public static String noMoneyVote;
|
||||||
public static String NoInventorySpace;
|
public static String NoInventorySpace;
|
||||||
|
|
||||||
public static String onServerChange;
|
public static String onServerChange;
|
||||||
|
|
||||||
public static String GUInotFound;
|
public static String guiNotFound;
|
||||||
public static String GUIIsDisabled;
|
public static String GUIIsDisabled;
|
||||||
|
|
||||||
public static String Give_Sender;
|
public static String Give_Sender;
|
||||||
@@ -50,6 +53,13 @@ public class SelectMessages {
|
|||||||
public static String PlayerNotFond;
|
public static String PlayerNotFond;
|
||||||
public static String PlayerNoInventorySpace;
|
public static String PlayerNoInventorySpace;
|
||||||
|
|
||||||
|
public static String functionItemAdd;
|
||||||
|
public static String functionItemRemove;
|
||||||
|
public static String functionItemRemoveError;
|
||||||
|
public static String functionVoteAdd;
|
||||||
|
public static String functionVoteRemove;
|
||||||
|
public static String functionVoteRemoveError;
|
||||||
|
|
||||||
public static String HelpCgui;
|
public static String HelpCgui;
|
||||||
public static String HelpHelp;
|
public static String HelpHelp;
|
||||||
public static String HelpInfo;
|
public static String HelpInfo;
|
||||||
@@ -60,11 +70,21 @@ public class SelectMessages {
|
|||||||
public static String GUIItemHelp_on;
|
public static String GUIItemHelp_on;
|
||||||
public static String GUIItemHelp_off;
|
public static String GUIItemHelp_off;
|
||||||
public static String GUIItemHelp_Slot;
|
public static String GUIItemHelp_Slot;
|
||||||
|
public static String PlayerHelpCgui;
|
||||||
|
public static String PlayerHelpHelp;
|
||||||
|
public static String PlayerHelpInfo;
|
||||||
|
public static String PlayerHelpOpen;
|
||||||
|
public static String PlayerHelpGive;
|
||||||
|
public static String PlayerHelpCreateDefaultGUI;
|
||||||
|
public static String PlayerHelpReload;
|
||||||
|
public static String PlayerGUIItemHelp_on;
|
||||||
|
public static String PlayerGUIItemHelp_off;
|
||||||
|
public static String PlayerGUIItemHelp_Slot;
|
||||||
|
|
||||||
public static void onSelect(String Prefix) {
|
public static void onSelect(String Prefix) {
|
||||||
|
|
||||||
send.debug(Main.plugin, "§4Select language...");
|
send.debug(Main.plugin, "§4Select language...");
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
long long_ = System.currentTimeMillis();
|
||||||
|
|
||||||
File msg;
|
File msg;
|
||||||
|
|
||||||
@@ -99,16 +119,19 @@ public class SelectMessages {
|
|||||||
ItemSlotNotEmpty = select("UseItem.SlotNotEmpty", yamlConfiguration_msg);
|
ItemSlotNotEmpty = select("UseItem.SlotNotEmpty", yamlConfiguration_msg);
|
||||||
ItemSlotAlreadySet = select("UseItem.SlotAlreadySet", yamlConfiguration_msg);
|
ItemSlotAlreadySet = select("UseItem.SlotAlreadySet", yamlConfiguration_msg);
|
||||||
ItemSlot_wrongValue = select("UseItem.ItemSlot_wrongValue", yamlConfiguration_msg);
|
ItemSlot_wrongValue = select("UseItem.ItemSlot_wrongValue", yamlConfiguration_msg);
|
||||||
UseItemDisabledInGameMode =select("UseItem.DisabledInGameMode",yamlConfiguration_msg);
|
UseItemDisabledInGameMode = select("UseItem.DisabledInGameMode", yamlConfiguration_msg);
|
||||||
UseItemDisabledInWorld =select("UseItem.DisabledInWorld",yamlConfiguration_msg);
|
UseItemDisabledInWorld = select("UseItem.DisabledInWorld", yamlConfiguration_msg);
|
||||||
|
|
||||||
Buy_msg = select("Cost.Buy_msg", yamlConfiguration_msg);
|
Buy_msg = select("Cost.Buy_msg", yamlConfiguration_msg);
|
||||||
No_money = select("Cost.No_money", yamlConfiguration_msg);
|
noMoney = select("Cost.No.Money", yamlConfiguration_msg);
|
||||||
|
noMoneyItem = select("Cost.No.Item", yamlConfiguration_msg);
|
||||||
|
noMoneyVote = select("Cost.No.Vote", yamlConfiguration_msg);
|
||||||
|
|
||||||
NoInventorySpace = select("Cost.NoInventorySpace", yamlConfiguration_msg);
|
NoInventorySpace = select("Cost.NoInventorySpace", yamlConfiguration_msg);
|
||||||
|
|
||||||
onServerChange = select("ServerChange.onServerChange", yamlConfiguration_msg);
|
onServerChange = select("ServerChange.onServerChange", yamlConfiguration_msg);
|
||||||
|
|
||||||
GUInotFound = select("GUI.GUInotFound", yamlConfiguration_msg);
|
guiNotFound = select("GUI.GUInotFound", yamlConfiguration_msg);
|
||||||
GUIIsDisabled = select("GUI.GUIisDisabled", yamlConfiguration_msg);
|
GUIIsDisabled = select("GUI.GUIisDisabled", yamlConfiguration_msg);
|
||||||
|
|
||||||
Give_Sender = select("Give.Sender", yamlConfiguration_msg);
|
Give_Sender = select("Give.Sender", yamlConfiguration_msg);
|
||||||
@@ -117,6 +140,14 @@ public class SelectMessages {
|
|||||||
PlayerNotFond = select("Player.PlayerNotFond", yamlConfiguration_msg);
|
PlayerNotFond = select("Player.PlayerNotFond", yamlConfiguration_msg);
|
||||||
PlayerNoInventorySpace = select("Player.PlayerNoInventorySpace", yamlConfiguration_msg);
|
PlayerNoInventorySpace = select("Player.PlayerNoInventorySpace", yamlConfiguration_msg);
|
||||||
|
|
||||||
|
functionItemAdd = select("FunctionItem.Add", yamlConfiguration_msg);
|
||||||
|
functionItemRemove = select("FunctionItem.Remove", yamlConfiguration_msg);
|
||||||
|
functionItemRemoveError = select("FunctionItem.RemoveError", yamlConfiguration_msg);
|
||||||
|
|
||||||
|
functionVoteAdd = select("FunctionVote.Add", yamlConfiguration_msg);
|
||||||
|
functionVoteRemove = select("FunctionVote.Remove", yamlConfiguration_msg);
|
||||||
|
functionVoteRemoveError = select("FunctionVote.RemoveError", yamlConfiguration_msg);
|
||||||
|
|
||||||
HelpCgui = select("Help.CGUI", yamlConfiguration_msg);
|
HelpCgui = select("Help.CGUI", yamlConfiguration_msg);
|
||||||
HelpHelp = select("Help.Help", yamlConfiguration_msg);
|
HelpHelp = select("Help.Help", yamlConfiguration_msg);
|
||||||
HelpInfo = select("Help.Info", yamlConfiguration_msg);
|
HelpInfo = select("Help.Info", yamlConfiguration_msg);
|
||||||
@@ -128,11 +159,22 @@ public class SelectMessages {
|
|||||||
GUIItemHelp_off = select("Help.UseItem_Off", yamlConfiguration_msg);
|
GUIItemHelp_off = select("Help.UseItem_Off", yamlConfiguration_msg);
|
||||||
GUIItemHelp_Slot = select("Help.UseItem_Slot", yamlConfiguration_msg);
|
GUIItemHelp_Slot = select("Help.UseItem_Slot", yamlConfiguration_msg);
|
||||||
|
|
||||||
|
PlayerHelpCgui = select("Help.Player.CGUI", yamlConfiguration_msg);
|
||||||
|
PlayerHelpHelp = select("Help.Player.Help", yamlConfiguration_msg);
|
||||||
|
PlayerHelpInfo = select("Help.Player.Info", yamlConfiguration_msg);
|
||||||
|
PlayerHelpOpen = select("Help.Player.Open", yamlConfiguration_msg);
|
||||||
|
PlayerHelpGive = select("Help.Player.Give", yamlConfiguration_msg);
|
||||||
|
PlayerHelpCreateDefaultGUI = select("Help.Player.CreateDefaultGUI", yamlConfiguration_msg);
|
||||||
|
PlayerHelpReload = select("Help.Player.Reload", yamlConfiguration_msg);
|
||||||
|
PlayerGUIItemHelp_on = select("Help.Player.UseItem_On", yamlConfiguration_msg);
|
||||||
|
PlayerGUIItemHelp_off = select("Help.Player.UseItem_Off", yamlConfiguration_msg);
|
||||||
|
PlayerGUIItemHelp_Slot = select("Help.Player.UseItem_Slot", yamlConfiguration_msg);
|
||||||
|
|
||||||
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
|
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String select(String path, YamlConfiguration yamlConfiguration){
|
private static String select(String path, YamlConfiguration yamlConfiguration) {
|
||||||
return Replace.replace(Util.getPrefix(),yamlConfiguration.getString(path));
|
return Replace.replace(Util.getPrefix(), Objects.requireNonNull(yamlConfiguration.getString(path)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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;
|
||||||
@@ -75,6 +75,7 @@ public class OpenGUI {
|
|||||||
GuiBuilder.fillItem(inventory, gui);
|
GuiBuilder.fillItem(inventory, gui);
|
||||||
}
|
}
|
||||||
for (Slot slot : gui.slots) {
|
for (Slot slot : gui.slots) {
|
||||||
|
try {
|
||||||
Function function = Main.functionHashMap.get(slot.function);
|
Function function = Main.functionHashMap.get(slot.function);
|
||||||
if (function == null) {
|
if (function == null) {
|
||||||
send.error(Main.plugin, "The Function " + slot.function + " in the GUI " + gui.key + " does not exist!");
|
send.error(Main.plugin, "The Function " + slot.function + " in the GUI " + gui.key + " does not exist!");
|
||||||
@@ -118,6 +119,12 @@ public class OpenGUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
} catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
ItemStack air = new ItemStack(Material.AIR);
|
||||||
|
inventory.setItem(slot.slot, air);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (sound) {
|
if (sound) {
|
||||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
||||||
@@ -126,7 +133,7 @@ public class OpenGUI {
|
|||||||
}
|
}
|
||||||
player.openInventory(inventory);
|
player.openInventory(inventory);
|
||||||
send.debug(plugin, "§6" + player.getName() + " §5Open §6" + Replace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
send.debug(plugin, "§6" + player.getName() + " §5Open §6" + Replace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", Replace.replace(prefix, gui.guiName)));
|
} else send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", Replace.replace(prefix, gui.guiName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void toggleOn(Function function, Integer slot, Player player, Inventory inventory) {
|
private static void toggleOn(Function function, Integer slot, Player player, Inventory inventory) {
|
||||||
|
@@ -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,13 +10,13 @@ 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.FunctionVoteEnum;
|
||||||
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.eco.Eco;
|
||||||
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.replace.Replace;
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
import net.t2code.lib.Spigot.Lib.vault.Vault;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@@ -26,12 +26,14 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.inventory.ClickType;
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public class GUIListener implements Listener {
|
public class GUIListener implements Listener {
|
||||||
|
|
||||||
@@ -50,18 +52,18 @@ public class GUIListener implements Listener {
|
|||||||
|| (Main.PaPi && player.getOpenInventory().getTitle().equals(Replace.replace(prefix, player, GUICode + gui.guiName)))) {
|
|| (Main.PaPi && player.getOpenInventory().getTitle().equals(Replace.replace(prefix, player, GUICode + gui.guiName)))) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
for (Slot slot : gui.slots) {
|
for (Slot slot : gui.slots) {
|
||||||
execute(e,slot,player, gui);
|
execute(e, slot, player, gui);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void execute(InventoryClickEvent e, Slot slot, Player player, Gui gui){
|
private static void execute(InventoryClickEvent e, Slot slot, Player player, Gui gui) {
|
||||||
Function function = Main.functionHashMap.get(slot.function);
|
|
||||||
if (e.getSlot() != slot.slot) return;
|
if (e.getSlot() != slot.slot) return;
|
||||||
|
Function function = Main.functionHashMap.get(slot.function);
|
||||||
if (slot.permission && !player.hasPermission(slot.permissionToSee)) return;
|
if (slot.permission && !player.hasPermission(slot.permissionToSee)) return;
|
||||||
if (slot.permission && !player.hasPermission(slot.permissionToUse)) {
|
if (slot.permission && !player.hasPermission(slot.permissionToUse)) {
|
||||||
player.sendMessage(SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, function.name))
|
send.player(player, SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, function.name))
|
||||||
.replace("[perm]", slot.permissionToUse));
|
.replace("[perm]", slot.permissionToUse));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -70,28 +72,25 @@ public class GUIListener implements Listener {
|
|||||||
e.getCurrentItem().getType() == Material.valueOf(function.item.toUpperCase().replace(".", "_"))) {
|
e.getCurrentItem().getType() == Material.valueOf(function.item.toUpperCase().replace(".", "_"))) {
|
||||||
if (!slot.enable) return;
|
if (!slot.enable) return;
|
||||||
if (function.cost_Enable) {
|
if (function.cost_Enable) {
|
||||||
if (function.command_Enable || function.message_Enable || function.openGUI_Enable || function.serverChange) {
|
if (functions(function)) {
|
||||||
|
eco(e, slot, player, gui, function);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
execute(function, slot, player, e, gui);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!Vault.buy(prefix, player, function.price)) {
|
private static boolean functions(Function function) {
|
||||||
new BukkitRunnable() {
|
if (function.togglePermission) return true;
|
||||||
@Override
|
if (function.toggleUseItem) return true;
|
||||||
public void run() {
|
if (function.command_Enable) return true;
|
||||||
player.closeInventory();
|
if (function.openGUI_Enable) return true;
|
||||||
}
|
if (function.message_Enable) return true;
|
||||||
}.runTaskLater(plugin, 1L);
|
if (function.serverChange) return true;
|
||||||
player.sendMessage(SelectMessages.No_money);
|
if (function.setConfigEnable) return true;
|
||||||
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable)
|
if (function.functionVotePoints) return true;
|
||||||
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
|
return function.functionItem;
|
||||||
} else {
|
|
||||||
player.sendMessage(SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
|
|
||||||
.replace("[price]", function.price + " " + SelectConfig.Currency));
|
|
||||||
execute(function, slot, player, e, gui);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
execute(function, slot, player, e, gui);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void execute(Function function, Slot slot, Player player, InventoryClickEvent e, Gui gui) {
|
private static void execute(Function function, Slot slot, Player player, InventoryClickEvent e, Gui gui) {
|
||||||
@@ -102,16 +101,13 @@ public class GUIListener implements Listener {
|
|||||||
if (function.message_Enable) message(function, player);
|
if (function.message_Enable) message(function, player);
|
||||||
if (function.serverChange) serverChange(function, player);
|
if (function.serverChange) serverChange(function, player);
|
||||||
if (function.setConfigEnable) setConfig(function, player, e);
|
if (function.setConfigEnable) setConfig(function, player, e);
|
||||||
|
if (function.functionVotePoints) votePoints(e, function, player);
|
||||||
|
if (function.functionItem) item(function, player);
|
||||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_Click_Enable) sound(function, slot, player, gui);
|
if (SelectConfig.Sound_Enable && SelectConfig.Sound_Click_Enable) sound(function, slot, player, gui);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void command(Function slot, Player player) {
|
private static void command(Function slot, Player player) {
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
}
|
|
||||||
}.runTaskLater(plugin, 1L);
|
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -146,21 +142,16 @@ public class GUIListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void message(Function slot, Player player) {
|
private static void message(Function slot, Player player) {
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
}
|
|
||||||
}.runTaskLater(plugin, 1L);
|
|
||||||
for (String msg : slot.message) {
|
for (String msg : slot.message) {
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
if (slot.cost_Enable) {
|
if (slot.cost_Enable) {
|
||||||
player.sendMessage(Replace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
send.player(player, Replace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
||||||
} else player.sendMessage(Replace.replace(prefix, player, Placeholder.replace(msg, player)));
|
} else send.player(player, Replace.replace(prefix, player, Placeholder.replace(msg, player)));
|
||||||
} else {
|
} else {
|
||||||
if (slot.cost_Enable) {
|
if (slot.cost_Enable) {
|
||||||
player.sendMessage(Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
send.player(player, Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
||||||
} else player.sendMessage(Replace.replace(prefix, Placeholder.replace(msg, player)));
|
} else send.player(player, Replace.replace(prefix, Placeholder.replace(msg, player)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,33 +177,49 @@ public class GUIListener implements Listener {
|
|||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
if (e.getClick() == ClickType.LEFT) {
|
if (e.getClick() == ClickType.LEFT) {
|
||||||
if (slot.configOptionPremat.equals("String")) {
|
switch (slot.configOptionPremat) {
|
||||||
|
case "String":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configStringValueLeft);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configStringValueLeft);
|
||||||
} else if (slot.configOptionPremat.equals("Boolean")) {
|
break;
|
||||||
|
case "Boolean":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configBooleanValueLeft);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configBooleanValueLeft);
|
||||||
} else if (slot.configOptionPremat.equals("Integer")) {
|
break;
|
||||||
|
case "Integer":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configIntegerValueLeft);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configIntegerValueLeft);
|
||||||
} else if (slot.configOptionPremat.equals("Double")) {
|
break;
|
||||||
|
case "Double":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configDoubleValueLeft);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configDoubleValueLeft);
|
||||||
} else if (slot.configOptionPremat.equals("List")) {
|
break;
|
||||||
|
case "List":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueLeft);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueLeft);
|
||||||
} else {
|
break;
|
||||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
default:
|
||||||
|
send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e.getClick() == ClickType.RIGHT) {
|
if (e.getClick() == ClickType.RIGHT) {
|
||||||
if (slot.configOptionPremat.equals("String")) {
|
switch (slot.configOptionPremat) {
|
||||||
|
case "String":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configStringValueRight);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configStringValueRight);
|
||||||
} else if (slot.configOptionPremat.equals("Boolean")) {
|
break;
|
||||||
|
case "Boolean":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configBooleanValueRight);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configBooleanValueRight);
|
||||||
} else if (slot.configOptionPremat.equals("Integer")) {
|
break;
|
||||||
|
case "Integer":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configIntegerValueRight);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configIntegerValueRight);
|
||||||
} else if (slot.configOptionPremat.equals("Double")) {
|
break;
|
||||||
|
case "Double":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configDoubleValueRight);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configDoubleValueRight);
|
||||||
} else if (slot.configOptionPremat.equals("List")) {
|
break;
|
||||||
|
case "List":
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueRight);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueRight);
|
||||||
} else {
|
break;
|
||||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
default:
|
||||||
|
send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -280,4 +287,94 @@ public class GUIListener implements Listener {
|
|||||||
}
|
}
|
||||||
}.runTaskLater(plugin, 2L);
|
}.runTaskLater(plugin, 2L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void votePoints(InventoryClickEvent e, Function function, Player player) {
|
||||||
|
player.closeInventory();
|
||||||
|
switch (function.functionVotePointsMode) {
|
||||||
|
case ADD:
|
||||||
|
Eco.votePointsAdd(prefix, player, function.functionVotePointsAmount);
|
||||||
|
send.player(player, SelectMessages.functionVoteAdd.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||||
|
break;
|
||||||
|
case REMOVE:
|
||||||
|
if (Eco.votePointsRemove(prefix, player, function.functionVotePointsAmount)) {
|
||||||
|
send.player(player, SelectMessages.functionVoteRemove.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||||
|
} else send.player(player, SelectMessages.functionVoteRemoveError.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void item(Function function, Player player) {
|
||||||
|
String[] item = function.functionItemItem.split(";");
|
||||||
|
player.closeInventory();
|
||||||
|
switch (function.functionItemMode) {
|
||||||
|
case ADD:
|
||||||
|
Eco.itemAdd(player, item[0], Integer.parseInt(item[1]));
|
||||||
|
send.player(player, SelectMessages.functionItemAdd.replace("[amount]", item[1]).replace("[item]", item[0]));
|
||||||
|
break;
|
||||||
|
case REMOVE:
|
||||||
|
if (Eco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
|
||||||
|
send.player(player, SelectMessages.functionItemRemove.replace("[amount]", item[1]).replace("[item]", item[0]));
|
||||||
|
|
||||||
|
} else send.player(player, SelectMessages.functionItemRemoveError.replace("[amount]", item[1]));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void eco(InventoryClickEvent e, Slot slot, Player player, Gui gui, Function function) {
|
||||||
|
switch (function.ecoModule) {
|
||||||
|
case ITEM:
|
||||||
|
String[] item = function.ecoItem.split(";");
|
||||||
|
if (!Eco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
player.closeInventory();
|
||||||
|
}
|
||||||
|
}.runTaskLater(plugin, 1L);
|
||||||
|
send.player(player, SelectMessages.noMoneyItem.replace("[item]", item[0]).replace("[amount]", item[1]));
|
||||||
|
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable)
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
|
||||||
|
} else {
|
||||||
|
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
|
||||||
|
.replace("[price]", item[1] + " " + item[0]));
|
||||||
|
execute(function, slot, player, e, gui);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VOTEPOINTS:
|
||||||
|
if (!Eco.votePointsRemove(prefix, player, function.votePoints)) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
player.closeInventory();
|
||||||
|
}
|
||||||
|
}.runTaskLater(plugin, 1L);
|
||||||
|
send.player(player, SelectMessages.noMoneyVote.replace("[amount]", function.votePoints.toString()));
|
||||||
|
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable)
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
|
||||||
|
} else {
|
||||||
|
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
|
||||||
|
.replace("[price]", function.votePoints + " VotePoints"));
|
||||||
|
execute(function, slot, player, e, gui);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case VAULT:
|
||||||
|
case MONEY:
|
||||||
|
if (!Eco.moneyRemove(prefix, player, function.price)) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
player.closeInventory();
|
||||||
|
}
|
||||||
|
}.runTaskLater(plugin, 1L);
|
||||||
|
send.player(player, Replace.replacePrice(prefix, SelectMessages.noMoney, String.valueOf(function.price)));
|
||||||
|
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable)
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
|
||||||
|
} else {
|
||||||
|
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
|
||||||
|
.replace("[price]", function.price + " " + SelectConfig.Currency));
|
||||||
|
execute(function, slot, player, e, gui);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@@ -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;
|
||||||
@@ -17,7 +17,7 @@ import org.bukkit.event.server.ServerCommandEvent;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
public class PluginEvent implements Listener {
|
public class PluginEvent implements Listener {
|
||||||
private static String prefix = Main.prefix;
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoinEvent(PlayerLoginEvent event) {
|
public void onJoinEvent(PlayerLoginEvent event) {
|
@@ -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;
|
||||||
@@ -207,7 +205,7 @@ public class Events implements Listener {
|
|||||||
if (!SelectConfig.UseItem_Permission || player.hasPermission("commandgui.useitem")) {
|
if (!SelectConfig.UseItem_Permission || player.hasPermission("commandgui.useitem")) {
|
||||||
OpenGUI.openGUI(player, SelectConfig.UseItem_OpenGUI, true);
|
OpenGUI.openGUI(player, SelectConfig.UseItem_OpenGUI, true);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
send.player(player,SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
||||||
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -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;
|
@@ -1,10 +1,14 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.objects;
|
package de.jatitv.commandguiv2.Spigot.objects;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUITab;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.EcoEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.FunctionItemEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum;
|
||||||
import de.jatitv.commandguiv2.Util;
|
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;
|
||||||
@@ -14,7 +18,6 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class Obj_Select {
|
public class Obj_Select {
|
||||||
public static void onSelect() {
|
public static void onSelect() {
|
||||||
@@ -80,14 +83,14 @@ public class Obj_Select {
|
|||||||
key, commandAliasEnable, commandPermission, slots);
|
key, commandAliasEnable, commandPermission, slots);
|
||||||
|
|
||||||
Main.guiHashMap.put(key, gui);
|
Main.guiHashMap.put(key, gui);
|
||||||
CmdExecuter_GUITab.arg1.put(config_gui.getName()
|
CmdExecuter_GUI.arg1.put(config_gui.getName()
|
||||||
.replace(".yml", ""), "commandgui.gui." + key);
|
.replace(".yml", ""), "commandgui.gui." + key);
|
||||||
|
|
||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,6 +121,18 @@ public class Obj_Select {
|
|||||||
Boolean customSound_NoSound = yamlConfiguration.getBoolean("Slots.Function.CustomSound.NoSound");
|
Boolean customSound_NoSound = yamlConfiguration.getBoolean("Slots.Function.CustomSound.NoSound");
|
||||||
String customSound_Sound = yamlConfiguration.getString("Slots.Function.CustomSound.Sound");
|
String customSound_Sound = yamlConfiguration.getString("Slots.Function.CustomSound.Sound");
|
||||||
Boolean cost_Enable = yamlConfiguration.getBoolean("Slots.Function.Cost.Enable");
|
Boolean cost_Enable = yamlConfiguration.getBoolean("Slots.Function.Cost.Enable");
|
||||||
|
EcoEnum ecoModule = null;
|
||||||
|
if (yamlConfiguration.get("Slots.Function.Cost.EcoModule") != null) {
|
||||||
|
try {
|
||||||
|
ecoModule = EcoEnum.valueOf(yamlConfiguration.getString("Slots.Function.Cost.EcoModule").toUpperCase());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
send.error(Main.plugin, "The EcoModule " + yamlConfiguration.getString("Slots.Function.Cost.EcoModule").toUpperCase() + " in the function file "
|
||||||
|
+ config.getName() + " does not exist. Please use one of the supported modules. (VAULT, ITEM, VOTEPOINTS)");
|
||||||
|
}
|
||||||
|
} else ecoModule = EcoEnum.VAULT;
|
||||||
|
|
||||||
|
String ecoItem = yamlConfiguration.getString("Slots.Function.Cost.Item");
|
||||||
|
Integer votePoints = yamlConfiguration.getInt("Slots.Function.Cost.VotePoints");
|
||||||
Double price = yamlConfiguration.getDouble("Slots.Function.Cost.Price");
|
Double price = yamlConfiguration.getDouble("Slots.Function.Cost.Price");
|
||||||
Boolean command_Enable = yamlConfiguration.getBoolean("Slots.Function.Command.Enable");
|
Boolean command_Enable = yamlConfiguration.getBoolean("Slots.Function.Command.Enable");
|
||||||
Boolean command_BungeeCommand = yamlConfiguration.getBoolean("Slots.Function.Command.BungeeCommand");
|
Boolean command_BungeeCommand = yamlConfiguration.getBoolean("Slots.Function.Command.BungeeCommand");
|
||||||
@@ -154,13 +169,32 @@ public class Obj_Select {
|
|||||||
Boolean pluginReloadEnable = yamlConfiguration.getBoolean("Slots.Function.SetConfig.PluginReload.Enable");
|
Boolean pluginReloadEnable = yamlConfiguration.getBoolean("Slots.Function.SetConfig.PluginReload.Enable");
|
||||||
String pluginReloadCommand = yamlConfiguration.getString("Slots.Function.SetConfig.PluginReload.Command");
|
String pluginReloadCommand = yamlConfiguration.getString("Slots.Function.SetConfig.PluginReload.Command");
|
||||||
|
|
||||||
|
Boolean functionVotePoints = yamlConfiguration.getBoolean("Slots.Function.FunctionVotePoints.Enable");
|
||||||
|
FunctionVoteEnum functionVotePointsMode = null;
|
||||||
|
try {
|
||||||
|
functionVotePointsMode = FunctionVoteEnum.valueOf(yamlConfiguration.getString("Slots.Function.FunctionVotePoints.Mode").toUpperCase());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
send.error(Main.plugin, "The VotePoints Mode " + yamlConfiguration.getString("Slots.Function.FunctionVotePoints.Mode").toUpperCase() + " in the function file "
|
||||||
|
+ config.getName() + " does not exist. Please use one of the supported modules. (ADD, REMOVE)");
|
||||||
|
}
|
||||||
|
Integer functionVotePointsAmount = yamlConfiguration.getInt("Slots.Function.FunctionVotePoints.Amount");
|
||||||
|
Boolean functionItem = yamlConfiguration.getBoolean("Slots.Function.FunctionItem.Enable");
|
||||||
|
FunctionItemEnum functionItemMode = null;
|
||||||
|
try {
|
||||||
|
functionItemMode = FunctionItemEnum.valueOf(yamlConfiguration.getString("Slots.Function.FunctionItem.Mode").toUpperCase());
|
||||||
|
} catch (Exception ex) {
|
||||||
|
send.error(Main.plugin, "The Item Mode " + yamlConfiguration.getString("Slots.Function.FunctionItem.Mode").toUpperCase() + " in the function file "
|
||||||
|
+ config.getName() + " does not exist. Please use one of the supported modules. (ADD, REMOVE)");
|
||||||
|
}
|
||||||
|
String functionItemItem = yamlConfiguration.getString("Slots.Function.FunctionItem.Item");
|
||||||
|
|
||||||
Function function = new Function(key, empty, itemAmount, playerHead_Enable, base64_Enable, base64Value, playerWhoHasOpenedTheGUI, playerName, item, name, lore,
|
Function function = new Function(key, empty, itemAmount, playerHead_Enable, base64_Enable, base64Value, playerWhoHasOpenedTheGUI, playerName, item, name, lore,
|
||||||
customSound_Enable, customSound_NoSound, customSound_Sound, cost_Enable, price, command_Enable, command_BungeeCommand, commandAsConsole, command,
|
customSound_Enable, customSound_NoSound, customSound_Sound, cost_Enable, ecoModule, ecoItem, votePoints, price, command_Enable, command_BungeeCommand,
|
||||||
serverChange, serverChangeServer, openGUI_Enable, openGUI, togglePermission, togglePermissionPerm, toggleUseItem, message_Enable, message,
|
commandAsConsole, command, serverChange, serverChangeServer, openGUI_Enable, openGUI, togglePermission, togglePermissionPerm, toggleUseItem, message_Enable,
|
||||||
setConfigEnable, configFilePath, configOptionPath, configOptionPremat, configStringValueLeft, configBooleanValueLeft, configIntegerValueLeft,
|
message, setConfigEnable, configFilePath, configOptionPath, configOptionPremat, configStringValueLeft, configBooleanValueLeft, configIntegerValueLeft,
|
||||||
configDoubleValueLeft, configListValueLeft, configStringValueRight, configBooleanValueRight, configIntegerValueRight, configDoubleValueRight,
|
configDoubleValueLeft, configListValueLeft, configStringValueRight, configBooleanValueRight, configIntegerValueRight, configDoubleValueRight,
|
||||||
configListValueRight, pluginReloadEnable, pluginReloadCommand);
|
configListValueRight, pluginReloadEnable, pluginReloadCommand, functionVotePoints, functionVotePointsMode, functionVotePointsAmount,
|
||||||
|
functionItem, functionItemMode, functionItemItem);
|
||||||
Main.functionHashMap.put(key, function);
|
Main.functionHashMap.put(key, function);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -1,5 +1,9 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.objects.functions;
|
package de.jatitv.commandguiv2.Spigot.objects.functions;
|
||||||
|
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.EcoEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.FunctionItemEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Function {
|
public class Function {
|
||||||
@@ -14,11 +18,14 @@ public class Function {
|
|||||||
public String playerName;
|
public String playerName;
|
||||||
public String item;
|
public String item;
|
||||||
public String name;
|
public String name;
|
||||||
public List lore;
|
public List<String> lore;
|
||||||
public Boolean customSound_Enable;
|
public Boolean customSound_Enable;
|
||||||
public Boolean customSound_NoSound;
|
public Boolean customSound_NoSound;
|
||||||
public String customSound_Sound;
|
public String customSound_Sound;
|
||||||
public Boolean cost_Enable;
|
public Boolean cost_Enable;
|
||||||
|
public EcoEnum ecoModule;
|
||||||
|
public String ecoItem;
|
||||||
|
public Integer votePoints;
|
||||||
public Double price;
|
public Double price;
|
||||||
public Boolean command_Enable;
|
public Boolean command_Enable;
|
||||||
public Boolean command_BungeeCommand;
|
public Boolean command_BungeeCommand;
|
||||||
@@ -54,6 +61,12 @@ public class Function {
|
|||||||
|
|
||||||
public Boolean pluginReloadEnable;
|
public Boolean pluginReloadEnable;
|
||||||
public String pluginReloadCommand;
|
public String pluginReloadCommand;
|
||||||
|
public Boolean functionVotePoints;
|
||||||
|
public FunctionVoteEnum functionVotePointsMode;
|
||||||
|
public Integer functionVotePointsAmount;
|
||||||
|
public Boolean functionItem;
|
||||||
|
public FunctionItemEnum functionItemMode;
|
||||||
|
public String functionItemItem;
|
||||||
|
|
||||||
public Function(String key,
|
public Function(String key,
|
||||||
Boolean empty,
|
Boolean empty,
|
||||||
@@ -70,6 +83,9 @@ public class Function {
|
|||||||
Boolean customSound_NoSound,
|
Boolean customSound_NoSound,
|
||||||
String customSound_Sound,
|
String customSound_Sound,
|
||||||
Boolean cost_Enable,
|
Boolean cost_Enable,
|
||||||
|
EcoEnum ecoModule,
|
||||||
|
String ecoItem,
|
||||||
|
Integer votePoints,
|
||||||
Double price,
|
Double price,
|
||||||
Boolean command_Enable,
|
Boolean command_Enable,
|
||||||
Boolean command_BungeeCommand,
|
Boolean command_BungeeCommand,
|
||||||
@@ -102,7 +118,13 @@ public class Function {
|
|||||||
List<String> configListValueRight,
|
List<String> configListValueRight,
|
||||||
|
|
||||||
Boolean pluginReloadEnable,
|
Boolean pluginReloadEnable,
|
||||||
String pluginReloadCommand) {
|
String pluginReloadCommand,
|
||||||
|
Boolean functionVotePoints,
|
||||||
|
FunctionVoteEnum functionVotePointsMode,
|
||||||
|
Integer functionVotePointsAmount,
|
||||||
|
Boolean functionItem,
|
||||||
|
FunctionItemEnum functionItemMode,
|
||||||
|
String functionItemItem) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.empty = empty;
|
this.empty = empty;
|
||||||
this.itemAmount = itemAmount;
|
this.itemAmount = itemAmount;
|
||||||
@@ -118,6 +140,9 @@ public class Function {
|
|||||||
this.customSound_NoSound = customSound_NoSound;
|
this.customSound_NoSound = customSound_NoSound;
|
||||||
this.customSound_Sound = customSound_Sound;
|
this.customSound_Sound = customSound_Sound;
|
||||||
this.cost_Enable = cost_Enable;
|
this.cost_Enable = cost_Enable;
|
||||||
|
this.ecoModule = ecoModule;
|
||||||
|
this.ecoItem = ecoItem;
|
||||||
|
this.votePoints = votePoints;
|
||||||
this.price = price;
|
this.price = price;
|
||||||
this.command_Enable = command_Enable;
|
this.command_Enable = command_Enable;
|
||||||
this.command_BungeeCommand = command_BungeeCommand;
|
this.command_BungeeCommand = command_BungeeCommand;
|
||||||
@@ -154,6 +179,13 @@ public class Function {
|
|||||||
this.pluginReloadEnable = pluginReloadEnable;
|
this.pluginReloadEnable = pluginReloadEnable;
|
||||||
this.pluginReloadCommand = pluginReloadCommand;
|
this.pluginReloadCommand = pluginReloadCommand;
|
||||||
|
|
||||||
|
this.functionVotePoints = functionVotePoints;
|
||||||
|
this.functionVotePointsMode = functionVotePointsMode;
|
||||||
|
this.functionVotePointsAmount = functionVotePointsAmount;
|
||||||
|
this.functionItem = functionItem;
|
||||||
|
this.functionItemMode = functionItemMode;
|
||||||
|
this.functionItemItem = functionItemItem;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,21 +10,23 @@ 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;
|
||||||
|
|
||||||
public class Debug {
|
public class Debug {
|
||||||
|
|
||||||
private static final Plugin plugin = Main.plugin;
|
private static final Plugin plugin = Main.plugin;
|
||||||
|
|
||||||
public static void debugmsg() {
|
public static void debugmsg() {
|
||||||
send.debug(plugin,"§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
send.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
send.debug(plugin,"§3Bukkit Version: §e" + Bukkit.getBukkitVersion());
|
send.debug(plugin, "§3Bukkit Version: §e" + Bukkit.getBukkitVersion());
|
||||||
send.debug(plugin,"§3NMS Version: §e" + Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit.", ""));
|
send.debug(plugin, "§3NMS Version: §e" + Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit.", ""));
|
||||||
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()));
|
||||||
File f2 = new File(String.valueOf(Main.getPath() + "/GUIs/"));
|
File f2 = new File(String.valueOf(Main.getPath() + "/GUIs/"));
|
||||||
@@ -32,16 +34,24 @@ public class Debug {
|
|||||||
File[] fileArray = f.listFiles();
|
File[] fileArray = f.listFiles();
|
||||||
File[] fileArray2 = f2.listFiles();
|
File[] fileArray2 = f2.listFiles();
|
||||||
File[] fileArray3 = f3.listFiles();
|
File[] fileArray3 = f3.listFiles();
|
||||||
|
if (fileArray != null) {
|
||||||
for (File config : fileArray) {
|
for (File config : fileArray) {
|
||||||
send.debug(plugin,String.valueOf(config).replace("plugins/CommandGUI/", ""));
|
send.debug(plugin, String.valueOf(config).replace("plugins/CommandGUI/", ""));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (fileArray2 != null) {
|
||||||
for (File config2 : fileArray2) {
|
for (File config2 : fileArray2) {
|
||||||
send.debug(plugin,String.valueOf(config2).replace("plugins/CommandGUI/", ""));
|
send.debug(plugin, String.valueOf(config2).replace("plugins/CommandGUI/", ""));
|
||||||
}
|
}
|
||||||
|
} else send.debug(plugin, "No GUI files available");
|
||||||
|
|
||||||
|
if (fileArray3 != null) {
|
||||||
for (File config3 : fileArray3) {
|
for (File config3 : fileArray3) {
|
||||||
send.debug(plugin,String.valueOf(config3).replace("plugins/CommandGUI/", ""));
|
send.debug(plugin, String.valueOf(config3).replace("plugins/CommandGUI/", ""));
|
||||||
}
|
}
|
||||||
|
} else send.debug(plugin, "No language files available");
|
||||||
|
|
||||||
}
|
}
|
||||||
send.debug(plugin,"§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
send.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,7 @@
|
|||||||
|
package de.jatitv.commandguiv2.Spigot.system;
|
||||||
|
|
||||||
|
public enum EcoEnum {
|
||||||
|
VAULT, MONEY,
|
||||||
|
ITEM,
|
||||||
|
VOTEPOINTS
|
||||||
|
}
|
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
package de.jatitv.commandguiv2.Spigot.system;
|
||||||
|
|
||||||
|
public enum FunctionItemEnum {
|
||||||
|
REMOVE, ADD
|
||||||
|
}
|
@@ -0,0 +1,5 @@
|
|||||||
|
package de.jatitv.commandguiv2.Spigot.system;
|
||||||
|
|
||||||
|
public enum FunctionVoteEnum {
|
||||||
|
REMOVE, ADD
|
||||||
|
}
|
@@ -1,8 +1,8 @@
|
|||||||
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_GUITab;
|
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;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
||||||
@@ -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;
|
||||||
@@ -36,7 +35,7 @@ import java.util.List;
|
|||||||
public class Load {
|
public class Load {
|
||||||
static Plugin plugin = Main.plugin;
|
static Plugin plugin = Main.plugin;
|
||||||
|
|
||||||
public static void onLoad(String prefix, List autor, String version, String spigot, int spigotID, String discord, int bstatsID) {
|
public static void onLoad(String prefix, List<String> autor, String version, String spigot, int spigotID, String discord, int bstatsID) {
|
||||||
|
|
||||||
Long long_ = T2CodeTemplate.onLoadHeader(prefix, autor, version, spigot, discord);
|
Long long_ = T2CodeTemplate.onLoadHeader(prefix, autor, version, spigot, discord);
|
||||||
try {
|
try {
|
||||||
@@ -98,7 +97,7 @@ public class Load {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
CmdExecuter_GUITab.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -133,7 +132,7 @@ public class Load {
|
|||||||
Main.plugin.getCommand("commandguihelp").setExecutor(new CmdExecuter_Help());
|
Main.plugin.getCommand("commandguihelp").setExecutor(new CmdExecuter_Help());
|
||||||
send.debug(plugin, "CommandRegister: commandguihelp");
|
send.debug(plugin, "CommandRegister: commandguihelp");
|
||||||
}
|
}
|
||||||
Main.plugin.getCommand("commandgui").setExecutor(new CmdExecuter_GUITab());
|
Main.plugin.getCommand("commandgui").setExecutor(new CmdExecuter_GUI());
|
||||||
send.debug(plugin, "CommandRegister: commandgui");
|
send.debug(plugin, "CommandRegister: commandgui");
|
||||||
Main.plugin.getCommand("commandgui-item").setExecutor(new CmdExecuter_GUIItem());
|
Main.plugin.getCommand("commandgui-item").setExecutor(new CmdExecuter_GUIItem());
|
||||||
send.debug(plugin, "CommandRegister: commandgui-item");
|
send.debug(plugin, "CommandRegister: commandgui-item");
|
||||||
@@ -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;
|
||||||
@@ -50,7 +50,7 @@ public class UseItem {
|
|||||||
ItemStack item = null;
|
ItemStack item = null;
|
||||||
if (SelectConfig.UseItem_PlayerHead_Enable) {
|
if (SelectConfig.UseItem_PlayerHead_Enable) {
|
||||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||||
send.player(player, Main.prefix + "§c Playerheads for UseItem are only available from version §61.13§c!");
|
send.player(player, Util.getPrefix() + "§c Playerheads for UseItem are only available from version §61.13§c!");
|
||||||
send.error(Main.plugin, "Playerheads for UseItem are only available from version 1.13!");
|
send.error(Main.plugin, "Playerheads for UseItem are only available from version 1.13!");
|
||||||
} else {
|
} else {
|
||||||
item = ItemVersion.getHeadIS();
|
item = ItemVersion.getHeadIS();
|
||||||
|
@@ -4,6 +4,7 @@ import com.zaxxer.hikari.HikariConfig;
|
|||||||
import com.zaxxer.hikari.HikariDataSource;
|
import com.zaxxer.hikari.HikariDataSource;
|
||||||
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.Util;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
@@ -37,22 +38,24 @@ public class MySQL {
|
|||||||
config.addDataSourceProperty("prepStmtCacheSize", "250");
|
config.addDataSourceProperty("prepStmtCacheSize", "250");
|
||||||
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
|
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
|
||||||
ds = new HikariDataSource(config);
|
ds = new HikariDataSource(config);
|
||||||
send.console(Main.prefix + " §2MYSQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
send.console(Util.getPrefix() + " §2MYSQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
send.console(Main.prefix + " §4MYSQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
send.console(Util.getPrefix() + " §4MYSQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
send.error(Main.plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
|
send.error(Main.plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
|
||||||
}
|
}
|
||||||
if (SelectConfig.Debug || Main.version.contains("DEV")){
|
|
||||||
|
if (SelectConfig.Debug || Main.version.toLowerCase().contains("dev") || Main.version.toLowerCase().contains("beta") || Main.version.toLowerCase().contains("snapshot")) {
|
||||||
try {
|
try {
|
||||||
send.warning(Main.plugin, "MySQL DEBUG:");
|
send.error(Main.plugin, "MySQL DEBUG:");
|
||||||
Connection con = ds.getConnection();
|
Connection con = ds.getConnection();
|
||||||
DatabaseMetaData dbmd = con.getMetaData();
|
DatabaseMetaData dbmd = con.getMetaData();
|
||||||
Bukkit.getConsoleSender().sendMessage("Metadata of the database:");
|
send.debugmsg(Main.plugin, "§6Metadata of the database:");
|
||||||
Bukkit.getConsoleSender().sendMessage("DB :" + dbmd.getDatabaseProductName());
|
send.debugmsg(Main.plugin, "§6DB: §e" + dbmd.getDatabaseProductName());
|
||||||
Bukkit.getConsoleSender().sendMessage("Version :" + dbmd.getDatabaseProductVersion());
|
send.debugmsg(Main.plugin, "§6Version: §e" + dbmd.getDatabaseProductVersion());
|
||||||
Bukkit.getConsoleSender().sendMessage("Driver :" + dbmd.getDriverName());
|
send.debugmsg(Main.plugin, "§6Driver: §e" + dbmd.getDriverName());
|
||||||
Bukkit.getConsoleSender().sendMessage(" :" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
send.debugmsg(Main.plugin, "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
||||||
Bukkit.getConsoleSender().sendMessage(" :" + 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);
|
||||||
}
|
}
|
||||||
@@ -72,17 +75,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,11 +1,8 @@
|
|||||||
package de.jatitv.commandguiv2;
|
package de.jatitv.commandguiv2;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
private static Integer configVersion = 5;
|
private static Integer configVersion = 5;
|
||||||
private static double requiredT2CodeLibVersion = 11.8;
|
private static double requiredT2CodeLibVersion = 12.0;
|
||||||
private static String Prefix = "§8[§4C§9GUI§8]";
|
private static String Prefix = "§8[§4C§9GUI§8]";
|
||||||
private static Integer SpigotID = 90671;
|
private static Integer SpigotID = 90671;
|
||||||
private static Integer BstatsID = 10840;
|
private static Integer BstatsID = 10840;
|
||||||
@@ -39,8 +36,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;
|
||||||
@@ -10,6 +10,7 @@ import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
|||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Permissions;
|
import de.jatitv.commandguiv2.Spigot.system.Permissions;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
||||||
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -70,7 +71,7 @@ public class CGuiAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void sendHelp(CommandSender sender) {
|
public static void sendHelp(CommandSender sender) {
|
||||||
Help.sendHelp(sender, Main.prefix);
|
Help.sendHelp(sender, Util.getPrefix());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendPluginInfo(CommandSender sender) {
|
public static void sendPluginInfo(CommandSender sender) {
|
||||||
|
Reference in New Issue
Block a user