Compare commits
13 Commits
2.7.6
...
b45895dff8
Author | SHA1 | Date | |
---|---|---|---|
b45895dff8 | |||
c43a5fd90c | |||
48c06696ef | |||
16123ec578 | |||
|
7f2b346f7b | ||
c590255d38 | |||
5d646fce48 | |||
5b089a57d8 | |||
87d0f75a4c | |||
6f3da3e3f4 | |||
|
80255a60eb | ||
f6860e9ab5 | |||
ebbec1f660 |
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>CommandGUI_V2</artifactId>
|
<artifactId>CommandGUI_V2</artifactId>
|
||||||
<version>2.7.5</version>
|
<version>2.8.2</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.9</version>
|
<version>12.1</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;
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,79 +0,0 @@
|
|||||||
// This claas was created by JaTiTV
|
|
||||||
|
|
||||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
|
||||||
import de.jatitv.commandguiv2.Util;
|
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.event.EventHandler;
|
|
||||||
import org.bukkit.event.Listener;
|
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|
||||||
import org.bukkit.event.player.PlayerLoginEvent;
|
|
||||||
import org.bukkit.event.server.ServerCommandEvent;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
|
||||||
|
|
||||||
public class PluginEvent implements Listener {
|
|
||||||
private static String prefix = Main.prefix;
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onJoinEvent(PlayerLoginEvent event) {
|
|
||||||
Player player = event.getPlayer();
|
|
||||||
SelectDatabase.nameCheck(player);
|
|
||||||
UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onClearServer(ServerCommandEvent event) {
|
|
||||||
if (SelectConfig.UseItem_KeepAtCommandClear) {
|
|
||||||
if (event.getCommand().contains("clear " + event.getCommand().replace("/", "").replace("clear ", ""))) {
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
Player player = Bukkit.getPlayer(event.getCommand().replace("/", "").replace("clear ", ""));
|
|
||||||
if (player == null){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
clearGive(player);
|
|
||||||
} catch (Exception ex){
|
|
||||||
ex.printStackTrace();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.runTaskLater(Main.plugin, 1L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
|
||||||
public void onClearPlayer(PlayerCommandPreprocessEvent event) {
|
|
||||||
if (SelectConfig.UseItem_KeepAtCommandClear) {
|
|
||||||
if (event.getMessage().toLowerCase().contains("clear")) {
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
clearGive(event.getPlayer());
|
|
||||||
}
|
|
||||||
}.runTaskLater(Main.plugin, 1L);
|
|
||||||
}
|
|
||||||
if (event.getMessage().toLowerCase().contains("clear " + event.getMessage().toLowerCase().replace("/", "").replace("clear ", ""))) {
|
|
||||||
new BukkitRunnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
clearGive(Bukkit.getPlayer(event.getMessage().toLowerCase().replace("/", "").replace("clear ", "")));
|
|
||||||
}
|
|
||||||
}.runTaskLater(Main.plugin, 1L);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void clearGive(Player player) {
|
|
||||||
ItemChange.itemChange(player, false);
|
|
||||||
}
|
|
||||||
}
|
|
@@ -4,7 +4,7 @@ package de.jatitv.commandguiv2.Spigot;
|
|||||||
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Load;
|
import de.jatitv.commandguiv2.Spigot.system.Load;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
import de.jatitv.commandguiv2.Spigot.database.MySQL;
|
||||||
import de.jatitv.commandguiv2.Util;
|
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;
|
||||||
@@ -18,7 +18,6 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
|
||||||
|
|
||||||
public final class Main extends JavaPlugin {
|
public final class Main extends JavaPlugin {
|
||||||
|
|
||||||
@@ -31,16 +30,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,10 +48,7 @@ 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
|
|
||||||
Logger logger = this.getLogger();
|
|
||||||
plugin = this;
|
plugin = this;
|
||||||
autor = plugin.getDescription().getAuthors();
|
autor = plugin.getDescription().getAuthors();
|
||||||
version = plugin.getDescription().getVersion();
|
version = plugin.getDescription().getVersion();
|
||||||
@@ -68,19 +60,21 @@ 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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addonLoad() {
|
public static void addonLoad() {
|
||||||
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"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PluginCheck.plugManGUI()) {
|
if (PluginCheck.plugManGUI()) {
|
||||||
PlugManGUI = true;
|
PlugManGUI = true;
|
||||||
addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI"));
|
addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI"));
|
||||||
@@ -88,13 +82,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 +98,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 +113,14 @@ public final class Main extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void sendTryCatch(Class c, StackTraceElement line) {
|
||||||
|
send.error(plugin, c.getName() + " Line: " + line.getLineNumber());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
// Plugin shutdown logic
|
// Plugin shutdown logic
|
||||||
if (enable) T2CodeTemplate.onDisable(prefix, autor, version, Util.getSpigot(), Util.getDiscord());
|
if (enable) T2CodeTemplate.onDisable(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||||
MySQL.close();
|
MySQL.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,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.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;
|
||||||
@@ -29,7 +30,7 @@ public class CmdExecuter_GUI 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.getAdminSubCommand())) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
Help.sendHelp(sender, prefix);
|
Help.sendHelp(sender, prefix);
|
||||||
return false;
|
return false;
|
||||||
@@ -105,7 +106,7 @@ public class CmdExecuter_GUI 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.getAdminSubCommand(), 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) {
|
||||||
|
@@ -22,13 +22,13 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
|||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
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.getUseItem_AllowToggle()) {
|
||||||
Help.sendGUIItemHelp(sender);
|
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) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
if (SelectConfig.UseItem_AllowToggle) {
|
if (SelectConfig.getUseItem_AllowToggle()) {
|
||||||
switch (args[0].toLowerCase()) {
|
switch (args[0].toLowerCase()) {
|
||||||
case "on":
|
case "on":
|
||||||
Commands.itemOn(player);
|
Commands.itemOn(player);
|
||||||
@@ -65,7 +65,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
|||||||
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
|
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
|
||||||
put("on", "commandgui.useitem.toggle");
|
put("on", "commandgui.useitem.toggle");
|
||||||
put("off", "commandgui.useitem.toggle");
|
put("off", "commandgui.useitem.toggle");
|
||||||
if (SelectConfig.UseItem_AllowSetSlot) {
|
if (SelectConfig.getUseItem_AllowSetSlot()) {
|
||||||
put("slot", "commandgui.useitem.toggle");
|
put("slot", "commandgui.useitem.toggle");
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
@@ -74,7 +74,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
|||||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
||||||
List<String> list = new ArrayList<>();
|
List<String> list = new ArrayList<>();
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
if (SelectConfig.UseItem_AllowToggle) {
|
if (SelectConfig.getUseItem_AllowToggle()) {
|
||||||
Player p = (Player) sender;
|
Player p = (Player) sender;
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
for (String command : arg1.keySet()) {
|
for (String command : arg1.keySet()) {
|
||||||
|
@@ -1,17 +1,19 @@
|
|||||||
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.useItem.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.useItem.UseItem;
|
||||||
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.database.SelectDatabase;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.sound.Sound;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
|
||||||
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.update.UpdateAPI;
|
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||||
@@ -58,13 +60,13 @@ public class Commands {
|
|||||||
send.console(Util.getPrefix() + "§8-------------------------------");
|
send.console(Util.getPrefix() + "§8-------------------------------");
|
||||||
send.console(Util.getPrefix() + " §6Plugin reload...");
|
send.console(Util.getPrefix() + " §6Plugin reload...");
|
||||||
send.console(Util.getPrefix() + "§8-------------------------------");
|
send.console(Util.getPrefix() + "§8-------------------------------");
|
||||||
|
|
||||||
CmdExecuter_GUI.arg1.clear();
|
|
||||||
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
|
||||||
|
|
||||||
SelectConfig.onSelect();
|
SelectConfig.onSelect();
|
||||||
Main.plugin.reloadConfig();
|
Main.plugin.reloadConfig();
|
||||||
if (!Objects.equals(SelectDatabase.getStorage().toString(), SelectConfig.storage)) {
|
|
||||||
|
CmdExecuter_GUI.arg1.clear();
|
||||||
|
CmdExecuter_GUI.arg1.put(SelectConfig.getAdminSubCommand(), "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
||||||
|
|
||||||
|
if (!Objects.equals(SelectDatabase.getStorage().toString(), SelectConfig.getStorage())) {
|
||||||
if (sender instanceof Player) send.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
|
if (sender instanceof Player) send.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
|
||||||
send.warning(Main.plugin, "You have changed the storage medium! To apply this change, you must restart the server!");
|
send.warning(Main.plugin, "You have changed the storage medium! To apply this change, you must restart the server!");
|
||||||
}
|
}
|
||||||
@@ -86,7 +88,7 @@ public class Commands {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SelectConfig.Bungee) {
|
if (SelectConfig.getBungee()) {
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "commandgui:bungee");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "commandgui:bungee");
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -100,25 +102,20 @@ public class Commands {
|
|||||||
public static void give(CommandSender sender, Player target) {
|
public static void give(CommandSender sender, Player target) {
|
||||||
if (Bukkit.getPlayer(target.getName()) != null) {
|
if (Bukkit.getPlayer(target.getName()) != null) {
|
||||||
UseItem.giveUseItem(target);
|
UseItem.giveUseItem(target);
|
||||||
send.sender(sender, SelectMessages.Give_Sender.replace("[player]", target.getName()).replace("[item]", SelectConfig.UseItem_Name));
|
send.sender(sender, SelectMessages.Give_Sender.replace("[player]", target.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
|
||||||
send.player(target, SelectMessages.Give_Receiver.replace("[sender]", sender.getName()).replace("[item]", SelectConfig.UseItem_Name));
|
send.player(target, SelectMessages.Give_Receiver.replace("[sender]", sender.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
|
||||||
if (SelectConfig.Sound_Give_Enable && SelectConfig.Sound_Enable) {
|
Sound.play(target, SoundEnum.Give);
|
||||||
target.playSound(target.getLocation(), SelectConfig.Sound_Give, 3, 1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
sender.sendMessage(SelectMessages.PlayerNotFond.replace("[player]", target.getName()));
|
sender.sendMessage(SelectMessages.PlayerNotFond.replace("[player]", target.getName()));
|
||||||
if (SelectConfig.Sound_PlayerNotFound_Enable && SelectConfig.Sound_Enable) {
|
if (sender instanceof Player) Sound.play((Player) sender, SoundEnum.PlayerNotFound);
|
||||||
if (sender instanceof Player)
|
|
||||||
((Player) sender).playSound(((Player) sender).getLocation(), SelectConfig.Sound_PlayerNotFound, 3, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void itemOn(Player player) {
|
public static void itemOn(Player player) {
|
||||||
UseItem.removeItem(player);
|
UseItem.removeItem(player);
|
||||||
Integer slot = null;
|
Integer slot = null;
|
||||||
if (SelectConfig.UseItem_InventorySlotEnforce) {
|
if (SelectConfig.getUseItem_InventorySlotEnforce()) {
|
||||||
slot = SelectConfig.UseItem_InventorySlot;
|
slot = SelectConfig.getUseItem_InventorySlot();
|
||||||
} else {
|
} else {
|
||||||
slot = Events.useItemSlotHashMap.get(player.getName());
|
slot = Events.useItemSlotHashMap.get(player.getName());
|
||||||
}
|
}
|
||||||
@@ -140,9 +137,7 @@ public class Commands {
|
|||||||
send.player(player, SelectMessages.ItemON);
|
send.player(player, SelectMessages.ItemON);
|
||||||
} else {
|
} else {
|
||||||
send.player(player, SelectMessages.NoInventorySpace);
|
send.player(player, SelectMessages.NoInventorySpace);
|
||||||
if (SelectConfig.Sound_NoInventorySpace_Enable && SelectConfig.Sound_Enable) {
|
Sound.play(player,SoundEnum.NoInventorySpace);
|
||||||
player.playSound(player.getLocation(), SelectConfig.Sound_NoInventorySpace, 3, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,10 +145,11 @@ 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.getUseItem_AllowSetSlot()) {
|
||||||
send.player(player, Util.getPrefix() + " §4Function disabled");
|
send.player(player, Util.getPrefix() + " §4Function disabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -174,7 +170,7 @@ public class Commands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(setSlot - 1) != null) {
|
if (SelectConfig.getUseItem_InventorySlotEnforce() || player.getInventory().getItem(setSlot - 1) != null) {
|
||||||
send.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString()));
|
send.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -191,11 +187,11 @@ public class Commands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void gui(Player player) {
|
public static void gui(Player player) {
|
||||||
if (Main.guiHashMap.containsKey(SelectConfig.DefaultGUI)) {
|
if (Main.guiHashMap.containsKey(SelectConfig.getDefaultGUI())) {
|
||||||
Gui gui = Main.guiHashMap.get(SelectConfig.DefaultGUI);
|
Gui gui = Main.guiHashMap.get(SelectConfig.getDefaultGUI());
|
||||||
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.getDefaultGUI(), true);
|
||||||
} else send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
} else send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
||||||
.replace("[perm]", "commandgui.command"));
|
.replace("[perm]", "commandgui.command"));
|
||||||
} else send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
} else send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||||
@@ -211,6 +207,6 @@ public class Commands {
|
|||||||
} else send.player(player, 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 send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
|
} else send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
|
||||||
} else send.player(player,SelectMessages.GUInotFound);
|
} else send.player(player, SelectMessages.guiNotFound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -14,7 +14,7 @@ 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) {
|
||||||
Gui gui = Main.guiHashMap.get(SelectConfig.DefaultGUI);
|
Gui gui = Main.guiHashMap.get(SelectConfig.getDefaultGUI());
|
||||||
|
|
||||||
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
||||||
cgui(sender, gui);
|
cgui(sender, gui);
|
||||||
|
@@ -15,10 +15,8 @@ public class AliasRegister {
|
|||||||
public static void onRegister() {
|
public static void onRegister() {
|
||||||
Plugin plugin = Main.plugin;
|
Plugin plugin = Main.plugin;
|
||||||
send.debug(plugin, Bukkit.getServer().getClass().getPackage().getName());
|
send.debug(plugin, Bukkit.getServer().getClass().getPackage().getName());
|
||||||
File f = new File(Main.getPath() + "/GUIs/");
|
|
||||||
File[] fileArray = f.listFiles();
|
|
||||||
if (Main.allAliases.toString().equals("[]")) {
|
if (Main.allAliases.toString().equals("[]")) {
|
||||||
send.console(Util.getSpigot() + " §4No GUI files available");
|
send.console(Util.getPrefix() + " §4No GUI files available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (String alias : Main.allAliases) {
|
for (String alias : Main.allAliases) {
|
||||||
|
@@ -22,8 +22,8 @@ public class ConfigCreate {
|
|||||||
public static void configCreate() {
|
public static void configCreate() {
|
||||||
long long_ = System.currentTimeMillis();
|
long long_ = System.currentTimeMillis();
|
||||||
if (new File(Main.getPath(), "config.yml").exists()) {
|
if (new File(Main.getPath(), "config.yml").exists()) {
|
||||||
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Main.prefix + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||||||
} else send.console(Main.prefix + " §4config.yml are created...");
|
} else send.console(Util.getPrefix() + " §4config.yml are created...");
|
||||||
|
|
||||||
File config = new File(Main.getPath(), "config.yml");
|
File config = new File(Main.getPath(), "config.yml");
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
@@ -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);
|
||||||
@@ -92,47 +93,6 @@ public class ConfigCreate {
|
|||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", true, yamlConfiguration);
|
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", true, yamlConfiguration);
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", false, yamlConfiguration);
|
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", false, yamlConfiguration);
|
||||||
|
|
||||||
Config.set("Advanced.UseItem.GameMode.Change.Enable", true, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.GameMode.Change.DelayInTicks", 1, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.GameMode.Protection.Enable", false, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.GameMode.Protection.Mode", "blacklist", yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.GameMode.Protection.List", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Advanced.UseItem.World.Change.Enable", true, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.World.Change.DelayInTicks", 1, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.World.Protection.Enable", false, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
|
|
||||||
/*
|
|
||||||
Config.set("Advanced.UseItem.ItemBlockBlacklist", Arrays.asList("CHEST", "TRAPPED_CHEST", "FURNACE", "NOTE_BLOCK",
|
|
||||||
"CRAFTING_TABLE", "ENDER_CHEST", "ANVIL", "LOOM", "COMPOSTER", "BARREL", "SMOKER",
|
|
||||||
"BLAST_FURNACE", "CARTOGRAPHY_TABLE", "FLETCHING_TABLE", "GRINDSTONE", "SMITHING_TABLE", "STONECUTTER",
|
|
||||||
"HOPPER", "DISPENSER", "DROPPER", "REPEATER", "COMPARATOR", "LEVER", "DAYLIGHT_DETECTOR",
|
|
||||||
"STONE_BUTTON", "OAK_BUTTON", "SPRUCE_BUTTON", "BIRCH_BUTTON", "JUNGLE_BUTTON", "ACACIA_BUTTON", "DARK_OAK_BUTTON", "CRIMSON_BUTTON",
|
|
||||||
"IRON_DOOR", "OAK_DOOR", "SPRUCE_DOOR", "BIRCH_DOOR", "JUNGLE_DOOR", "ACACIA_DOOR", "DARK_OAK_DOOR", "CRIMSON_DOOR", "WARPED_DOOR",
|
|
||||||
"OAK_FENCE", "SPRUCE_FENCE", "BIRCH_FENCE", "JUNGLE_FENCE", "ACACIA_FENCE", "DARK_OAK_FENCE", "CRIMSON_FENCE", "WARPED_FENCE", "NETHER_BRICK_FENCE"), yamlConfiguration);
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
if (!yamlConfiguration.contains("Advanced.UseItem.ItemBlockBlacklist")) {
|
|
||||||
List<String> materialList = Arrays.asList("BUTTON", "DOOR", "FENCE", "CHEST", "FURNACE", "NOTE_BLOCK", "CRAFTING_TABLE", "WORKBENCH",
|
|
||||||
"ANVIL", "LOOM", "COMPOSTER", "BARREL", "SMOKER", "BLAST_FURNACE", "CARTOGRAPHY_TABLE", "FLETCHING_TABLE", "GRINDSTONE",
|
|
||||||
"SMITHING_TABLE", "STONECUTTER", "HOPPER", "DISPENSER", "DROPPER", "REPEATER", "COMPARATOR", "LEVER", "DAYLIGHT_DETECTOR", "BREWING_STAND", "TRAPDOOR", "BEACON"
|
|
||||||
);
|
|
||||||
|
|
||||||
List<String> materialBlacklist = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Material material : Material.values()) {
|
|
||||||
for (String target : materialList) {
|
|
||||||
if (material.toString().contains(target)) materialBlacklist.add(material.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Config.set("Advanced.UseItem.ItemBlockBlacklist", materialBlacklist, yamlConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
Config.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration);
|
Config.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration);
|
||||||
Config.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
|
Config.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
|
||||||
if (Main.legacy) {
|
if (Main.legacy) {
|
||||||
@@ -191,11 +151,40 @@ public class ConfigCreate {
|
|||||||
Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
|
Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
|
||||||
} else Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
|
} else Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Advanced.UseItem.GameMode.Change.Enable", true, yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.GameMode.Change.DelayInTicks", 1, yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.GameMode.Protection.Enable", false, yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.GameMode.Protection.Mode", "blacklist", yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.GameMode.Protection.List", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Advanced.UseItem.World.Change.Enable", true, yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.World.Change.DelayInTicks", 1, yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.World.Protection.Enable", false, yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
|
||||||
|
Config.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
|
||||||
|
|
||||||
|
if (!yamlConfiguration.contains("Advanced.UseItem.ItemBlockBlacklist")) {
|
||||||
|
List<String> materialList = Arrays.asList("BUTTON", "DOOR", "FENCE", "CHEST", "FURNACE", "NOTE_BLOCK", "CRAFTING_TABLE", "WORKBENCH",
|
||||||
|
"ANVIL", "LOOM", "COMPOSTER", "BARREL", "SMOKER", "BLAST_FURNACE", "CARTOGRAPHY_TABLE", "FLETCHING_TABLE", "GRINDSTONE",
|
||||||
|
"SMITHING_TABLE", "STONECUTTER", "HOPPER", "DISPENSER", "DROPPER", "REPEATER", "COMPARATOR", "LEVER", "DAYLIGHT_DETECTOR", "BREWING_STAND", "TRAPDOOR", "BEACON"
|
||||||
|
);
|
||||||
|
|
||||||
|
List<String> materialBlacklist = new ArrayList<>();
|
||||||
|
for (Material material : Material.values()) {
|
||||||
|
for (String target : materialList) {
|
||||||
|
if (material.toString().contains(target)) materialBlacklist.add(material.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Config.set("Advanced.UseItem.ItemBlockBlacklist", materialBlacklist, yamlConfiguration);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfiguration.save(config);
|
yamlConfiguration.save(config);
|
||||||
} 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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,6 @@ package de.jatitv.commandguiv2.Spigot.config.config;
|
|||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.configConverter.ConfigConverterUnderV5;
|
import de.jatitv.commandguiv2.Spigot.config.configConverter.ConfigConverterUnderV5;
|
||||||
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.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;
|
||||||
@@ -17,101 +16,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SelectConfig {
|
public class SelectConfig {
|
||||||
public static Boolean Debug;
|
|
||||||
public static Boolean HelpAlias;
|
|
||||||
public static String language;
|
|
||||||
public static String Currency;
|
|
||||||
|
|
||||||
public static String storage;
|
|
||||||
|
|
||||||
public static Boolean Bungee;
|
|
||||||
public static String thisServer;
|
|
||||||
|
|
||||||
public static String DefaultGUI;
|
|
||||||
|
|
||||||
public static Boolean UseItem_Enable;
|
|
||||||
public static Boolean UseItem_AllowToggle;
|
|
||||||
public static Boolean UseItem_AllowSetSlot;
|
|
||||||
public static Boolean UseItem_GiveOnEveryJoin;
|
|
||||||
public static Boolean UseItem_GiveOnlyOnFirstJoin;
|
|
||||||
public static Boolean UseItem_ServerChange;
|
|
||||||
public static Boolean Cursor_ToGUIItem_OnLogin;
|
|
||||||
public static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin;
|
|
||||||
public static Boolean UseItem_BlockMoveAndDrop;
|
|
||||||
public static String UseItem_OpenGUI;
|
|
||||||
public static Boolean UseItem_Permission;
|
|
||||||
public static Boolean UseItem_KeepAtCommandClear;
|
|
||||||
|
|
||||||
public static Boolean UseItemGameModeChangeEnable;
|
|
||||||
public static int UseItemGameModeChangeDelayInTicks;
|
|
||||||
public static Boolean UseItemGameModeProtection;
|
|
||||||
public static Boolean UseItemGameModeRemoveItemWhenItIsDisabled;
|
|
||||||
public static String UseItemGameModeMode;
|
|
||||||
public static List<String> UseItemGameModeList;
|
|
||||||
|
|
||||||
public static Boolean UseItemWorldChangeEnable;
|
|
||||||
public static int UseItemWorldChangeDelayInTicks;
|
|
||||||
public static Boolean UseItemWorldProtection;
|
|
||||||
public static Boolean UseItemWorldRemoveItemWhenItIsDisabled;
|
|
||||||
public static String UseItemWorldMode;
|
|
||||||
public static List<String> UseItemWorldList;
|
|
||||||
public static List<String> UseItemItemBlockBlacklist;
|
|
||||||
|
|
||||||
public static Boolean disableInfoBySneak = false;
|
|
||||||
|
|
||||||
public static Boolean UseItem_InventorySlot_FreeSlot;
|
|
||||||
public static Integer UseItem_InventorySlot;
|
|
||||||
public static Boolean UseItem_InventorySlotEnforce;
|
|
||||||
public static String UseItem_Material;
|
|
||||||
public static Boolean UseItem_PlayerHead_Enable;
|
|
||||||
public static Boolean UseItem_Base64_Enable;
|
|
||||||
public static String UseItem_Base64value;
|
|
||||||
public static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
|
|
||||||
public static String UseItem_PlayerName;
|
|
||||||
public static String UseItem_Name;
|
|
||||||
public static List<String> UseItem_Lore;
|
|
||||||
|
|
||||||
public static Boolean toggleItemOnOrYesBase64;
|
|
||||||
public static String toggleItemOnOrYesBase64Value;
|
|
||||||
public static String toggleItemOnOrYesMaterial;
|
|
||||||
|
|
||||||
public static Boolean toggleItemOffOrNoBase64;
|
|
||||||
public static String toggleItemOffOrNoBase64Value;
|
|
||||||
public static String toggleItemOffOrNoMaterial;
|
|
||||||
|
|
||||||
public static String togglePermTrue;
|
|
||||||
public static String togglePermFalse;
|
|
||||||
|
|
||||||
public static String placeholderTrue;
|
|
||||||
public static String placeholderFalse;
|
|
||||||
|
|
||||||
public static Boolean Sound_Enable = true;
|
|
||||||
|
|
||||||
public static Boolean Sound_OpenInventory_Enable = true;
|
|
||||||
public static Sound Sound_OpenInventory;
|
|
||||||
public static String Sound_OpenInventory_input;
|
|
||||||
|
|
||||||
public static Boolean Sound_Click_Enable = true;
|
|
||||||
public static Sound Sound_Click;
|
|
||||||
public static String Sound_Click_input;
|
|
||||||
|
|
||||||
public static Boolean Sound_NoMoney_Enable = true;
|
|
||||||
public static Sound Sound_NoMoney;
|
|
||||||
public static String Sound_NoMoney_input;
|
|
||||||
|
|
||||||
public static Boolean Sound_NoInventorySpace_Enable = true;
|
|
||||||
public static Sound Sound_NoInventorySpace;
|
|
||||||
public static String Sound_NoInventorySpace_input;
|
|
||||||
|
|
||||||
public static Boolean Sound_Give_Enable = true;
|
|
||||||
public static Sound Sound_Give;
|
|
||||||
public static String Sound_Give_input;
|
|
||||||
|
|
||||||
public static Boolean Sound_PlayerNotFound_Enable = true;
|
|
||||||
public static Sound Sound_PlayerNotFound;
|
|
||||||
public static String Sound_PlayerNotFound_input;
|
|
||||||
|
|
||||||
|
|
||||||
public static void onSelect() {
|
public static void onSelect() {
|
||||||
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);
|
||||||
@@ -129,17 +33,18 @@ 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").toLowerCase();
|
||||||
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");
|
||||||
storage = yamlConfiguration.getString("Storage.Type").toUpperCase();
|
storage = yamlConfiguration.getString("Storage.Type").toUpperCase();
|
||||||
|
|
||||||
MySQL.ip = yamlConfiguration.getString("Storage.MySQL.IP");
|
mysqlIp = yamlConfiguration.getString("Storage.MySQL.IP");
|
||||||
MySQL.port = yamlConfiguration.getInt("Storage.MySQL.Port");
|
mysqlPort = yamlConfiguration.getInt("Storage.MySQL.Port");
|
||||||
MySQL.database = yamlConfiguration.getString("Storage.MySQL.Database");
|
mysqlDatabase = yamlConfiguration.getString("Storage.MySQL.Database");
|
||||||
MySQL.user = yamlConfiguration.getString("Storage.MySQL.User");
|
mysqlUser = yamlConfiguration.getString("Storage.MySQL.User");
|
||||||
MySQL.password = yamlConfiguration.getString("Storage.MySQL.Password");
|
mysqlPassword = yamlConfiguration.getString("Storage.MySQL.Password");
|
||||||
MySQL.SSL = yamlConfiguration.getBoolean("Storage.MySQL.SSL");
|
mysqlSSL = yamlConfiguration.getBoolean("Storage.MySQL.SSL");
|
||||||
|
|
||||||
Bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
Bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
||||||
thisServer = yamlConfiguration.getString("BungeeCord.ThisServer");
|
thisServer = yamlConfiguration.getString("BungeeCord.ThisServer");
|
||||||
@@ -170,31 +75,6 @@ public class SelectConfig {
|
|||||||
Cursor_ToGUIItem_OnlyOnFirstLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Spigot.OnlyOnFirstLogin");
|
Cursor_ToGUIItem_OnlyOnFirstLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Spigot.OnlyOnFirstLogin");
|
||||||
UseItem_ServerChange = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange");
|
UseItem_ServerChange = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange");
|
||||||
|
|
||||||
UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Change.Enable");
|
|
||||||
UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameMode.Change.DelayInTicks");
|
|
||||||
UseItemGameModeProtection = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.Enable");
|
|
||||||
UseItemGameModeRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled");
|
|
||||||
UseItemGameModeMode = yamlConfiguration.getString("Advanced.UseItem.GameMode.Protection.Mode");
|
|
||||||
List<String> gml = new ArrayList<>();
|
|
||||||
for (String gm : yamlConfiguration.getStringList("Advanced.UseItem.GameMode.Protection.List")) {
|
|
||||||
gml.add(gm.toUpperCase());
|
|
||||||
}
|
|
||||||
UseItemGameModeList = gml;
|
|
||||||
|
|
||||||
UseItemWorldChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.World.Change.Enable");
|
|
||||||
UseItemWorldChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.World.Change.DelayInTicks");
|
|
||||||
UseItemWorldProtection = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.Enable");
|
|
||||||
UseItemWorldRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled");
|
|
||||||
UseItemWorldMode = yamlConfiguration.getString("Advanced.UseItem.World.Protection.Mode");
|
|
||||||
UseItemWorldList = yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
|
|
||||||
|
|
||||||
|
|
||||||
if (yamlConfiguration.get("Advanced.UseItem.DisableInfoBySneak") != null) {
|
|
||||||
disableInfoBySneak = yamlConfiguration.getBoolean("Advanced.UseItem.DisableInfoBySneak");
|
|
||||||
}
|
|
||||||
|
|
||||||
UseItemItemBlockBlacklist = yamlConfiguration.getStringList("Advanced.UseItem.ItemBlockBlacklist");
|
|
||||||
|
|
||||||
toggleItemOnOrYesBase64 = yamlConfiguration.getBoolean("Toggle.Items.OnOrYes.Item.Base64.Enable");
|
toggleItemOnOrYesBase64 = yamlConfiguration.getBoolean("Toggle.Items.OnOrYes.Item.Base64.Enable");
|
||||||
toggleItemOnOrYesBase64Value = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Base64.Base64Value");
|
toggleItemOnOrYesBase64Value = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Base64.Base64Value");
|
||||||
toggleItemOnOrYesMaterial = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Material");
|
toggleItemOnOrYesMaterial = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Material");
|
||||||
@@ -223,6 +103,31 @@ public class SelectConfig {
|
|||||||
Sound_Give_input = (yamlConfiguration.getString("Sound.Give.Sound").toUpperCase().replace(".", "_"));
|
Sound_Give_input = (yamlConfiguration.getString("Sound.Give.Sound").toUpperCase().replace(".", "_"));
|
||||||
Sound_PlayerNotFound_Enable = yamlConfiguration.getBoolean("Sound.PlayerNotFound.Enable");
|
Sound_PlayerNotFound_Enable = yamlConfiguration.getBoolean("Sound.PlayerNotFound.Enable");
|
||||||
Sound_PlayerNotFound_input = (yamlConfiguration.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_"));
|
Sound_PlayerNotFound_input = (yamlConfiguration.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_"));
|
||||||
|
|
||||||
|
UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Change.Enable");
|
||||||
|
UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameMode.Change.DelayInTicks");
|
||||||
|
UseItemGameModeProtection = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.Enable");
|
||||||
|
UseItemGameModeRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled");
|
||||||
|
UseItemGameModeMode = yamlConfiguration.getString("Advanced.UseItem.GameMode.Protection.Mode");
|
||||||
|
List<String> gml = new ArrayList<>();
|
||||||
|
for (String gm : yamlConfiguration.getStringList("Advanced.UseItem.GameMode.Protection.List")) {
|
||||||
|
gml.add(gm.toUpperCase());
|
||||||
|
}
|
||||||
|
UseItemGameModeList = gml;
|
||||||
|
|
||||||
|
UseItemWorldChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.World.Change.Enable");
|
||||||
|
UseItemWorldChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.World.Change.DelayInTicks");
|
||||||
|
UseItemWorldProtection = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.Enable");
|
||||||
|
UseItemWorldRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled");
|
||||||
|
UseItemWorldMode = yamlConfiguration.getString("Advanced.UseItem.World.Protection.Mode");
|
||||||
|
UseItemWorldList = yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
|
||||||
|
|
||||||
|
|
||||||
|
if (yamlConfiguration.get("Advanced.UseItem.DisableInfoBySneak") != null) {
|
||||||
|
disableInfoBySneak = yamlConfiguration.getBoolean("Advanced.UseItem.DisableInfoBySneak");
|
||||||
|
}
|
||||||
|
|
||||||
|
UseItemItemBlockBlacklist = yamlConfiguration.getStringList("Advanced.UseItem.ItemBlockBlacklist");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -356,4 +261,431 @@ public class SelectConfig {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Boolean Debug;
|
||||||
|
private static Boolean HelpAlias;
|
||||||
|
private static String adminSubCommand;
|
||||||
|
private static String language;
|
||||||
|
private static String Currency;
|
||||||
|
|
||||||
|
private static String storage;
|
||||||
|
|
||||||
|
private static String mysqlIp;
|
||||||
|
private static Integer mysqlPort;
|
||||||
|
private static String mysqlDatabase;
|
||||||
|
private static String mysqlUser;
|
||||||
|
private static String mysqlPassword;
|
||||||
|
private static Boolean mysqlSSL;
|
||||||
|
|
||||||
|
|
||||||
|
private static Boolean Bungee;
|
||||||
|
private static String thisServer;
|
||||||
|
|
||||||
|
private static String DefaultGUI;
|
||||||
|
|
||||||
|
private static Boolean UseItem_Enable;
|
||||||
|
private static Boolean UseItem_AllowToggle;
|
||||||
|
private static Boolean UseItem_AllowSetSlot;
|
||||||
|
private static Boolean UseItem_GiveOnEveryJoin;
|
||||||
|
private static Boolean UseItem_GiveOnlyOnFirstJoin;
|
||||||
|
private static Boolean UseItem_ServerChange;
|
||||||
|
private static Boolean Cursor_ToGUIItem_OnLogin;
|
||||||
|
private static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin;
|
||||||
|
private static Boolean UseItem_BlockMoveAndDrop;
|
||||||
|
private static String UseItem_OpenGUI;
|
||||||
|
private static Boolean UseItem_Permission;
|
||||||
|
private static Boolean UseItem_KeepAtCommandClear;
|
||||||
|
|
||||||
|
private static Boolean UseItemGameModeChangeEnable;
|
||||||
|
private static int UseItemGameModeChangeDelayInTicks;
|
||||||
|
private static Boolean UseItemGameModeProtection;
|
||||||
|
private static Boolean UseItemGameModeRemoveItemWhenItIsDisabled;
|
||||||
|
private static String UseItemGameModeMode;
|
||||||
|
private static List<String> UseItemGameModeList;
|
||||||
|
|
||||||
|
private static Boolean UseItemWorldChangeEnable;
|
||||||
|
private static int UseItemWorldChangeDelayInTicks;
|
||||||
|
private static Boolean UseItemWorldProtection;
|
||||||
|
private static Boolean UseItemWorldRemoveItemWhenItIsDisabled;
|
||||||
|
private static String UseItemWorldMode;
|
||||||
|
private static List<String> UseItemWorldList;
|
||||||
|
private static List<String> UseItemItemBlockBlacklist;
|
||||||
|
|
||||||
|
private static Boolean disableInfoBySneak = false;
|
||||||
|
|
||||||
|
private static Boolean UseItem_InventorySlot_FreeSlot;
|
||||||
|
private static Integer UseItem_InventorySlot;
|
||||||
|
private static Boolean UseItem_InventorySlotEnforce;
|
||||||
|
private static String UseItem_Material;
|
||||||
|
private static Boolean UseItem_PlayerHead_Enable;
|
||||||
|
private static Boolean UseItem_Base64_Enable;
|
||||||
|
private static String UseItem_Base64value;
|
||||||
|
private static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
|
||||||
|
private static String UseItem_PlayerName;
|
||||||
|
private static String UseItem_Name;
|
||||||
|
private static List<String> UseItem_Lore;
|
||||||
|
|
||||||
|
private static Boolean toggleItemOnOrYesBase64;
|
||||||
|
private static String toggleItemOnOrYesBase64Value;
|
||||||
|
private static String toggleItemOnOrYesMaterial;
|
||||||
|
|
||||||
|
private static Boolean toggleItemOffOrNoBase64;
|
||||||
|
private static String toggleItemOffOrNoBase64Value;
|
||||||
|
private static String toggleItemOffOrNoMaterial;
|
||||||
|
|
||||||
|
private static String togglePermTrue;
|
||||||
|
private static String togglePermFalse;
|
||||||
|
|
||||||
|
private static String placeholderTrue;
|
||||||
|
private static String placeholderFalse;
|
||||||
|
|
||||||
|
private static Boolean Sound_Enable = true;
|
||||||
|
|
||||||
|
private static Boolean Sound_OpenInventory_Enable = true;
|
||||||
|
private static Sound Sound_OpenInventory;
|
||||||
|
private static String Sound_OpenInventory_input;
|
||||||
|
|
||||||
|
private static Boolean Sound_Click_Enable = true;
|
||||||
|
private static Sound Sound_Click;
|
||||||
|
private static String Sound_Click_input;
|
||||||
|
|
||||||
|
private static Boolean Sound_NoMoney_Enable = true;
|
||||||
|
private static Sound Sound_NoMoney;
|
||||||
|
private static String Sound_NoMoney_input;
|
||||||
|
|
||||||
|
private static Boolean Sound_NoInventorySpace_Enable = true;
|
||||||
|
private static Sound Sound_NoInventorySpace;
|
||||||
|
private static String Sound_NoInventorySpace_input;
|
||||||
|
|
||||||
|
private static Boolean Sound_Give_Enable = true;
|
||||||
|
private static Sound Sound_Give;
|
||||||
|
private static String Sound_Give_input;
|
||||||
|
|
||||||
|
private static Boolean Sound_PlayerNotFound_Enable = true;
|
||||||
|
private static Sound Sound_PlayerNotFound;
|
||||||
|
private static String Sound_PlayerNotFound_input;
|
||||||
|
|
||||||
|
public static Boolean getDebug() {
|
||||||
|
return Debug;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getHelpAlias() {
|
||||||
|
return HelpAlias;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getAdminSubCommand() {
|
||||||
|
return adminSubCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getLanguage() {
|
||||||
|
return language;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getCurrency() {
|
||||||
|
return Currency;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getStorage() {
|
||||||
|
return storage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getMysqlIp() {
|
||||||
|
return mysqlIp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getMysqlPort() {
|
||||||
|
return mysqlPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getMysqlDatabase() {
|
||||||
|
return mysqlDatabase;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getMysqlUser() {
|
||||||
|
return mysqlUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getMysqlPassword() {
|
||||||
|
return mysqlPassword;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getMysqlSSL() {
|
||||||
|
return mysqlSSL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getBungee() {
|
||||||
|
return Bungee;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getThisServer() {
|
||||||
|
return thisServer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDefaultGUI() {
|
||||||
|
return DefaultGUI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_Enable() {
|
||||||
|
return UseItem_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_AllowToggle() {
|
||||||
|
return UseItem_AllowToggle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_AllowSetSlot() {
|
||||||
|
return UseItem_AllowSetSlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_GiveOnEveryJoin() {
|
||||||
|
return UseItem_GiveOnEveryJoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_GiveOnlyOnFirstJoin() {
|
||||||
|
return UseItem_GiveOnlyOnFirstJoin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_ServerChange() {
|
||||||
|
return UseItem_ServerChange;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getCursor_ToGUIItem_OnLogin() {
|
||||||
|
return Cursor_ToGUIItem_OnLogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getCursor_ToGUIItem_OnlyOnFirstLogin() {
|
||||||
|
return Cursor_ToGUIItem_OnlyOnFirstLogin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_BlockMoveAndDrop() {
|
||||||
|
return UseItem_BlockMoveAndDrop;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUseItem_OpenGUI() {
|
||||||
|
return UseItem_OpenGUI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_Permission() {
|
||||||
|
return UseItem_Permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_KeepAtCommandClear() {
|
||||||
|
return UseItem_KeepAtCommandClear;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItemGameModeChangeEnable() {
|
||||||
|
return UseItemGameModeChangeEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getUseItemGameModeChangeDelayInTicks() {
|
||||||
|
return UseItemGameModeChangeDelayInTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItemGameModeProtection() {
|
||||||
|
return UseItemGameModeProtection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItemGameModeRemoveItemWhenItIsDisabled() {
|
||||||
|
return UseItemGameModeRemoveItemWhenItIsDisabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUseItemGameModeMode() {
|
||||||
|
return UseItemGameModeMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getUseItemGameModeList() {
|
||||||
|
return UseItemGameModeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItemWorldChangeEnable() {
|
||||||
|
return UseItemWorldChangeEnable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getUseItemWorldChangeDelayInTicks() {
|
||||||
|
return UseItemWorldChangeDelayInTicks;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItemWorldProtection() {
|
||||||
|
return UseItemWorldProtection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItemWorldRemoveItemWhenItIsDisabled() {
|
||||||
|
return UseItemWorldRemoveItemWhenItIsDisabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUseItemWorldMode() {
|
||||||
|
return UseItemWorldMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getUseItemWorldList() {
|
||||||
|
return UseItemWorldList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getUseItemItemBlockBlacklist() {
|
||||||
|
return UseItemItemBlockBlacklist;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getDisableInfoBySneak() {
|
||||||
|
return disableInfoBySneak;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_InventorySlot_FreeSlot() {
|
||||||
|
return UseItem_InventorySlot_FreeSlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getUseItem_InventorySlot() {
|
||||||
|
return UseItem_InventorySlot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_InventorySlotEnforce() {
|
||||||
|
return UseItem_InventorySlotEnforce;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUseItem_Material() {
|
||||||
|
return UseItem_Material;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_PlayerHead_Enable() {
|
||||||
|
return UseItem_PlayerHead_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_Base64_Enable() {
|
||||||
|
return UseItem_Base64_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUseItem_Base64value() {
|
||||||
|
return UseItem_Base64value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getUseItem_PlayerWhoHasOpenedTheGUI() {
|
||||||
|
return UseItem_PlayerWhoHasOpenedTheGUI;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUseItem_PlayerName() {
|
||||||
|
return UseItem_PlayerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUseItem_Name() {
|
||||||
|
return UseItem_Name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getUseItem_Lore() {
|
||||||
|
return UseItem_Lore;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getToggleItemOnOrYesBase64() {
|
||||||
|
return toggleItemOnOrYesBase64;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getToggleItemOnOrYesBase64Value() {
|
||||||
|
return toggleItemOnOrYesBase64Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getToggleItemOnOrYesMaterial() {
|
||||||
|
return toggleItemOnOrYesMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getToggleItemOffOrNoBase64() {
|
||||||
|
return toggleItemOffOrNoBase64;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getToggleItemOffOrNoBase64Value() {
|
||||||
|
return toggleItemOffOrNoBase64Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getToggleItemOffOrNoMaterial() {
|
||||||
|
return toggleItemOffOrNoMaterial;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTogglePermTrue() {
|
||||||
|
return togglePermTrue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getTogglePermFalse() {
|
||||||
|
return togglePermFalse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPlaceholderTrue() {
|
||||||
|
return placeholderTrue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPlaceholderFalse() {
|
||||||
|
return placeholderFalse;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getSound_Enable() {
|
||||||
|
return Sound_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getSound_OpenInventory_Enable() {
|
||||||
|
return Sound_OpenInventory_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Sound getSound_OpenInventory() {
|
||||||
|
return Sound_OpenInventory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSound_OpenInventory_input() {
|
||||||
|
return Sound_OpenInventory_input;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getSound_Click_Enable() {
|
||||||
|
return Sound_Click_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Sound getSound_Click() {
|
||||||
|
return Sound_Click;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSound_Click_input() {
|
||||||
|
return Sound_Click_input;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getSound_NoMoney_Enable() {
|
||||||
|
return Sound_NoMoney_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Sound getSound_NoMoney() {
|
||||||
|
return Sound_NoMoney;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSound_NoMoney_input() {
|
||||||
|
return Sound_NoMoney_input;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getSound_NoInventorySpace_Enable() {
|
||||||
|
return Sound_NoInventorySpace_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Sound getSound_NoInventorySpace() {
|
||||||
|
return Sound_NoInventorySpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSound_NoInventorySpace_input() {
|
||||||
|
return Sound_NoInventorySpace_input;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getSound_Give_Enable() {
|
||||||
|
return Sound_Give_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Sound getSound_Give() {
|
||||||
|
return Sound_Give;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSound_Give_input() {
|
||||||
|
return Sound_Give_input;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Boolean getSound_PlayerNotFound_Enable() {
|
||||||
|
return Sound_PlayerNotFound_Enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Sound getSound_PlayerNotFound() {
|
||||||
|
return Sound_PlayerNotFound;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSound_PlayerNotFound_input() {
|
||||||
|
return Sound_PlayerNotFound_input;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,12 +2,13 @@ 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.enums.FunctionItemEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.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;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -84,7 +85,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 +103,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,8 +1,10 @@
|
|||||||
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.enums.FunctionItemEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.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 org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -14,33 +16,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 +54,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 +74,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 +111,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);
|
||||||
@@ -121,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);
|
||||||
@@ -135,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);
|
||||||
@@ -197,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);
|
||||||
@@ -211,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);
|
||||||
@@ -241,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.";
|
||||||
@@ -96,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.";
|
||||||
@@ -110,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.";
|
||||||
@@ -135,6 +155,8 @@ public class MSG {
|
|||||||
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 ";
|
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
|
||||||
|
|
||||||
|
|
||||||
@@ -161,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.";
|
||||||
@@ -175,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.";
|
||||||
|
@@ -37,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;
|
||||||
@@ -51,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;
|
||||||
@@ -79,17 +88,17 @@ public class SelectMessages {
|
|||||||
|
|
||||||
File msg;
|
File msg;
|
||||||
|
|
||||||
msg = new File(Main.getPath(), "languages/" + SelectConfig.language + "_messages.yml");
|
msg = new File(Main.getPath(), "languages/" + SelectConfig.getLanguage() + "_messages.yml");
|
||||||
if (!msg.isFile()) {
|
if (!msg.isFile()) {
|
||||||
send.console(Prefix);
|
send.console(Prefix);
|
||||||
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
send.console(Prefix + " §4The selected §c" + SelectConfig.language + " §4language file was not found.");
|
send.console(Prefix + " §4The selected §c" + SelectConfig.getLanguage() + " §4language file was not found.");
|
||||||
send.console(Prefix + " §6The default language §eEnglish §6is used!");
|
send.console(Prefix + " §6The default language §eEnglish §6is used!");
|
||||||
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
send.console(Prefix);
|
send.console(Prefix);
|
||||||
msg = new File(Main.getPath(), "languages/" + "english_messages.yml");
|
msg = new File(Main.getPath(), "languages/" + "english_messages.yml");
|
||||||
selectMSG = "english";
|
selectMSG = "english";
|
||||||
} else selectMSG = SelectConfig.language;
|
} else selectMSG = SelectConfig.getLanguage();
|
||||||
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg);
|
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg);
|
||||||
|
|
||||||
VaultNotSetUp = select("Plugin.VaultNotSetUp", yamlConfiguration_msg);
|
VaultNotSetUp = select("Plugin.VaultNotSetUp", yamlConfiguration_msg);
|
||||||
@@ -114,12 +123,15 @@ public class SelectMessages {
|
|||||||
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);
|
||||||
@@ -128,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);
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
package de.jatitv.commandguiv2.Spigot.database;
|
||||||
|
|
||||||
import com.zaxxer.hikari.HikariConfig;
|
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 java.sql.*;
|
import java.sql.*;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
@@ -14,13 +14,7 @@ import java.util.Calendar;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class MySQL {
|
public class MySQL {
|
||||||
public static String ip = "localhost";
|
|
||||||
public static Integer port = 3306;
|
|
||||||
public static String database;
|
|
||||||
public static String user = "root";
|
|
||||||
public static String password = "";
|
|
||||||
protected static String url;
|
|
||||||
public static Boolean SSL;
|
|
||||||
private static final HikariConfig config = new HikariConfig();
|
private static final HikariConfig config = new HikariConfig();
|
||||||
private static HikariDataSource ds;
|
private static HikariDataSource ds;
|
||||||
|
|
||||||
@@ -30,20 +24,22 @@ public class MySQL {
|
|||||||
ZoneId timeZone = now.getTimeZone().toZoneId();
|
ZoneId timeZone = now.getTimeZone().toZoneId();
|
||||||
send.debug(Main.plugin, "Server TimeZone is : " + timeZone);
|
send.debug(Main.plugin, "Server TimeZone is : " + timeZone);
|
||||||
try {
|
try {
|
||||||
config.setJdbcUrl("jdbc:mysql://" + ip + ":" + port + "/" + database + "?useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&autoReconnect=true&serverTimezone=" + timeZone + "&useSSL=" + SSL);
|
config.setJdbcUrl("jdbc:mysql://" + SelectConfig.getMysqlIp() + ":" + SelectConfig.getMysqlPort() + "/" + SelectConfig.getMysqlDatabase()
|
||||||
config.setUsername(user);
|
+ "?useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&autoReconnect=true&serverTimezone=" + timeZone
|
||||||
config.setPassword(password);
|
+ "&useSSL=" + SelectConfig.getMysqlSSL());
|
||||||
|
config.setUsername(SelectConfig.getMysqlUser());
|
||||||
|
config.setPassword(SelectConfig.getMysqlPassword());
|
||||||
config.addDataSourceProperty("cachePrepStmts", "true");
|
config.addDataSourceProperty("cachePrepStmts", "true");
|
||||||
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.toLowerCase().contains("dev") || Main.version.toLowerCase().contains("beta") || Main.version.toLowerCase().contains("snapshot")) {
|
if (SelectConfig.getDebug() || Main.version.toLowerCase().contains("dev") || Main.version.toLowerCase().contains("beta") || Main.version.toLowerCase().contains("snapshot")) {
|
||||||
try {
|
try {
|
||||||
send.error(Main.plugin, "MySQL DEBUG:");
|
send.error(Main.plugin, "MySQL DEBUG:");
|
||||||
Connection con = ds.getConnection();
|
Connection con = ds.getConnection();
|
||||||
@@ -54,6 +50,7 @@ public class MySQL {
|
|||||||
send.debugmsg(Main.plugin, "§6Driver: §e" + dbmd.getDriverName());
|
send.debugmsg(Main.plugin, "§6Driver: §e" + dbmd.getDriverName());
|
||||||
send.debugmsg(Main.plugin, "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
send.debugmsg(Main.plugin, "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
||||||
send.debugmsg(Main.plugin, "§6Driver Version: §e" + dbmd.getDriverVersion());
|
send.debugmsg(Main.plugin, "§6Driver Version: §e" + dbmd.getDriverVersion());
|
||||||
|
con.close();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
@@ -73,17 +70,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,4 +1,4 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
package de.jatitv.commandguiv2.Spigot.database;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
@@ -1,24 +1,21 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
package de.jatitv.commandguiv2.Spigot.database;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.useItem.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.enums.StorageEnum;
|
||||||
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;
|
||||||
|
|
||||||
public class SelectDatabase {
|
public class SelectDatabase {
|
||||||
|
|
||||||
private static StorageType Storage;
|
private static StorageEnum Storage;
|
||||||
|
|
||||||
public static StorageType getStorage() {
|
public static StorageEnum getStorage() {
|
||||||
return Storage;
|
return Storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setStorage(StorageType storage) {
|
public static void setStorage(StorageEnum storage) {
|
||||||
Storage = storage;
|
Storage = storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,7 +25,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 +46,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 +69,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 +92,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;
|
@@ -1,8 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
package de.jatitv.commandguiv2.Spigot.database;
|
||||||
|
|
||||||
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.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.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -47,7 +46,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();
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -0,0 +1,7 @@
|
|||||||
|
package de.jatitv.commandguiv2.Spigot.enums;
|
||||||
|
|
||||||
|
public enum EcoEnum {
|
||||||
|
VAULT, MONEY,
|
||||||
|
ITEM,
|
||||||
|
VOTEPOINTS
|
||||||
|
}
|
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
package de.jatitv.commandguiv2.Spigot.enums;
|
||||||
|
|
||||||
|
public enum FunctionItemEnum {
|
||||||
|
REMOVE, ADD
|
||||||
|
}
|
@@ -0,0 +1,5 @@
|
|||||||
|
package de.jatitv.commandguiv2.Spigot.enums;
|
||||||
|
|
||||||
|
public enum FunctionVoteEnum {
|
||||||
|
REMOVE, ADD
|
||||||
|
}
|
@@ -0,0 +1,10 @@
|
|||||||
|
package de.jatitv.commandguiv2.Spigot.enums;
|
||||||
|
|
||||||
|
public enum SoundEnum {
|
||||||
|
OpenInventory,
|
||||||
|
Click,
|
||||||
|
NoMoney,
|
||||||
|
NoInventorySpace,
|
||||||
|
Give,
|
||||||
|
PlayerNotFound
|
||||||
|
}
|
@@ -0,0 +1,7 @@
|
|||||||
|
package de.jatitv.commandguiv2.Spigot.enums;
|
||||||
|
|
||||||
|
public enum StorageEnum {
|
||||||
|
MYSQL,
|
||||||
|
SQLITE,
|
||||||
|
YML
|
||||||
|
}
|
@@ -1,25 +1,25 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
package de.jatitv.commandguiv2.Spigot.gui;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.listener.ServerChange;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.useItem.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;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Bungee_Sender_Reciver;
|
import de.jatitv.commandguiv2.Spigot.listener.Bungee_Sender_Reciver;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
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.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Papi;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Placeholder;
|
import de.jatitv.commandguiv2.Spigot.system.Placeholder;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.sound.Sound;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
|
||||||
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.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@@ -57,8 +57,8 @@ public class GUIListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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)) {
|
||||||
send.player(player, SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, function.name))
|
send.player(player, SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, function.name))
|
||||||
@@ -70,28 +70,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;
|
||||||
send.player(player,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 {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} 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,21 +99,18 @@ 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 (SelectConfig.Sound_Enable && SelectConfig.Sound_Click_Enable) sound(function, slot, player, gui);
|
if (function.functionVotePoints) votePoints(e, function, player);
|
||||||
|
if (function.functionItem) item(function, player);
|
||||||
|
Sound.play(player, SoundEnum.Click, function, slot, 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() {
|
||||||
if (slot.command_BungeeCommand) {
|
if (slot.command_BungeeCommand) {
|
||||||
if (SelectConfig.Bungee) {
|
if (SelectConfig.getBungee()) {
|
||||||
for (String cmd : slot.command) {
|
for (String cmd : slot.command) {
|
||||||
Bungee_Sender_Reciver.sendToBungee(player, cmd.replace("[player]", player.getName()), slot.commandAsConsole);
|
Bungee_Sender_Reciver.sendToBungee(player, cmd.replace("[player]", player.getName()), slot.commandAsConsole);
|
||||||
}
|
}
|
||||||
@@ -146,20 +140,15 @@ 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) {
|
||||||
send.player(player, 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.getCurrency()));
|
||||||
} else send.player(player, 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) {
|
||||||
send.player(player, Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
send.player(player, Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
|
||||||
} else send.player(player, Replace.replace(prefix, Placeholder.replace(msg, player)));
|
} else send.player(player, Replace.replace(prefix, Placeholder.replace(msg, player)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,33 +175,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;
|
||||||
|
default:
|
||||||
send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
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;
|
||||||
|
default:
|
||||||
send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -231,23 +236,9 @@ public class GUIListener implements Listener {
|
|||||||
}.runTaskLater(plugin, 1L);
|
}.runTaskLater(plugin, 1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void sound(Function function, Slot slot, Player player, Gui gui) {
|
|
||||||
if (function.customSound_Enable) {
|
|
||||||
if (!function.customSound_NoSound) {
|
|
||||||
try {
|
|
||||||
player.playSound(player.getLocation(), Sound.valueOf(function.customSound_Sound.toUpperCase().replace(".", "_")), 3, 1);
|
|
||||||
} catch (Exception e1) {
|
|
||||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
|
|
||||||
.replace("[sound]", "§6GUI: §e" + Replace.replace(prefix, gui.guiName) + "§r §6Slot: §e" + slot.slot + " §6CustomSound: §9" + function.customSound_Sound));
|
|
||||||
player.playSound(player.getLocation(), SelectConfig.Sound_Click, 3, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else player.playSound(player.getLocation(), SelectConfig.Sound_Click, 3, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void togglePerm(Function function, Gui gui, Player player) {
|
private static void togglePerm(Function function, Gui gui, Player player) {
|
||||||
if (player.hasPermission(function.togglePermissionPerm)) {
|
if (player.hasPermission(function.togglePermissionPerm)) {
|
||||||
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), SelectConfig.togglePermFalse.replace("[player]", player.getName()).replace("[perm]", function.togglePermissionPerm));
|
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), SelectConfig.getTogglePermFalse().replace("[player]", player.getName()).replace("[perm]", function.togglePermissionPerm));
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -256,7 +247,7 @@ public class GUIListener implements Listener {
|
|||||||
}
|
}
|
||||||
}.runTaskLater(plugin, 4L);
|
}.runTaskLater(plugin, 4L);
|
||||||
} else
|
} else
|
||||||
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), SelectConfig.togglePermTrue.replace("[player]", player.getName()).replace("[perm]", function.togglePermissionPerm));
|
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), SelectConfig.getTogglePermTrue().replace("[player]", player.getName()).replace("[perm]", function.togglePermissionPerm));
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -280,4 +271,91 @@ 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]));
|
||||||
|
Sound.play(player,SoundEnum.NoMoney);
|
||||||
|
} 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()));
|
||||||
|
Sound.play(player,SoundEnum.NoMoney);
|
||||||
|
} 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)));
|
||||||
|
Sound.play(player,SoundEnum.NoMoney);
|
||||||
|
} else {
|
||||||
|
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
|
||||||
|
.replace("[price]", function.price + " " + SelectConfig.getCurrency()));
|
||||||
|
execute(function, slot, player, e, gui);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@@ -64,10 +64,10 @@ public class GuiBuilder {
|
|||||||
private static void setDisplayNameAndLore(ItemMeta itemMeta, Player player, Function slot) {
|
private static void setDisplayNameAndLore(ItemMeta itemMeta, Player player, Function slot) {
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
itemMeta.setDisplayName(Replace.replace(prefix, player, Placeholder.replace(slot.name, player)));
|
itemMeta.setDisplayName(Replace.replace(prefix, player, Placeholder.replace(slot.name, player)));
|
||||||
itemMeta.setLore(Replace.replacePrice(prefix, player, Placeholder.replace(slot.lore, player), slot.price + " " + SelectConfig.Currency));
|
itemMeta.setLore(Replace.replacePrice(prefix, player, Placeholder.replace(slot.lore, player), slot.price + " " + SelectConfig.getCurrency()));
|
||||||
} else {
|
} else {
|
||||||
itemMeta.setDisplayName(Replace.replace(prefix, Placeholder.replace(slot.name,player)));
|
itemMeta.setDisplayName(Replace.replace(prefix, Placeholder.replace(slot.name,player)));
|
||||||
itemMeta.setLore(Replace.replacePrice(prefix, Placeholder.replace(slot.lore,player), slot.price + " " + SelectConfig.Currency));
|
itemMeta.setLore(Replace.replacePrice(prefix, Placeholder.replace(slot.lore,player), slot.price + " " + SelectConfig.getCurrency()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,13 +1,14 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.gui;
|
package de.jatitv.commandguiv2.Spigot.gui;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.GUIListener;
|
import de.jatitv.commandguiv2.Spigot.useItem.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;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.sound.Sound;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import io.github.solyze.plugmangui.inventories.PluginListGUI;
|
import io.github.solyze.plugmangui.inventories.PluginListGUI;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
@@ -75,6 +76,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,11 +120,15 @@ 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) {
|
Sound.play(player, SoundEnum.OpenInventory);
|
||||||
player.playSound(player.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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");
|
||||||
@@ -130,14 +136,14 @@ public class OpenGUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void toggleOn(Function function, Integer slot, Player player, Inventory inventory) {
|
private static void toggleOn(Function function, Integer slot, Player player, Inventory inventory) {
|
||||||
if (SelectConfig.toggleItemOnOrYesBase64) {
|
if (SelectConfig.getToggleItemOnOrYesBase64()) {
|
||||||
GuiBuilder.base64(SelectConfig.toggleItemOnOrYesBase64Value, function, slot, player, inventory);
|
GuiBuilder.base64(SelectConfig.getToggleItemOnOrYesBase64Value(), function, slot, player, inventory);
|
||||||
} else GuiBuilder.item(SelectConfig.toggleItemOnOrYesMaterial, function, slot, player, inventory);
|
} else GuiBuilder.item(SelectConfig.getToggleItemOnOrYesMaterial(), function, slot, player, inventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void toggleOff(Function function, Integer slot, Player player, Inventory inventory) {
|
private static void toggleOff(Function function, Integer slot, Player player, Inventory inventory) {
|
||||||
if (SelectConfig.toggleItemOffOrNoBase64) {
|
if (SelectConfig.getToggleItemOffOrNoBase64()) {
|
||||||
GuiBuilder.base64(SelectConfig.toggleItemOffOrNoBase64Value, function, slot, player, inventory);
|
GuiBuilder.base64(SelectConfig.getToggleItemOffOrNoBase64Value(), function, slot, player, inventory);
|
||||||
} else GuiBuilder.item(SelectConfig.toggleItemOffOrNoMaterial, function, slot, player, inventory);
|
} else GuiBuilder.item(SelectConfig.getToggleItemOffOrNoMaterial(), function, slot, player, inventory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system;
|
package de.jatitv.commandguiv2.Spigot.listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
@@ -64,4 +64,16 @@ public class Bungee_Sender_Reciver implements PluginMessageListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void send(Player player, String server){
|
||||||
|
ByteArrayOutputStream b = new ByteArrayOutputStream();
|
||||||
|
DataOutputStream out = new DataOutputStream(b);
|
||||||
|
try {
|
||||||
|
out.writeUTF("Connect");
|
||||||
|
out.writeUTF(server);
|
||||||
|
} catch (IOException i) {
|
||||||
|
i.printStackTrace();
|
||||||
|
}
|
||||||
|
player.sendPluginMessage(Main.plugin, "BungeeCord", b.toByteArray());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@@ -0,0 +1,23 @@
|
|||||||
|
// This claas was created by JaTiTV
|
||||||
|
|
||||||
|
package de.jatitv.commandguiv2.Spigot.listener;
|
||||||
|
|
||||||
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.database.SelectDatabase;
|
||||||
|
import de.jatitv.commandguiv2.Util;
|
||||||
|
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
|
|
||||||
|
public class PluginEvent implements Listener {
|
||||||
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onJoinEvent(PlayerLoginEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
SelectDatabase.nameCheck(player);
|
||||||
|
UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord());
|
||||||
|
}
|
||||||
|
}
|
@@ -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;
|
||||||
@@ -8,7 +8,6 @@ import java.io.DataOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class ServerChange {
|
public class ServerChange {
|
||||||
|
|
||||||
public static void send(Player player, String server){
|
public static void send(Player player, String server){
|
||||||
ByteArrayOutputStream b = new ByteArrayOutputStream();
|
ByteArrayOutputStream b = new ByteArrayOutputStream();
|
||||||
DataOutputStream out = new DataOutputStream(b);
|
DataOutputStream out = new DataOutputStream(b);
|
@@ -5,7 +5,9 @@ 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.Util;
|
import de.jatitv.commandguiv2.Spigot.enums.EcoEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.FunctionItemEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.FunctionVoteEnum;
|
||||||
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;
|
||||||
@@ -86,7 +88,7 @@ public class Obj_Select {
|
|||||||
yamlConfiguration_gui.save(config_gui);
|
yamlConfiguration_gui.save(config_gui);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Util.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
Main.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,6 +119,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");
|
||||||
@@ -153,13 +167,37 @@ 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;
|
||||||
|
if (yamlConfiguration.get("Slots.Function.FunctionVotePoints.Mode") != 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;
|
||||||
|
if (yamlConfiguration.get("Slots.Function.FunctionItem.Mode") != 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.enums.EcoEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.FunctionItemEnum;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.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;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,60 @@
|
|||||||
|
package de.jatitv.commandguiv2.Spigot.sound;
|
||||||
|
|
||||||
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
|
||||||
|
import de.jatitv.commandguiv2.Util;
|
||||||
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class Sound {
|
||||||
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
|
public static void play(Player player, SoundEnum soundEnum) {
|
||||||
|
if (!SelectConfig.getSound_Enable()) return;
|
||||||
|
play(player, soundEnum, null, null, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void play(Player player, SoundEnum soundEnum, Function function, Slot slot, Gui gui) {
|
||||||
|
if (!SelectConfig.getSound_Enable()) return;
|
||||||
|
switch (soundEnum) {
|
||||||
|
case OpenInventory:
|
||||||
|
if (!SelectConfig.getSound_OpenInventory_Enable()) return;
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.getSound_OpenInventory(), 3, 1);
|
||||||
|
break;
|
||||||
|
case Click:
|
||||||
|
if (!SelectConfig.getSound_Click_Enable()) return;
|
||||||
|
if (!function.customSound_Enable) player.playSound(player.getLocation(), SelectConfig.getSound_Click(), 3, 1);
|
||||||
|
|
||||||
|
if (function.customSound_NoSound) return;
|
||||||
|
try {
|
||||||
|
player.playSound(player.getLocation(), org.bukkit.Sound.valueOf(function.customSound_Sound.toUpperCase().replace(".", "_")), 3, 1);
|
||||||
|
} catch (Exception e1) {
|
||||||
|
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
|
||||||
|
.replace("[sound]", "§6GUI: §e" + Replace.replace(prefix, gui.guiName) + "§r §6Slot: §e" + slot.slot + " §6CustomSound: §9" + function.customSound_Sound));
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.getSound_Click(), 3, 1);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case NoMoney:
|
||||||
|
if (!SelectConfig.getSound_NoMoney_Enable()) return;
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.getSound_NoMoney(), 3, 1);
|
||||||
|
break;
|
||||||
|
case NoInventorySpace:
|
||||||
|
if (!SelectConfig.getSound_NoInventorySpace_Enable()) return;
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.getSound_NoInventorySpace(), 3, 1);
|
||||||
|
break;
|
||||||
|
case Give:
|
||||||
|
if (!SelectConfig.getSound_Give_Enable()) return;
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.getSound_Give(), 3, 1);
|
||||||
|
break;
|
||||||
|
case PlayerNotFound:
|
||||||
|
if (!SelectConfig.getSound_PlayerNotFound_Enable()) return;
|
||||||
|
player.playSound(player.getLocation(), SelectConfig.getSound_PlayerNotFound(), 3, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -10,6 +10,7 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ public class Debug {
|
|||||||
send.debug(plugin, "§3Version: §e" + Bukkit.getVersion());
|
send.debug(plugin, "§3Version: §e" + Bukkit.getVersion());
|
||||||
send.debug(plugin, "§3Java: §e" + System.getProperty("java.version"));
|
send.debug(plugin, "§3Java: §e" + System.getProperty("java.version"));
|
||||||
send.debug(plugin, "§3Worlds: §e" + String.valueOf(Bukkit.getServer().getWorlds()));
|
send.debug(plugin, "§3Worlds: §e" + String.valueOf(Bukkit.getServer().getWorlds()));
|
||||||
send.debug(plugin, String.valueOf(Main.plugins));
|
send.debug(plugin, String.valueOf(Arrays.asList(Main.plugin.getServer().getPluginManager().getPlugins())));
|
||||||
send.debug(plugin, "§5----------------------------------");
|
send.debug(plugin, "§5----------------------------------");
|
||||||
if (new File(Main.getPath(), "config.yml").exists()) {
|
if (new File(Main.getPath(), "config.yml").exists()) {
|
||||||
File f = new File(String.valueOf(Main.getPath()));
|
File f = new File(String.valueOf(Main.getPath()));
|
||||||
|
@@ -1,7 +1,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.gui.GUIListener;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.EventsFrom110;
|
import de.jatitv.commandguiv2.Spigot.listener.Bungee_Sender_Reciver;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.useItem.EventsFrom110;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help;
|
||||||
@@ -10,17 +11,16 @@ import de.jatitv.commandguiv2.Spigot.config.functions.CreateFunctions;
|
|||||||
import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
|
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.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.useItem.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;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SQLITE;
|
import de.jatitv.commandguiv2.Spigot.database.SQLITE;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
import de.jatitv.commandguiv2.Spigot.database.SelectDatabase;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.StorageType;
|
import de.jatitv.commandguiv2.Spigot.enums.StorageEnum;
|
||||||
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;
|
||||||
@@ -72,7 +72,7 @@ public class Load {
|
|||||||
|
|
||||||
SelectConfig.setConfigVersion();
|
SelectConfig.setConfigVersion();
|
||||||
|
|
||||||
if (SelectConfig.Bungee) {
|
if (SelectConfig.getBungee()) {
|
||||||
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin, "cgui:bungee")) {
|
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin, "cgui:bungee")) {
|
||||||
send.debug(plugin, "registerOutgoingPluginChannel §ecgui:bungee");
|
send.debug(plugin, "registerOutgoingPluginChannel §ecgui:bungee");
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "cgui:bungee");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "cgui:bungee");
|
||||||
@@ -97,11 +97,7 @@ public class Load {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
SelectMessages.onSelect(prefix);
|
SelectMessages.onSelect(prefix);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -112,6 +108,11 @@ public class Load {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
CmdExecuter_GUI.arg1.put(SelectConfig.getAdminSubCommand(), "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
send.console(prefix + " §8-------------------------------");
|
send.console(prefix + " §8-------------------------------");
|
||||||
loadStorage(prefix);
|
loadStorage(prefix);
|
||||||
@@ -129,7 +130,7 @@ public class Load {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SelectConfig.HelpAlias) {
|
if (SelectConfig.getHelpAlias()) {
|
||||||
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");
|
||||||
}
|
}
|
||||||
@@ -161,11 +162,11 @@ public class Load {
|
|||||||
|
|
||||||
private static void loadStorage(String prefix) {
|
private static void loadStorage(String prefix) {
|
||||||
try {
|
try {
|
||||||
SelectDatabase.setStorage(StorageType.valueOf(SelectConfig.storage));
|
SelectDatabase.setStorage(StorageEnum.valueOf(SelectConfig.getStorage()));
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
send.error(Main.plugin, "The storage medium " + SelectConfig.storage + " is not supported!");
|
send.error(Main.plugin, "The storage medium " + SelectConfig.getStorage() + " is not supported!");
|
||||||
send.error(Main.plugin, "Storage medium " + StorageType.SQLITE + " is used.");
|
send.error(Main.plugin, "Storage medium " + StorageEnum.SQLITE + " is used.");
|
||||||
SelectDatabase.setStorage(StorageType.SQLITE);
|
SelectDatabase.setStorage(StorageEnum.SQLITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (SelectDatabase.getStorage()) {
|
switch (SelectDatabase.getStorage()) {
|
||||||
@@ -184,7 +185,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 {
|
||||||
|
@@ -4,9 +4,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system;
|
package de.jatitv.commandguiv2.Spigot.system;
|
||||||
|
|
||||||
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.database.SelectDatabase;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.StorageType;
|
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
@@ -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.useItem.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;
|
||||||
|
|
||||||
@@ -10,8 +10,8 @@ import java.util.List;
|
|||||||
public class Placeholder {
|
public class Placeholder {
|
||||||
public static String useitem(Player p) {
|
public static String useitem(Player p) {
|
||||||
if (Events.useItemHashMap.get(p.getName())) {
|
if (Events.useItemHashMap.get(p.getName())) {
|
||||||
return SelectConfig.placeholderTrue;
|
return SelectConfig.getPlaceholderTrue();
|
||||||
} else return SelectConfig.placeholderFalse;
|
} else return SelectConfig.getPlaceholderFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String useitem_boolean(Player p) {
|
public static String useitem_boolean(Player p) {
|
||||||
|
@@ -1,7 +0,0 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
|
||||||
|
|
||||||
public enum StorageType {
|
|
||||||
MYSQL,
|
|
||||||
SQLITE,
|
|
||||||
YML
|
|
||||||
}
|
|
@@ -1,18 +1,15 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
package de.jatitv.commandguiv2.Spigot.useItem;
|
||||||
|
|
||||||
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;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
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.database.SelectDatabase;
|
||||||
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 org.bukkit.Bukkit;
|
||||||
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;
|
||||||
@@ -25,6 +22,7 @@ import org.bukkit.event.inventory.InventoryDragEvent;
|
|||||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||||
import org.bukkit.event.player.*;
|
import org.bukkit.event.player.*;
|
||||||
|
import org.bukkit.event.server.ServerCommandEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
@@ -42,7 +40,7 @@ public class Events implements Listener {
|
|||||||
useItemHashMap.put(e.getPlayer().getName(), SelectDatabase.selectItemStatus(e.getPlayer()));
|
useItemHashMap.put(e.getPlayer().getName(), SelectDatabase.selectItemStatus(e.getPlayer()));
|
||||||
Integer i = SelectDatabase.selectSlot(e.getPlayer());
|
Integer i = SelectDatabase.selectSlot(e.getPlayer());
|
||||||
if (i == null) {
|
if (i == null) {
|
||||||
useItemSlotHashMap.put(e.getPlayer().getName(), SelectConfig.UseItem_InventorySlot);
|
useItemSlotHashMap.put(e.getPlayer().getName(), SelectConfig.getUseItem_InventorySlot());
|
||||||
} else useItemSlotHashMap.put(e.getPlayer().getName(), i);
|
} else useItemSlotHashMap.put(e.getPlayer().getName(), i);
|
||||||
|
|
||||||
if (CGuiAPI.JoinDisable) {
|
if (CGuiAPI.JoinDisable) {
|
||||||
@@ -65,6 +63,8 @@ public class Events implements Listener {
|
|||||||
useItemHashMap.remove(e.getPlayer().getName());
|
useItemHashMap.remove(e.getPlayer().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onDeathDrop(PlayerDeathEvent e) {
|
public void onDeathDrop(PlayerDeathEvent e) {
|
||||||
Player player = e.getEntity().getPlayer();
|
Player player = e.getEntity().getPlayer();
|
||||||
@@ -74,7 +74,7 @@ public class Events implements Listener {
|
|||||||
while (var3.hasNext()) {
|
while (var3.hasNext()) {
|
||||||
ItemStack items = (ItemStack) var3.next();
|
ItemStack items = (ItemStack) var3.next();
|
||||||
if (items != null && items.hasItemMeta() && items.getItemMeta().hasDisplayName()
|
if (items != null && items.hasItemMeta() && items.getItemMeta().hasDisplayName()
|
||||||
&& items.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& items.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
e.getDrops().remove(items);
|
e.getDrops().remove(items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,10 +84,10 @@ public class Events implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onRespawn(PlayerRespawnEvent e) {
|
public void onRespawn(PlayerRespawnEvent e) {
|
||||||
Player player = e.getPlayer();
|
Player player = e.getPlayer();
|
||||||
if (SelectConfig.UseItem_Enable) {
|
if (SelectConfig.getUseItem_Enable()) {
|
||||||
ItemChange.itemChange(player, false);
|
ItemChange.itemChange(player, false);
|
||||||
//if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
//if (!SelectConfig.getUseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
||||||
// if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
|
// if (SelectConfig.getUseItem_GiveOnlyOnFirstJoin) {
|
||||||
// if (!player.hasPlayedBefore()) {
|
// if (!player.hasPlayedBefore()) {
|
||||||
// new BukkitRunnable() {
|
// new BukkitRunnable() {
|
||||||
// @Override
|
// @Override
|
||||||
@@ -111,7 +111,7 @@ public class Events implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onGameModeChange(PlayerGameModeChangeEvent e) {
|
public void onGameModeChange(PlayerGameModeChangeEvent e) {
|
||||||
Player player = e.getPlayer();
|
Player player = e.getPlayer();
|
||||||
if (!SelectConfig.UseItemGameModeChangeEnable) {
|
if (!SelectConfig.getUseItemGameModeChangeEnable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@@ -119,13 +119,13 @@ public class Events implements Listener {
|
|||||||
public void run() {
|
public void run() {
|
||||||
ItemChange.itemChange(player, false);
|
ItemChange.itemChange(player, false);
|
||||||
}
|
}
|
||||||
}.runTaskLater(Main.plugin, SelectConfig.UseItemGameModeChangeDelayInTicks * 1L);
|
}.runTaskLater(Main.plugin, SelectConfig.getUseItemGameModeChangeDelayInTicks() * 1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onWorldChange(PlayerChangedWorldEvent e) {
|
public void onWorldChange(PlayerChangedWorldEvent e) {
|
||||||
Player player = e.getPlayer();
|
Player player = e.getPlayer();
|
||||||
if (!SelectConfig.UseItemWorldChangeEnable) {
|
if (!SelectConfig.getUseItemWorldChangeEnable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@@ -133,30 +133,30 @@ public class Events implements Listener {
|
|||||||
public void run() {
|
public void run() {
|
||||||
ItemChange.itemChange(player, false);
|
ItemChange.itemChange(player, false);
|
||||||
}
|
}
|
||||||
}.runTaskLater(Main.plugin, SelectConfig.UseItemWorldChangeDelayInTicks * 1L);
|
}.runTaskLater(Main.plugin, SelectConfig.getUseItemWorldChangeDelayInTicks() * 1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onInteract(PlayerInteractEvent e) {
|
public void onInteract(PlayerInteractEvent e) {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
if (!p.isSneaking()) {
|
if (!p.isSneaking()) {
|
||||||
for (String material : SelectConfig.UseItemItemBlockBlacklist) {
|
for (String material : SelectConfig.getUseItemItemBlockBlacklist()) {
|
||||||
if (e.getClickedBlock() != null) {
|
if (e.getClickedBlock() != null) {
|
||||||
if (e.getClickedBlock().getType() == Material.valueOf(material)) return;
|
if (e.getClickedBlock().getType() == Material.valueOf(material)) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SelectConfig.UseItem_Enable) {
|
if (SelectConfig.getUseItem_Enable()) {
|
||||||
if (SelectConfig.UseItem_PlayerHead_Enable) {
|
if (SelectConfig.getUseItem_PlayerHead_Enable()) {
|
||||||
if (e.getItem() != null && p.getItemInHand().getType() == ItemVersion.getHead()) {
|
if (e.getItem() != null && p.getItemInHand().getType() == ItemVersion.getHead()) {
|
||||||
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
openGUI(e, p);
|
openGUI(e, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (e.getItem() != null && p.getItemInHand().getType() == Material.valueOf(SelectConfig.UseItem_Material)) {
|
if (e.getItem() != null && p.getItemInHand().getType() == Material.valueOf(SelectConfig.getUseItem_Material())) {
|
||||||
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
openGUI(e, p);
|
openGUI(e, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ public class Events implements Listener {
|
|||||||
private static void openGUI(PlayerInteractEvent e, Player player) {
|
private static void openGUI(PlayerInteractEvent e, Player player) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
|
||||||
if ((!SelectConfig.disableInfoBySneak) && player.isSneaking()) {
|
if ((!SelectConfig.getDisableInfoBySneak()) && player.isSneaking()) {
|
||||||
Commands.info(player);
|
Commands.info(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -178,45 +178,45 @@ public class Events implements Listener {
|
|||||||
|
|
||||||
if (UseItem.protection(player, true)) return;
|
if (UseItem.protection(player, true)) return;
|
||||||
|
|
||||||
if (SelectConfig.UseItemGameModeProtection) {
|
if (SelectConfig.getUseItemGameModeProtection()) {
|
||||||
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
|
if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
|
if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SelectConfig.UseItemWorldProtection) {
|
if (SelectConfig.getUseItemWorldProtection()) {
|
||||||
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
|
if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
send.player(player, SelectMessages.UseItemDisabledInWorld);
|
send.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
|
if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
send.player(player, SelectMessages.UseItemDisabledInWorld);
|
send.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SelectConfig.UseItem_Permission || player.hasPermission("commandgui.useitem")) {
|
if (!SelectConfig.getUseItem_Permission() || player.hasPermission("commandgui.useitem")) {
|
||||||
OpenGUI.openGUI(player, SelectConfig.UseItem_OpenGUI, true);
|
OpenGUI.openGUI(player, SelectConfig.getUseItem_OpenGUI(), true);
|
||||||
} else {
|
} else {
|
||||||
send.player(player,SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
send.player(player,SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
||||||
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
.replace("[gui]", SelectConfig.getUseItem_OpenGUI()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onItemMoveEvent(InventoryMoveItemEvent e) {
|
public void onItemMoveEvent(InventoryMoveItemEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
|
||||||
if (e.getItem() != null && e.getItem().hasItemMeta() && e.getItem().getItemMeta().hasDisplayName()
|
if (e.getItem() != null && e.getItem().hasItemMeta() && e.getItem().getItemMeta().hasDisplayName()
|
||||||
&& e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,19 +224,19 @@ public class Events implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onItemMove(InventoryDragEvent e) {
|
public void onItemMove(InventoryDragEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
|
||||||
|
|
||||||
if (e.getWhoClicked() instanceof Player) {
|
if (e.getWhoClicked() instanceof Player) {
|
||||||
Player p = (Player) e.getWhoClicked();
|
Player p = (Player) e.getWhoClicked();
|
||||||
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
||||||
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
ItemChange.itemChange(p, false);
|
ItemChange.itemChange(p, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.getOldCursor() != null && e.getOldCursor().hasItemMeta() && e.getOldCursor().getItemMeta().hasDisplayName()
|
if (e.getOldCursor() != null && e.getOldCursor().hasItemMeta() && e.getOldCursor().getItemMeta().hasDisplayName()
|
||||||
&& e.getOldCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getOldCursor().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
ItemChange.itemChange(p, false);
|
ItemChange.itemChange(p, false);
|
||||||
@@ -246,14 +246,14 @@ public class Events implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onItemMove(InventoryClickEvent e) {
|
public void onItemMove(InventoryClickEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
|
||||||
|
|
||||||
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
||||||
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
if (e.getCurrentItem() != null && e.getCurrentItem().hasItemMeta() && e.getCurrentItem().getItemMeta().hasDisplayName()
|
if (e.getCurrentItem() != null && e.getCurrentItem().hasItemMeta() && e.getCurrentItem().getItemMeta().hasDisplayName()
|
||||||
&& e.getCurrentItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getCurrentItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
|
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
@@ -261,12 +261,12 @@ public class Events implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onItemMove(InventoryPickupItemEvent e) {
|
public void onItemMove(InventoryPickupItemEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
|
||||||
|
|
||||||
if (e.getItem() != null && e.getItem().getItemStack() != null) {
|
if (e.getItem() != null && e.getItem().getItemStack() != null) {
|
||||||
ItemStack item = e.getItem().getItemStack();
|
ItemStack item = e.getItem().getItemStack();
|
||||||
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||||
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,22 +274,21 @@ public class Events implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onPlace(BlockPlaceEvent e) {
|
public void onPlace(BlockPlaceEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
|
||||||
|
|
||||||
if (e.getItemInHand() != null && e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().hasDisplayName()
|
if (e.getItemInHand() != null && e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().hasDisplayName()
|
||||||
&& e.getItemInHand().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getItemInHand().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onDrop(PlayerDropItemEvent e) {
|
public void onDrop(PlayerDropItemEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
|
||||||
|
|
||||||
if (e.getItemDrop() != null && e.getItemDrop().getItemStack() != null) {
|
if (e.getItemDrop() != null && e.getItemDrop().getItemStack() != null) {
|
||||||
ItemStack item = e.getItemDrop().getItemStack();
|
ItemStack item = e.getItemDrop().getItemStack();
|
||||||
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||||
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -298,4 +297,54 @@ public class Events implements Listener {
|
|||||||
private static boolean topInventoryIsEmpty(Player p) {
|
private static boolean topInventoryIsEmpty(Player p) {
|
||||||
return p.getOpenInventory().getTopInventory().isEmpty();
|
return p.getOpenInventory().getTopInventory().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onClearServer(ServerCommandEvent event) {
|
||||||
|
if (SelectConfig.getUseItem_KeepAtCommandClear()) {
|
||||||
|
if (event.getCommand().contains("clear " + event.getCommand().replace("/", "").replace("clear ", ""))) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
Player player = Bukkit.getPlayer(event.getCommand().replace("/", "").replace("clear ", ""));
|
||||||
|
if (player == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clearGive(player);
|
||||||
|
} catch (Exception ex){
|
||||||
|
ex.printStackTrace();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.runTaskLater(Main.plugin, 1L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onClearPlayer(PlayerCommandPreprocessEvent event) {
|
||||||
|
if (SelectConfig.getUseItem_KeepAtCommandClear()) {
|
||||||
|
if (event.getMessage().toLowerCase().contains("clear")) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
clearGive(event.getPlayer());
|
||||||
|
}
|
||||||
|
}.runTaskLater(Main.plugin, 1L);
|
||||||
|
}
|
||||||
|
if (event.getMessage().toLowerCase().contains("clear " + event.getMessage().toLowerCase().replace("/", "").replace("clear ", ""))) {
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
clearGive(Bukkit.getPlayer(event.getMessage().toLowerCase().replace("/", "").replace("clear ", "")));
|
||||||
|
}
|
||||||
|
}.runTaskLater(Main.plugin, 1L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void clearGive(Player player) {
|
||||||
|
ItemChange.itemChange(player, false);
|
||||||
|
}
|
||||||
}
|
}
|
@@ -1,4 +1,4 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
package de.jatitv.commandguiv2.Spigot.useItem;
|
||||||
|
|
||||||
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;
|
||||||
@@ -12,29 +12,27 @@ public class EventsFrom110 implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onHandSwap(PlayerSwapHandItemsEvent e) {
|
public void onHandSwap(PlayerSwapHandItemsEvent e) {
|
||||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9) return;
|
if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
|
||||||
if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName()
|
if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName()
|
||||||
&& e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
}
|
}
|
||||||
if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName()
|
if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName()
|
||||||
&& e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onItemMove(PlayerSwapHandItemsEvent e) {
|
public void onItemMove(PlayerSwapHandItemsEvent e) {
|
||||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9) return;
|
if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName()
|
if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName()
|
||||||
&& e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName()
|
if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName()
|
||||||
&& e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
@@ -1,10 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
package de.jatitv.commandguiv2.Spigot.useItem;
|
||||||
|
|
||||||
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.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;
|
||||||
@@ -12,19 +9,19 @@ import org.bukkit.scheduler.BukkitRunnable;
|
|||||||
public class ItemChange {
|
public class ItemChange {
|
||||||
public static void itemChange(Player player, Boolean setCursor) {
|
public static void itemChange(Player player, Boolean setCursor) {
|
||||||
Integer slot;
|
Integer slot;
|
||||||
if (SelectConfig.UseItem_InventorySlotEnforce) {
|
if (SelectConfig.getUseItem_InventorySlotEnforce()) {
|
||||||
slot = SelectConfig.UseItem_InventorySlot;
|
slot = SelectConfig.getUseItem_InventorySlot();
|
||||||
} else {
|
} else {
|
||||||
slot = Events.useItemSlotHashMap.get(player.getName());
|
slot = Events.useItemSlotHashMap.get(player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SelectConfig.UseItem_Enable) {
|
if (!SelectConfig.getUseItem_Enable()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
UseItem.removeItem(player);
|
UseItem.removeItem(player);
|
||||||
if (UseItem.protection(player, false)) return;
|
if (UseItem.protection(player, false)) return;
|
||||||
if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
|
if (SelectConfig.getUseItem_GiveOnlyOnFirstJoin()) {
|
||||||
if (!SelectConfig.UseItem_AllowToggle || Events.useItemHashMap.get(player.getName())) {
|
if (!SelectConfig.getUseItem_AllowToggle() || Events.useItemHashMap.get(player.getName())) {
|
||||||
if (!player.hasPlayedBefore()) {
|
if (!player.hasPlayedBefore()) {
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -35,7 +32,7 @@ public class ItemChange {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.runTaskLater(Main.plugin, 1L * 1);
|
}.runTaskLater(Main.plugin, 1L * 1);
|
||||||
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin || SelectConfig.Cursor_ToGUIItem_OnLogin) {
|
if (SelectConfig.getCursor_ToGUIItem_OnlyOnFirstLogin() || SelectConfig.getCursor_ToGUIItem_OnLogin()) {
|
||||||
player.getInventory().setHeldItemSlot(slot - 1);
|
player.getInventory().setHeldItemSlot(slot - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,21 +40,23 @@ public class ItemChange {
|
|||||||
send.debug(Main.plugin, "GiveOnlyOnFirstJoin: " + player.getName());
|
send.debug(Main.plugin, "GiveOnlyOnFirstJoin: " + player.getName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!SelectConfig.UseItem_GiveOnEveryJoin) {
|
if (!SelectConfig.getUseItem_GiveOnEveryJoin()) {
|
||||||
send.debug(Main.plugin, "!GiveOnEveryJoin: " + player.getName());
|
send.debug(Main.plugin, "!GiveOnEveryJoin: " + player.getName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!SelectConfig.UseItem_AllowToggle || Events.useItemHashMap.get(player.getName())) {
|
Boolean pln = Events.useItemHashMap.get(player.getName());
|
||||||
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(slot - 1) == null) {
|
if (pln == null) return;
|
||||||
|
if (!SelectConfig.getUseItem_AllowToggle() || pln) {
|
||||||
|
if (SelectConfig.getUseItem_InventorySlotEnforce() || player.getInventory().getItem(slot - 1) == null) {
|
||||||
send.debug(Main.plugin, "Give: " + player.getName());
|
send.debug(Main.plugin, "Give: " + player.getName());
|
||||||
UseItem.giveUseItem(player);
|
UseItem.giveUseItem(player);
|
||||||
if (setCursor) {
|
if (setCursor) {
|
||||||
setCursor(player, slot);
|
setCursor(player, slot);
|
||||||
}
|
}
|
||||||
} else if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
} else if (SelectConfig.getUseItem_InventorySlot_FreeSlot()) {
|
||||||
boolean empty = false;
|
boolean empty = false;
|
||||||
for (int i = 0; i < 9; i++) {
|
for (int i = 0; i < 9; i++) {
|
||||||
if (player.getInventory().getItem(i) == null) {
|
if (player.getInventory().getItem(i) == null) {
|
||||||
@@ -78,11 +77,11 @@ public class ItemChange {
|
|||||||
private static void setCursor(Player player, int slot) {
|
private static void setCursor(Player player, int slot) {
|
||||||
send.debug(Main.plugin, "setCursor 1 Player: " + player.getName());
|
send.debug(Main.plugin, "setCursor 1 Player: " + player.getName());
|
||||||
|
|
||||||
if (!SelectConfig.Cursor_ToGUIItem_OnLogin) {
|
if (!SelectConfig.getCursor_ToGUIItem_OnLogin()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send.debug(Main.plugin, "setCursor 2 Player: " + player.getName());
|
send.debug(Main.plugin, "setCursor 2 Player: " + player.getName());
|
||||||
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin) {
|
if (SelectConfig.getCursor_ToGUIItem_OnlyOnFirstLogin()) {
|
||||||
if (!player.hasPlayedBefore()) {
|
if (!player.hasPlayedBefore()) {
|
||||||
player.getInventory().setHeldItemSlot(slot - 1);
|
player.getInventory().setHeldItemSlot(slot - 1);
|
||||||
send.debug(Main.plugin, "setCursor 3 Player: " + player.getName());
|
send.debug(Main.plugin, "setCursor 3 Player: " + player.getName());
|
||||||
@@ -90,13 +89,13 @@ public class ItemChange {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send.debug(Main.plugin, "setCursor 4 Player: " + player.getName());
|
send.debug(Main.plugin, "setCursor 4 Player: " + player.getName());
|
||||||
if (!SelectConfig.Bungee) {
|
if (!SelectConfig.getBungee()) {
|
||||||
player.getInventory().setHeldItemSlot(slot - 1);
|
player.getInventory().setHeldItemSlot(slot - 1);
|
||||||
send.debug(Main.plugin, "setCursor 5 Player: " + player.getName());
|
send.debug(Main.plugin, "setCursor 5 Player: " + player.getName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send.debug(Main.plugin, "setCursor 6 Player: " + player.getName());
|
send.debug(Main.plugin, "setCursor 6 Player: " + player.getName());
|
||||||
if (SelectConfig.UseItem_ServerChange) {
|
if (SelectConfig.getUseItem_ServerChange()) {
|
||||||
player.getInventory().setHeldItemSlot(slot - 1);
|
player.getInventory().setHeldItemSlot(slot - 1);
|
||||||
send.debug(Main.plugin, "setCursor 7 Player: " + player.getName());
|
send.debug(Main.plugin, "setCursor 7 Player: " + player.getName());
|
||||||
return;
|
return;
|
@@ -1,8 +1,8 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system;
|
package de.jatitv.commandguiv2.Spigot.useItem;
|
||||||
|
|
||||||
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.useItem.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;
|
||||||
@@ -21,17 +21,15 @@ import java.lang.reflect.Field;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class UseItem {
|
public class UseItem {
|
||||||
|
|
||||||
|
|
||||||
public static void giveUseItem(Player player) {
|
public static void giveUseItem(Player player) {
|
||||||
Integer slot;
|
Integer slot;
|
||||||
if (protection(player, false)) return;
|
if (protection(player, false)) return;
|
||||||
if (SelectConfig.UseItem_InventorySlotEnforce) {
|
if (SelectConfig.getUseItem_InventorySlotEnforce()) {
|
||||||
slot = SelectConfig.UseItem_InventorySlot;
|
slot = SelectConfig.getUseItem_InventorySlot();
|
||||||
} else {
|
} else {
|
||||||
slot = Events.useItemSlotHashMap.get(player.getName());
|
slot = Events.useItemSlotHashMap.get(player.getName());
|
||||||
}
|
}
|
||||||
if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
if (SelectConfig.getUseItem_InventorySlot_FreeSlot()) {
|
||||||
player.getInventory().addItem(itemStack(player));
|
player.getInventory().addItem(itemStack(player));
|
||||||
} else {
|
} else {
|
||||||
send.debug(Main.plugin, "setUseItem: " + player.getName() + " Slot: " + Integer.parseInt(String.valueOf(slot - 1)));
|
send.debug(Main.plugin, "setUseItem: " + player.getName() + " Slot: " + Integer.parseInt(String.valueOf(slot - 1)));
|
||||||
@@ -41,27 +39,27 @@ public class UseItem {
|
|||||||
|
|
||||||
public static void addUseItem(Player player) {
|
public static void addUseItem(Player player) {
|
||||||
if (protection(player, false)) return;
|
if (protection(player, false)) return;
|
||||||
if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
if (SelectConfig.getUseItem_InventorySlot_FreeSlot()) {
|
||||||
player.getInventory().addItem(itemStack(player));
|
player.getInventory().addItem(itemStack(player));
|
||||||
} else player.getInventory().addItem(itemStack(player));
|
} else player.getInventory().addItem(itemStack(player));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ItemStack itemStack(Player player) {
|
private static ItemStack itemStack(Player player) {
|
||||||
ItemStack item = null;
|
ItemStack item = null;
|
||||||
if (SelectConfig.UseItem_PlayerHead_Enable) {
|
if (SelectConfig.getUseItem_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();
|
||||||
SkullMeta playerheadmeta = (SkullMeta) item.getItemMeta();
|
SkullMeta playerheadmeta = (SkullMeta) item.getItemMeta();
|
||||||
playerheadmeta.setDisplayName(SelectConfig.UseItem_Name);
|
playerheadmeta.setDisplayName(SelectConfig.getUseItem_Name());
|
||||||
if (SelectConfig.UseItem_Base64_Enable) {
|
if (SelectConfig.getUseItem_Base64_Enable()) {
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
|
playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
|
||||||
} else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore));
|
} else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
|
||||||
GameProfile profile = new GameProfile(UUID.randomUUID(), "");
|
GameProfile profile = new GameProfile(UUID.randomUUID(), "");
|
||||||
profile.getProperties().put("textures", new Property("textures", SelectConfig.UseItem_Base64value));
|
profile.getProperties().put("textures", new Property("textures", SelectConfig.getUseItem_Base64value()));
|
||||||
Field profileField = null;
|
Field profileField = null;
|
||||||
try {
|
try {
|
||||||
profileField = playerheadmeta.getClass().getDeclaredField("profile");
|
profileField = playerheadmeta.getClass().getDeclaredField("profile");
|
||||||
@@ -72,23 +70,23 @@ public class UseItem {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String p;
|
String p;
|
||||||
if (SelectConfig.UseItem_PlayerWhoHasOpenedTheGUI) {
|
if (SelectConfig.getUseItem_PlayerWhoHasOpenedTheGUI()) {
|
||||||
p = player.getName();
|
p = player.getName();
|
||||||
} else p = SelectConfig.UseItem_PlayerName;
|
} else p = SelectConfig.getUseItem_PlayerName();
|
||||||
playerheadmeta.setOwner(p);
|
playerheadmeta.setOwner(p);
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
|
playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
|
||||||
} else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore));
|
} else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
|
||||||
}
|
}
|
||||||
item.setItemMeta(playerheadmeta);
|
item.setItemMeta(playerheadmeta);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
item = new ItemStack(Material.valueOf(SelectConfig.UseItem_Material));
|
item = new ItemStack(Material.valueOf(SelectConfig.getUseItem_Material()));
|
||||||
ItemMeta itemMeta = item.getItemMeta();
|
ItemMeta itemMeta = item.getItemMeta();
|
||||||
itemMeta.setDisplayName(SelectConfig.UseItem_Name);
|
itemMeta.setDisplayName(SelectConfig.getUseItem_Name());
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
itemMeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
|
itemMeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
|
||||||
} else itemMeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore));
|
} else itemMeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
|
||||||
item.setItemMeta(itemMeta);
|
item.setItemMeta(itemMeta);
|
||||||
item.setAmount(1);
|
item.setAmount(1);
|
||||||
}
|
}
|
||||||
@@ -96,31 +94,31 @@ public class UseItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean protection(Player player, Boolean interact) {
|
public static boolean protection(Player player, Boolean interact) {
|
||||||
if (SelectConfig.UseItemGameModeProtection) {
|
if (SelectConfig.getUseItemGameModeProtection()) {
|
||||||
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
|
if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
|
||||||
if (interact) {
|
if (interact) {
|
||||||
send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||||
} else if (!SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled) removeItem(player);
|
} else if (!SelectConfig.getUseItemGameModeRemoveItemWhenItIsDisabled()) removeItem(player);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
|
if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
|
||||||
if (interact) {
|
if (interact) {
|
||||||
send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||||
} else if (!SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled) removeItem(player);
|
} else if (!SelectConfig.getUseItemGameModeRemoveItemWhenItIsDisabled()) removeItem(player);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SelectConfig.UseItemWorldProtection) {
|
if (SelectConfig.getUseItemWorldProtection()) {
|
||||||
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
|
if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
|
||||||
if (interact) {
|
if (interact) {
|
||||||
send.player(player, SelectMessages.UseItemDisabledInWorld);
|
send.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||||
} else if (!SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled) removeItem(player);
|
} else if (!SelectConfig.getUseItemWorldRemoveItemWhenItIsDisabled()) removeItem(player);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
|
if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
|
||||||
if (interact) {
|
if (interact) {
|
||||||
send.player(player, SelectMessages.UseItemDisabledInWorld);
|
send.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||||
} else if (!SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled) removeItem(player);
|
} else if (!SelectConfig.getUseItemWorldRemoveItemWhenItIsDisabled()) removeItem(player);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,8 +130,8 @@ public class UseItem {
|
|||||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||||
ItemStack itm = player.getInventory().getItem(iam);
|
ItemStack itm = player.getInventory().getItem(iam);
|
||||||
if (itm != null) {
|
if (itm != null) {
|
||||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
|
if (itm.getType() == Material.valueOf(SelectConfig.getUseItem_Material()) || itm.getType() == ItemVersion.getHead()) {
|
||||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||||
player.getInventory().remove(itm);
|
player.getInventory().remove(itm);
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
break;
|
break;
|
@@ -1,16 +1,14 @@
|
|||||||
package de.jatitv.commandguiv2;
|
package de.jatitv.commandguiv2;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import net.t2code.lib.Spigot.system.T2CodeMain;
|
||||||
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.9;
|
private static double requiredT2CodeLibVersion = 12.1;
|
||||||
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;
|
||||||
private static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID;
|
private static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID;
|
||||||
private static String Discord = "http://dc.t2code.net";
|
|
||||||
|
|
||||||
public static double getRequiredT2CodeLibVersion() {
|
public static double getRequiredT2CodeLibVersion() {
|
||||||
return requiredT2CodeLibVersion;
|
return requiredT2CodeLibVersion;
|
||||||
@@ -33,14 +31,10 @@ public class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getDiscord() {
|
public static String getDiscord() {
|
||||||
return Discord;
|
return T2CodeMain.getDiscord();
|
||||||
}
|
}
|
||||||
|
|
||||||
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.useItem.ItemChange;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.useItem.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;
|
||||||
@@ -9,7 +9,8 @@ import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
|
|||||||
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;
|
||||||
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.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;
|
||||||
@@ -25,13 +26,13 @@ public class CGuiAPI {
|
|||||||
public static boolean hasUseItemInMainHand(Player player) {
|
public static boolean hasUseItemInMainHand(Player player) {
|
||||||
ItemStack item = player.getInventory().getItemInMainHand();
|
ItemStack item = player.getInventory().getItemInMainHand();
|
||||||
return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||||
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name);
|
&& item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasUseItemInOffHand(Player player) {
|
public static boolean hasUseItemInOffHand(Player player) {
|
||||||
ItemStack item = player.getInventory().getItemInOffHand();
|
ItemStack item = player.getInventory().getItemInOffHand();
|
||||||
return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||||
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name);
|
&& item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onItemChange(Player player, Boolean setCursor) {
|
public static void onItemChange(Player player, Boolean setCursor) {
|
||||||
@@ -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) {
|
||||||
|
@@ -4,13 +4,8 @@ main: de.jatitv.commandguiv2.Spigot.Main
|
|||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
prefix: CommandGUI
|
prefix: CommandGUI
|
||||||
authors: [ JaTiTV ]
|
authors: [ JaTiTV ]
|
||||||
|
depend:
|
||||||
softdepend:
|
|
||||||
- T2CodeLib
|
- T2CodeLib
|
||||||
- Vault
|
|
||||||
- PlaceholderAPI
|
|
||||||
- PlotSquaredGUI
|
|
||||||
- PlugManGUI
|
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
commandgui:
|
commandgui:
|
||||||
@@ -20,4 +15,4 @@ commands:
|
|||||||
description: CommandGUI Help
|
description: CommandGUI Help
|
||||||
aliases: [cguihelp, guihelp]
|
aliases: [cguihelp, guihelp]
|
||||||
commandgui-item:
|
commandgui-item:
|
||||||
aliases: [gui-item]
|
aliases: [gui-item, useitem]
|
Reference in New Issue
Block a user