Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
7808a3bf6e | |||
f1e1c0de57 | |||
c4525a0055 | |||
7e81c3403d | |||
|
cb5f8a7350 | ||
811d6a7a9d | |||
88bdac1fc8 | |||
|
2e29bfb270 | ||
89030215a1 | |||
b212b68f67 | |||
|
ee587742d1 | ||
908e137943 | |||
47c2329ff9 | |||
75ab60bbaa | |||
8377667f55 | |||
7afbdd695c | |||
91f8d744cc | |||
b80eaa08be | |||
b36fdc2d67 | |||
35c277ba3b |
@@ -2,8 +2,8 @@
|
|||||||
name: Question
|
name: Question
|
||||||
about: Ask a question or get advice
|
about: Ask a question or get advice
|
||||||
title: ''
|
title: ''
|
||||||
labels: question
|
labels:
|
||||||
assignees: ''
|
- question
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>CommandGUI_V2</artifactId>
|
<artifactId>CommandGUI_V2</artifactId>
|
||||||
<version>2.5.16</version>
|
<version>2.5.21</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CommandGUI</name>
|
<name>CommandGUI</name>
|
||||||
@@ -81,7 +81,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>8</version>
|
<version>10.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.t2code</groupId>
|
||||||
|
<artifactId>LuckyBox-API</artifactId>
|
||||||
|
<version>4.2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.t2code.minecraft.1_18.r1</groupId>
|
<groupId>net.t2code.minecraft.1_18.r1</groupId>
|
||||||
|
@@ -1,86 +0,0 @@
|
|||||||
GUI:
|
|
||||||
Enable: true
|
|
||||||
Lines: 1
|
|
||||||
Name: '&5default &9GUI'
|
|
||||||
FillItem:
|
|
||||||
Enable: true
|
|
||||||
Item: BLACK_STAINED_GLASS_PANE
|
|
||||||
Command:
|
|
||||||
Alias: true
|
|
||||||
Permission:
|
|
||||||
Required: true
|
|
||||||
Slots:
|
|
||||||
Example:
|
|
||||||
Slot: 5
|
|
||||||
Enable: true
|
|
||||||
Item:
|
|
||||||
Empty: false
|
|
||||||
Amount: 1
|
|
||||||
PlayerHead:
|
|
||||||
Enable: true
|
|
||||||
Base64:
|
|
||||||
Enable: true
|
|
||||||
Base64Value: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19
|
|
||||||
PlayerWhoHasOpenedTheGUI: false
|
|
||||||
PlayerName: ''
|
|
||||||
Material: ''
|
|
||||||
Name: '&3Support Discord'
|
|
||||||
Lore:
|
|
||||||
- '&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: §7https://discord.gg/vRyXFFterJ'
|
|
||||||
CustomSound:
|
|
||||||
Enable: false
|
|
||||||
NoSound: false
|
|
||||||
Sound: ''
|
|
||||||
Cost:
|
|
||||||
Enable: false
|
|
||||||
Price: 0.0
|
|
||||||
Command:
|
|
||||||
Enable: false
|
|
||||||
BungeeCommand: false
|
|
||||||
CommandAsConsole: false
|
|
||||||
Command:
|
|
||||||
- ''
|
|
||||||
OpenGUI:
|
|
||||||
Enable: false
|
|
||||||
GUI: ''
|
|
||||||
Message:
|
|
||||||
Enable: true
|
|
||||||
Message:
|
|
||||||
- '&6You can find more information on Discord: &ehttps://discord.gg/vRyXFFterJ'
|
|
||||||
Permission:
|
|
||||||
Required: false
|
|
||||||
ServerChange:
|
|
||||||
Enable: false
|
|
||||||
Server: ''
|
|
||||||
SetConfig:
|
|
||||||
Enable: false
|
|
||||||
File:
|
|
||||||
Path: ''
|
|
||||||
Option:
|
|
||||||
Path: ''
|
|
||||||
Premat: String
|
|
||||||
Value:
|
|
||||||
LeftClick:
|
|
||||||
ChatInput: false
|
|
||||||
String: ''
|
|
||||||
Boolean: false
|
|
||||||
Integer: 0
|
|
||||||
Double: 0.0
|
|
||||||
List: []
|
|
||||||
RightClick:
|
|
||||||
ChatInput: false
|
|
||||||
String: ''
|
|
||||||
Boolean: false
|
|
||||||
Integer: 0
|
|
||||||
Double: 0.0
|
|
||||||
List: []
|
|
||||||
PluginReload:
|
|
||||||
Enable: false
|
|
||||||
Command: ''
|
|
@@ -3,54 +3,37 @@ package de.jatitv.commandguiv2.Bungee;
|
|||||||
import net.md_5.bungee.config.Configuration;
|
import net.md_5.bungee.config.Configuration;
|
||||||
import net.md_5.bungee.config.ConfigurationProvider;
|
import net.md_5.bungee.config.ConfigurationProvider;
|
||||||
import net.md_5.bungee.config.YamlConfiguration;
|
import net.md_5.bungee.config.YamlConfiguration;
|
||||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
|
||||||
import net.t2code.lib.Util;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
|
|
||||||
public class BConfig {
|
public class BConfig {
|
||||||
|
|
||||||
public static void create() {
|
public static void create() throws IOException {
|
||||||
|
File config = new File(BMain.plugin.getDataFolder(), "config.yml");
|
||||||
if (!BMain.plugin.getDataFolder().exists())
|
if (!BMain.plugin.getDataFolder().exists()) BMain.plugin.getDataFolder().mkdir();
|
||||||
BMain.plugin.getDataFolder().mkdir();
|
if (!config.exists()) {
|
||||||
|
config.createNewFile();
|
||||||
File file = new File(BMain.plugin.getDataFolder(), "config.yml");
|
|
||||||
|
|
||||||
|
|
||||||
if (!file.exists()) {
|
|
||||||
try (InputStream in = BMain.plugin.getResourceAsStream("config.yml")) {
|
|
||||||
Files.copy(in, file.toPath());
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Configuration configuration;
|
|
||||||
try {
|
|
||||||
configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(BMain.plugin.getDataFolder(), "config.yml"));
|
|
||||||
BMySQL.Enable = configuration.getBoolean("MySQL.Enable");
|
|
||||||
} catch (IOException e) {
|
|
||||||
Bsend.console(Util.Prefix + " Please replace the config: MySQL.Enable: [false,true]");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(BMain.plugin.getDataFolder(), "config.yml"));
|
|
||||||
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");
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
|
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");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -34,20 +34,24 @@ public class BListener implements Listener {
|
|||||||
public void onJoin(PostLoginEvent e) {
|
public void onJoin(PostLoginEvent e) {
|
||||||
ProxiedPlayer player = e.getPlayer();
|
ProxiedPlayer player = e.getPlayer();
|
||||||
sendToSpigotPlayer(player.getName(), true);
|
sendToSpigotPlayer(player.getName(), true);
|
||||||
|
/*
|
||||||
if (BMySQL.Enable) {
|
if (BMySQL.Enable) {
|
||||||
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||||
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'true';");
|
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'true';");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onDisconnect(PlayerDisconnectEvent e) {
|
public void onDisconnect(PlayerDisconnectEvent e) {
|
||||||
ProxiedPlayer player = e.getPlayer();
|
ProxiedPlayer player = e.getPlayer();
|
||||||
sendToSpigotPlayer(e.getPlayer().getName(), false);
|
sendToSpigotPlayer(e.getPlayer().getName(), false);
|
||||||
|
/*
|
||||||
if (BMySQL.Enable) {
|
if (BMySQL.Enable) {
|
||||||
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||||
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'false';");
|
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'false';");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +69,8 @@ public class BListener implements Listener {
|
|||||||
Logger.getLogger(e.getMessage());
|
Logger.getLogger(e.getMessage());
|
||||||
}
|
}
|
||||||
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||||
server.sendData("cgui:onlineplayers", stream.toByteArray());
|
|
||||||
|
server.sendData("cgui:onlinepl", stream.toByteArray());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +84,7 @@ public class BListener implements Listener {
|
|||||||
Logger.getLogger(e.getMessage());
|
Logger.getLogger(e.getMessage());
|
||||||
}
|
}
|
||||||
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||||
server.sendData("cgui:onlineplayers", stream.toByteArray());
|
server.sendData("cgui:onlinepl", stream.toByteArray());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,7 +5,7 @@ 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.util.Objects;
|
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 {
|
||||||
@@ -29,7 +29,7 @@ public final class BMain extends Plugin {
|
|||||||
plugin = this;
|
plugin = this;
|
||||||
autor = plugin.getDescription().getAuthor();
|
autor = plugin.getDescription().getAuthor();
|
||||||
version = plugin.getDescription().getVersion();
|
version = plugin.getDescription().getVersion();
|
||||||
if (pluginNotFound("T2CodeLib", 96388, Util.requiredT2CodeLibVersion)) return;
|
if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
|
||||||
Bsend.console(prefix + "§4============================= §8[§4Command§9GUI§5BUNGEE§8] §4=============================");
|
Bsend.console(prefix + "§4============================= §8[§4Command§9GUI§5BUNGEE§8] §4=============================");
|
||||||
Bsend.console(prefix + "§4 _____ §9_____ _ _ _____ §e ___ ");
|
Bsend.console(prefix + "§4 _____ §9_____ _ _ _____ §e ___ ");
|
||||||
Bsend.console(prefix + "§4 / ____§9/ ____| | | |_ _|§e |__ \\ ");
|
Bsend.console(prefix + "§4 / ____§9/ ____| | | |_ _|§e |__ \\ ");
|
||||||
@@ -42,13 +42,18 @@ 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);
|
||||||
BConfig.create();
|
/* 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 metrics = new BMetrics(this, bstatsID);
|
||||||
|
|
||||||
|
/*
|
||||||
if (BMySQL.Enable){
|
if (BMySQL.Enable){
|
||||||
BMySQL.main();
|
BMySQL.main();
|
||||||
BMySQL.query("CREATE TABLE IF NOT EXISTS `gui-bungeeplayer` (" +
|
BMySQL.query("CREATE TABLE IF NOT EXISTS `gui-bungeeplayer` (" +
|
||||||
@@ -60,8 +65,8 @@ public final class BMain extends Plugin {
|
|||||||
"COLLATE='utf8mb4_general_ci'" +
|
"COLLATE='utf8mb4_general_ci'" +
|
||||||
"ENGINE=InnoDB" +
|
"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==============================================================================");
|
||||||
@@ -86,7 +91,6 @@ public final class BMain extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) {
|
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) {
|
||||||
|
|
||||||
if (ProxyServer.getInstance().getPluginManager().getPlugin(pl) == null) {
|
if (ProxyServer.getInstance().getPluginManager().getPlugin(pl) == null) {
|
||||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||||
ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||||
|
@@ -27,13 +27,12 @@ public class BUpdateChecker {
|
|||||||
public static void sendUpdateMsg(String Prefix, String foundVersion, String update_version) {
|
public static void sendUpdateMsg(String Prefix, String foundVersion, String update_version) {
|
||||||
Bsend.console("§4=========== " + Prefix + " §4===========");
|
Bsend.console("§4=========== " + Prefix + " §4===========");
|
||||||
Bsend.console("§6A new version was found!");
|
Bsend.console("§6A new version was found!");
|
||||||
Bsend.console("§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version+"_Bungee");
|
Bsend.console("§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version);
|
||||||
Bsend.console("§6You can download it here: §e" + BMain.spigot);
|
Bsend.console("§6You can download it here: §e" + BMain.spigot);
|
||||||
Bsend.console("§6You can find more information on Discord: §e" + BMain.discord);
|
Bsend.console("§6You can find more information on Discord: §e" + BMain.discord);
|
||||||
Bsend.console("§4=========== " + Prefix + " §4===========");
|
Bsend.console("§4=========== " + Prefix + " §4===========");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void onUpdateCheckTimer() {
|
public static void onUpdateCheckTimer() {
|
||||||
ProxyServer.getInstance().getScheduler().schedule(BMain.plugin, new Runnable() {
|
ProxyServer.getInstance().getScheduler().schedule(BMain.plugin, new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@@ -2,16 +2,16 @@ package de.jatitv.commandguiv2.Spigot.Listener;
|
|||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
|
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Bungee_Sender_Reciver;
|
import de.jatitv.commandguiv2.Spigot.system.Bungee_Sender_Reciver;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.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.Util;
|
||||||
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 net.t2code.lib.Spigot.Lib.vault.Vault;
|
||||||
import net.t2code.lib.Util;
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
@@ -19,6 +19,7 @@ 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;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.ClickType;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
@@ -28,7 +29,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
public class GUI_Listener implements Listener {
|
public class GUI_Listener implements Listener {
|
||||||
|
|
||||||
private static String prefix = Util.Prefix;
|
private static String prefix = Util.getPrefix();
|
||||||
public static String GUICode;
|
public static String GUICode;
|
||||||
private static Plugin plugin = Main.plugin;
|
private static Plugin plugin = Main.plugin;
|
||||||
|
|
||||||
@@ -145,7 +146,7 @@ public class GUI_Listener implements Listener {
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
*/
|
*/
|
||||||
if (e.isLeftClick()) {
|
if (e.getClick() == ClickType.LEFT) {
|
||||||
if (slot.ConfigOptionPremat.equals("String")) {
|
if (slot.ConfigOptionPremat.equals("String")) {
|
||||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueLeft);
|
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueLeft);
|
||||||
} else if (slot.ConfigOptionPremat.equals("Boolean")) {
|
} else if (slot.ConfigOptionPremat.equals("Boolean")) {
|
||||||
@@ -160,7 +161,7 @@ public class GUI_Listener implements Listener {
|
|||||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e.isRightClick()) {
|
if (e.getClick() == ClickType.RIGHT) {
|
||||||
if (slot.ConfigOptionPremat.equals("String")) {
|
if (slot.ConfigOptionPremat.equals("String")) {
|
||||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueRight);
|
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueRight);
|
||||||
} else if (slot.ConfigOptionPremat.equals("Boolean")) {
|
} else if (slot.ConfigOptionPremat.equals("Boolean")) {
|
||||||
|
@@ -2,7 +2,7 @@ package de.jatitv.commandguiv2.Spigot.Listener;
|
|||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Give_UseItem;
|
import de.jatitv.commandguiv2.Spigot.system.Give_UseItem;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||||
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;
|
||||||
@@ -12,9 +12,9 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.scheduler.BukkitRunnable;
|
import org.bukkit.scheduler.BukkitRunnable;
|
||||||
|
|
||||||
public class ItemChange {
|
public class ItemChange {
|
||||||
public static void itemChange(Player player) {
|
public static void itemChange(Player player, Boolean setCursor) {
|
||||||
Integer slot;
|
Integer slot;
|
||||||
if (SelectConfig.UseItem_InventorySlotEnforce){
|
if (SelectConfig.UseItem_InventorySlotEnforce) {
|
||||||
slot = SelectConfig.UseItem_InventorySlot;
|
slot = SelectConfig.UseItem_InventorySlot;
|
||||||
} else {
|
} else {
|
||||||
if (Select_Database.selectSlot(player) == null) {
|
if (Select_Database.selectSlot(player) == null) {
|
||||||
@@ -27,6 +27,26 @@ public class ItemChange {
|
|||||||
if (!SelectConfig.UseItem_Enable) {
|
if (!SelectConfig.UseItem_Enable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (SelectConfig.UseItemGameModeProtection) {
|
||||||
|
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
|
||||||
|
if (SelectConfig.UseItemGameModeRemoveItemWhenItIsDisabled) removeItem(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
|
||||||
|
if (SelectConfig.UseItemGameModeRemoveItemWhenItIsDisabled) removeItem(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (SelectConfig.UseItemWorldProtection) {
|
||||||
|
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
|
||||||
|
if (SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled)removeItem(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
|
||||||
|
if (SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled)removeItem(player);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
|
if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
|
||||||
if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
||||||
if (!player.hasPlayedBefore()) {
|
if (!player.hasPlayedBefore()) {
|
||||||
@@ -34,6 +54,9 @@ public class ItemChange {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Give_UseItem.onGive(player);
|
Give_UseItem.onGive(player);
|
||||||
|
if (setCursor) {
|
||||||
|
setCursor(player, slot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.runTaskLater(Main.plugin, 1L * 1);
|
}.runTaskLater(Main.plugin, 1L * 1);
|
||||||
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin || SelectConfig.Cursor_ToGUIItem_OnLogin) {
|
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin || SelectConfig.Cursor_ToGUIItem_OnLogin) {
|
||||||
@@ -43,58 +66,86 @@ public class ItemChange {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (SelectConfig.UseItem_GiveOnEveryJoin) {
|
if (!SelectConfig.UseItem_GiveOnEveryJoin) {
|
||||||
new BukkitRunnable() {
|
return;
|
||||||
@Override
|
}
|
||||||
public void run() {
|
new BukkitRunnable() {
|
||||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
@Override
|
||||||
ItemStack itm = player.getInventory().getItem(iam);
|
public void run() {
|
||||||
if (itm != null) {
|
removeItem(player);
|
||||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
|
if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
||||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(slot - 1) == null) {
|
||||||
player.getInventory().remove(itm);
|
Give_UseItem.onGive(player);
|
||||||
player.updateInventory();
|
if (setCursor) {
|
||||||
break;
|
setCursor(player, slot);
|
||||||
}
|
}
|
||||||
|
} else if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
||||||
|
boolean empty = false;
|
||||||
|
for (int i = 0; i < 9; i++) {
|
||||||
|
if (player.getInventory().getItem(i) == null) {
|
||||||
|
empty = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (empty) {
|
||||||
if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
Give_UseItem.onGiveADD(player);
|
||||||
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(slot - 1) == null) {
|
|
||||||
Give_UseItem.onGive(player);
|
|
||||||
if (SelectConfig.Cursor_ToGUIItem_OnLogin) {
|
|
||||||
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin) {
|
|
||||||
if (!player.hasPlayedBefore()) {
|
|
||||||
player.getInventory().setHeldItemSlot(slot - 1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (SelectConfig.Bungee) {
|
|
||||||
if (SelectConfig.UseItem_ServerChange) {
|
|
||||||
player.getInventory().setHeldItemSlot(slot - 1);
|
|
||||||
} else {
|
|
||||||
if (Main.bungeejoinplayers.contains(player.getName())) {
|
|
||||||
player.getInventory().setHeldItemSlot(slot - 1);
|
|
||||||
Main.bungeejoinplayers.remove(player.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else player.getInventory().setHeldItemSlot(slot - 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
|
||||||
boolean empty = false;
|
|
||||||
for (int i = 0; i < 9; i++) {
|
|
||||||
if (player.getInventory().getItem(i) == null) {
|
|
||||||
empty = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (empty) {
|
|
||||||
Give_UseItem.onGiveADD(player);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}.runTaskLater(Main.plugin, 1L * 1);
|
}
|
||||||
|
}.runTaskLater(Main.plugin, 1L * 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setCursor(Player player, int slot) {
|
||||||
|
send.debug(Main.plugin,"setCursor 1 Player: "+player.getName());
|
||||||
|
|
||||||
|
if (!SelectConfig.Cursor_ToGUIItem_OnLogin) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
send.debug(Main.plugin,"setCursor 2 Player: "+player.getName());
|
||||||
|
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin) {
|
||||||
|
if (!player.hasPlayedBefore()) {
|
||||||
|
player.getInventory().setHeldItemSlot(slot - 1);
|
||||||
|
send.debug(Main.plugin,"setCursor 3 Player: "+player.getName());
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
send.debug(Main.plugin,"setCursor 4 Player: "+player.getName());
|
||||||
|
if (!SelectConfig.Bungee) {
|
||||||
|
player.getInventory().setHeldItemSlot(slot - 1);
|
||||||
|
send.debug(Main.plugin,"setCursor 5 Player: "+player.getName());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
send.debug(Main.plugin,"setCursor 6 Player: "+player.getName());
|
||||||
|
if (SelectConfig.UseItem_ServerChange) {
|
||||||
|
player.getInventory().setHeldItemSlot(slot - 1);
|
||||||
|
send.debug(Main.plugin,"setCursor 7 Player: "+player.getName());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
send.debug(Main.plugin,"setCursor 8 Player: "+player.getName());
|
||||||
|
send.debug(Main.plugin,"setCursor bungeejoinplayers: " +Main.bungeejoinplayers);
|
||||||
|
send.debug(Main.plugin,"setCursor Player: " +player.getName());
|
||||||
|
if (Main.bungeejoinplayers.contains(player.getName())) {
|
||||||
|
player.getInventory().setHeldItemSlot(slot - 1);
|
||||||
|
send.debug(Main.plugin,"setCursor 9 Player: "+player.getName());
|
||||||
|
Main.bungeejoinplayers.remove(player.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void removeItem(Player player) {
|
||||||
|
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||||
|
ItemStack itm = player.getInventory().getItem(iam);
|
||||||
|
if (itm != null) {
|
||||||
|
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
|
||||||
|
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||||
|
player.getInventory().remove(itm);
|
||||||
|
player.updateInventory();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,8 +3,9 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
package de.jatitv.commandguiv2.Spigot.Listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||||
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -22,7 +23,7 @@ public class PluginEvent implements Listener {
|
|||||||
public void onJoinEvent(PlayerLoginEvent event) {
|
public void onJoinEvent(PlayerLoginEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Select_Database.nameCheck(player);
|
Select_Database.nameCheck(player);
|
||||||
UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Main.spigot, Main.discord);
|
UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -73,6 +74,6 @@ public class PluginEvent implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void clearGive(Player player) {
|
private static void clearGive(Player player) {
|
||||||
ItemChange.itemChange(player);
|
ItemChange.itemChange(player, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -3,13 +3,14 @@ package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
|||||||
import de.jatitv.commandguiv2.Spigot.Listener.ItemChange;
|
import de.jatitv.commandguiv2.Spigot.Listener.ItemChange;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||||
import de.jatitv.commandguiv2.api.CGuiAPI;
|
import de.jatitv.commandguiv2.api.CGuiAPI;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
|
||||||
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.minecraftVersion.MCVersion;
|
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||||
import org.bukkit.GameMode;
|
|
||||||
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;
|
||||||
@@ -32,12 +33,16 @@ public class Events implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoin(PlayerJoinEvent e) {
|
public void onJoin(PlayerJoinEvent e) {
|
||||||
if (CGuiAPI.JoinDisable) return;
|
if (CGuiAPI.JoinDisable) {
|
||||||
|
send.debug(Main.plugin,"JoinDisable");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (e.getPlayer().hasPermission("commandgui.get.guiitem.at.login")) {
|
if (e.getPlayer().hasPermission("commandgui.get.guiitem.at.login")) {
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
ItemChange.itemChange(e.getPlayer());
|
send.debug(Main.plugin,"itemChange: " + e.getPlayer().getName());
|
||||||
|
ItemChange.itemChange(e.getPlayer(), true);
|
||||||
}
|
}
|
||||||
}.runTaskLater(Main.plugin, 20L * 1);
|
}.runTaskLater(Main.plugin, 20L * 1);
|
||||||
}
|
}
|
||||||
@@ -74,7 +79,7 @@ public class Events implements Listener {
|
|||||||
public void onRespawn(PlayerRespawnEvent e) {
|
public void onRespawn(PlayerRespawnEvent e) {
|
||||||
Player player = e.getPlayer();
|
Player player = e.getPlayer();
|
||||||
if (SelectConfig.UseItem_Enable) {
|
if (SelectConfig.UseItem_Enable) {
|
||||||
ItemChange.itemChange(player);
|
ItemChange.itemChange(player, false);
|
||||||
//if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
//if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
||||||
// if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
|
// if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
|
||||||
// if (!player.hasPlayedBefore()) {
|
// if (!player.hasPlayedBefore()) {
|
||||||
@@ -100,31 +105,32 @@ 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) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (SelectConfig.UseItemGameModeChangeDisableInSpectator) {
|
ItemChange.itemChange(player, false);
|
||||||
if (player.getGameMode() != GameMode.SPECTATOR) {
|
|
||||||
ItemChange.itemChange(player);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
|
||||||
ItemStack itm = player.getInventory().getItem(iam);
|
|
||||||
if (itm != null) {
|
|
||||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
|
|
||||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
|
||||||
player.getInventory().remove(itm);
|
|
||||||
player.updateInventory();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else ItemChange.itemChange(player);
|
|
||||||
}
|
}
|
||||||
}.runTaskLater(Main.plugin, 1L);
|
}.runTaskLater(Main.plugin, SelectConfig.UseItemGameModeChangeDelayInTicks * 1L);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onWorldChange(PlayerChangedWorldEvent e) {
|
||||||
|
Player player = e.getPlayer();
|
||||||
|
if (!SelectConfig.UseItemWorldChangeEnable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
new BukkitRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
ItemChange.itemChange(player, false);
|
||||||
|
}
|
||||||
|
}.runTaskLater(Main.plugin, SelectConfig.UseItemWorldChangeDelayInTicks * 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();
|
||||||
@@ -132,51 +138,64 @@ public class Events implements Listener {
|
|||||||
if (SelectConfig.UseItem_PlayerHead_Enable) {
|
if (SelectConfig.UseItem_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.UseItem_Name)) {
|
||||||
e.setCancelled(true);
|
openGUI(e, p);
|
||||||
if (p.isSneaking()) {
|
|
||||||
Commands.info(p);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!legacy()) {
|
|
||||||
if (!topInventoryIsEmpty(p)) return;
|
|
||||||
}
|
|
||||||
if (!SelectConfig.UseItem_Permission || p.hasPermission("commandgui.useitem")) {
|
|
||||||
OpenGUI.openGUI(p, Main.guiHashMap.get(SelectConfig.UseItem_OpenGUI), SelectConfig.UseItem_OpenGUI);
|
|
||||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
|
||||||
p.playSound(p.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
p.sendMessage(SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
|
||||||
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (e.getItem() != null && p.getItemInHand().getType() == Material.valueOf(SelectConfig.UseItem_Material)) {
|
if (e.getItem() != null && p.getItemInHand().getType() == Material.valueOf(SelectConfig.UseItem_Material)) {
|
||||||
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||||
e.setCancelled(true);
|
openGUI(e, p);
|
||||||
if (p.isSneaking()) {
|
|
||||||
Commands.info(p);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!legacy()) {
|
|
||||||
if (!topInventoryIsEmpty(p)) return;
|
|
||||||
}
|
|
||||||
if (!SelectConfig.UseItem_Permission || p.hasPermission("commandgui.useitem")) {
|
|
||||||
OpenGUI.openGUI(p, Main.guiHashMap.get(SelectConfig.UseItem_OpenGUI), SelectConfig.UseItem_OpenGUI);
|
|
||||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
|
||||||
p.playSound(p.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
p.sendMessage(SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
|
||||||
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void openGUI(PlayerInteractEvent e, Player p) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
|
||||||
|
if (p.isSneaking()) {
|
||||||
|
Commands.info(p);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!legacy()) {
|
||||||
|
if (!topInventoryIsEmpty(p)) return;
|
||||||
|
}
|
||||||
|
if (SelectConfig.UseItemGameModeProtection) {
|
||||||
|
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(p.getGameMode().toString())) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
send.player(p, SelectMessages.UseItemDisabledInGameMode);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemGameModeList.contains(p.getGameMode().toString())) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
send.player(p, SelectMessages.UseItemDisabledInGameMode);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (SelectConfig.UseItemWorldProtection) {
|
||||||
|
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(p.getWorld().getName())) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
send.player(p, SelectMessages.UseItemDisabledInWorld);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemWorldList.contains(p.getWorld().getName())) {
|
||||||
|
e.setCancelled(true);
|
||||||
|
send.player(p, SelectMessages.UseItemDisabledInWorld);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!SelectConfig.UseItem_Permission || p.hasPermission("commandgui.useitem")) {
|
||||||
|
OpenGUI.openGUI(p, Main.guiHashMap.get(SelectConfig.UseItem_OpenGUI), SelectConfig.UseItem_OpenGUI);
|
||||||
|
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
||||||
|
p.playSound(p.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
p.sendMessage(SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
||||||
|
.replace("[gui]", SelectConfig.UseItem_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.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||||
@@ -197,14 +216,14 @@ public class Events implements Listener {
|
|||||||
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
ItemChange.itemChange(p);
|
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.UseItem_Name)) {
|
||||||
p.closeInventory();
|
p.closeInventory();
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
ItemChange.itemChange(p);
|
ItemChange.itemChange(p, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.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;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
@@ -18,7 +18,6 @@ import java.util.logging.Logger;
|
|||||||
|
|
||||||
public final class Main extends JavaPlugin {
|
public final class Main extends JavaPlugin {
|
||||||
|
|
||||||
public static ArrayList<String> bungeeplayers = new ArrayList<>();
|
|
||||||
public static ArrayList<String> bungeejoinplayers = new ArrayList<>();
|
public static ArrayList<String> bungeejoinplayers = new ArrayList<>();
|
||||||
|
|
||||||
public static File getPath() {
|
public static File getPath() {
|
||||||
@@ -32,10 +31,6 @@ public final class Main extends JavaPlugin {
|
|||||||
public static String version;
|
public static String version;
|
||||||
|
|
||||||
public static List<String> autor;
|
public static List<String> autor;
|
||||||
public static Integer spigotID = Util.SpigotID;
|
|
||||||
public static Integer bstatsID = Util.BstatsID;
|
|
||||||
public static String spigot = Util.Spigot;
|
|
||||||
public static String discord = Util.Discord;
|
|
||||||
|
|
||||||
public static Main plugin;
|
public static Main plugin;
|
||||||
public static List plugins;
|
public static List plugins;
|
||||||
@@ -43,6 +38,7 @@ public final class Main extends JavaPlugin {
|
|||||||
public static String update_version = null;
|
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 PlugManGUI = false;
|
public static Boolean PlugManGUI = false;
|
||||||
|
|
||||||
public static HashMap<String, Object> guiHashMap = new HashMap<>();
|
public static HashMap<String, Object> guiHashMap = new HashMap<>();
|
||||||
@@ -57,22 +53,25 @@ public final class Main extends JavaPlugin {
|
|||||||
plugin = this;
|
plugin = this;
|
||||||
autor = plugin.getDescription().getAuthors();
|
autor = plugin.getDescription().getAuthors();
|
||||||
version = plugin.getDescription().getVersion();
|
version = plugin.getDescription().getVersion();
|
||||||
if (pluginNotFound("T2CodeLib", 96388, Util.requiredT2CodeLibVersion)) return;
|
if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
|
||||||
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||||
if (PluginCheck.papi()) {
|
if (PluginCheck.papi()) {
|
||||||
PaPi = true;
|
PaPi = true;
|
||||||
}
|
}
|
||||||
Load.onLoad(prefix, autor, version, spigot, spigotID, discord, bstatsID);
|
Load.onLoad(prefix, autor, version, Util.getSpigot(), Util.getSpigotID(), Util.getDiscord(), Util.getBstatsID());
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addonLoad() {
|
public static void addonLoad() {
|
||||||
if (Bukkit.getPluginManager().getPlugin("PlotSquaredGUI") != null) {
|
if (PluginCheck.plotSquaredGUI()) {
|
||||||
PlotSquaredGUI = true;
|
PlotSquaredGUI = true;
|
||||||
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
|
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
|
||||||
|
}if (PluginCheck.luckyBox()) {
|
||||||
|
LuckyBox = true;
|
||||||
|
addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox"));
|
||||||
}
|
}
|
||||||
if (Bukkit.getPluginManager().getPlugin("PlugManGUI") != null) {
|
if (PluginCheck.plugManGUI()) {
|
||||||
PlugManGUI = true;
|
PlugManGUI = true;
|
||||||
addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI"));
|
addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI"));
|
||||||
}
|
}
|
||||||
@@ -113,6 +112,6 @@ public final class Main extends JavaPlugin {
|
|||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
// Plugin shutdown logic
|
// Plugin shutdown logic
|
||||||
if (enable) T2CodeTemplate.onDisable(prefix, autor, version, spigot, discord);
|
if (enable) T2CodeTemplate.onDisable(prefix, autor, version, Util.getSpigot(), Util.getDiscord());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
|
import de.jatitv.commandguiv2.Spigot.config.DefaultGUICreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -18,7 +18,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CmdExecuter_Admin implements CommandExecutor, TabCompleter {
|
public class CmdExecuter_Admin implements CommandExecutor, TabCompleter {
|
||||||
private static String prefix = Util.Prefix;
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
@@ -1,11 +1,10 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.config.DefaultGUICreate;
|
||||||
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.t2code.lib.Bungee.Lib.commands.BTab;
|
|
||||||
import net.t2code.lib.Spigot.Lib.commands.Tab;
|
import net.t2code.lib.Spigot.Lib.commands.Tab;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@@ -19,7 +18,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
|
public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
|
||||||
private static String prefix = Util.Prefix;
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
|
||||||
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 org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@@ -16,7 +15,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
||||||
private static String prefix = Util.Prefix;
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
@@ -1,13 +1,12 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class CmdExecuter_Help implements CommandExecutor {
|
public class CmdExecuter_Help implements CommandExecutor {
|
||||||
private static String prefix = Util.Prefix;
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
|
@@ -6,16 +6,13 @@ import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
|||||||
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.Give_UseItem;
|
import de.jatitv.commandguiv2.Spigot.system.Give_UseItem;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.ConfigCreate;
|
import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.LanguagesCreate;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.TextBuilder;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@@ -23,78 +20,70 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
public class Commands {
|
public class Commands {
|
||||||
private static Plugin plugin = Main.plugin;
|
|
||||||
private static String prefix = Util.Prefix;
|
|
||||||
private static String autor = String.valueOf(Main.autor);
|
|
||||||
private static String version = Main.version;
|
|
||||||
private static String spigot = Util.Spigot;
|
|
||||||
private static String discord = Util.Discord;
|
|
||||||
|
|
||||||
public static void info(CommandSender sender) {
|
public static void info(CommandSender sender) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
send.player(player, prefix + "§4======= §8[§4Command§9GUI§8] §4=======");
|
send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
|
||||||
send.player(player, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
send.player(player, Util.getPrefix() + " §2String.valueOf(Main.autor): §6" + String.valueOf(String.valueOf(Main.autor)).replace("[", "").replace("]", ""));
|
||||||
|
|
||||||
if (UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion.equalsIgnoreCase(version)) {
|
if (UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion.equalsIgnoreCase(Main.version)) {
|
||||||
send.player(player, prefix + " §2Version: §6" + version);
|
send.player(player, Util.getPrefix() + " §2Version: §6" + Main.version);
|
||||||
} else {
|
} else {
|
||||||
UpdateAPI.sendUpdateMsg(prefix,spigot,discord,version,UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion,player);
|
UpdateAPI.sendUpdateMsg(Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
send.player(player, prefix + " §2Spigot: §6" + spigot);
|
send.player(player, Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
|
||||||
send.player(player, prefix + " §2Discord: §6" + discord);
|
send.player(player, Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
|
||||||
send.player(player, prefix + "§4======= §8[§4Command§9GUI§8] §4=======");
|
send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
|
||||||
} else {
|
} else {
|
||||||
send.sender(sender, prefix + "§4======= §8[§4Command§9GUI§8] §4=======");
|
send.sender(sender, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
|
||||||
send.sender(sender, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
send.sender(sender, Util.getPrefix() + " §2String.valueOf(Main.autor): §6" + String.valueOf(String.valueOf(Main.autor)).replace("[", "").replace("]", ""));
|
||||||
|
|
||||||
if (UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion.equalsIgnoreCase(version)) {
|
if (UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion.equalsIgnoreCase(Main.version)) {
|
||||||
send.sender(sender,prefix + " §2Version: §6" + version);
|
send.sender(sender, Util.getPrefix() + " §2Version: §6" + Main.version);
|
||||||
} else {
|
} else {
|
||||||
UpdateAPI.sendUpdateMsg(prefix,spigot,discord,version,UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion);
|
UpdateAPI.sendUpdateMsg(Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
send.sender(sender, prefix + " §2Spigot: §6" + spigot);
|
send.sender(sender, Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
|
||||||
send.sender(sender, prefix + " §2Discord: §6" + discord);
|
send.sender(sender, Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
|
||||||
send.sender(sender, prefix + "§4======= §8[§4Command§9GUI§8] §4=======");
|
send.sender(sender, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void reload(CommandSender sender) {
|
public static void reload(CommandSender sender) {
|
||||||
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadStart);
|
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadStart);
|
||||||
send.console(prefix + "§8-------------------------------");
|
send.console(Util.getPrefix() + "§8-------------------------------");
|
||||||
send.console(prefix + " §6Plugin reload...");
|
send.console(Util.getPrefix() + " §6Plugin reload...");
|
||||||
send.console(prefix + "§8-------------------------------");
|
send.console(Util.getPrefix() + "§8-------------------------------");
|
||||||
|
|
||||||
CmdExecuter_GUI.arg1.clear();
|
CmdExecuter_GUI.arg1.clear();
|
||||||
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
||||||
ConfigCreate.configCreate();
|
ConfigCreate.configCreate();
|
||||||
SelectConfig.onSelect();
|
SelectConfig.onSelect();
|
||||||
plugin.reloadConfig();
|
Main.plugin.reloadConfig();
|
||||||
|
|
||||||
LanguagesCreate.langCreate();
|
LanguagesCreate.langCreate();
|
||||||
|
|
||||||
Obj_Select.onSelect();
|
Obj_Select.onSelect();
|
||||||
SelectMessages.onSelect(prefix);
|
SelectMessages.onSelect(Util.getPrefix());
|
||||||
SelectConfig.sound(prefix);
|
SelectConfig.sound(Util.getPrefix());
|
||||||
try {
|
try {
|
||||||
AliasRegister.onRegister();
|
AliasRegister.onRegister();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
if (SelectConfig.Bungee){
|
if (SelectConfig.Bungee) {
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "commandgui:bungee");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "commandgui:bungee");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadEnd);
|
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadEnd);
|
||||||
send.console(prefix + "§8-------------------------------");
|
send.console(Util.getPrefix() + "§8-------------------------------");
|
||||||
send.console(prefix + " §2Plugin successfully reloaded.");
|
send.console(Util.getPrefix() + " §2Plugin successfully reloaded.");
|
||||||
send.console(prefix + "§8-------------------------------");
|
send.console(Util.getPrefix() + "§8-------------------------------");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void give(CommandSender sender, Player target) {
|
public static void give(CommandSender sender, Player target) {
|
||||||
@@ -128,7 +117,7 @@ public class Commands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Integer slot = null;
|
Integer slot = null;
|
||||||
if (SelectConfig.UseItem_InventorySlotEnforce){
|
if (SelectConfig.UseItem_InventorySlotEnforce) {
|
||||||
slot = SelectConfig.UseItem_InventorySlot;
|
slot = SelectConfig.UseItem_InventorySlot;
|
||||||
} else {
|
} else {
|
||||||
if (Select_Database.selectSlot(player) == null) {
|
if (Select_Database.selectSlot(player) == null) {
|
||||||
@@ -137,7 +126,7 @@ public class Commands {
|
|||||||
slot = Select_Database.selectSlot(player);
|
slot = Select_Database.selectSlot(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
send.debug(plugin,String.valueOf(slot));
|
send.debug(Main.plugin, String.valueOf(slot));
|
||||||
if (player.getInventory().getItem(slot - 1) == null) {
|
if (player.getInventory().getItem(slot - 1) == null) {
|
||||||
Select_Database.setItemStatusTrue(player);
|
Select_Database.setItemStatusTrue(player);
|
||||||
Give_UseItem.onGive(player);
|
Give_UseItem.onGive(player);
|
||||||
@@ -218,7 +207,7 @@ public class Commands {
|
|||||||
Give_UseItem.onGive(player);
|
Give_UseItem.onGive(player);
|
||||||
}
|
}
|
||||||
send.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString()));
|
send.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString()));
|
||||||
} else player.sendMessage(prefix + " §4Function disabled");
|
} else player.sendMessage(Util.getPrefix() + " §4Function disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void gui(Player player) {
|
public static void gui(Player player) {
|
||||||
@@ -235,7 +224,8 @@ public class Commands {
|
|||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.GUI_Name));
|
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.GUI_Name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void gui(Player player, String arg){
|
|
||||||
|
public static void gui(Player player, String arg) {
|
||||||
if (Main.guiHashMap.containsKey(arg)) {
|
if (Main.guiHashMap.containsKey(arg)) {
|
||||||
Object gui = Main.guiHashMap.get(arg);
|
Object gui = Main.guiHashMap.get(arg);
|
||||||
if (gui.GUI_Enable || player.hasPermission("commandgui.bypass")) {
|
if (gui.GUI_Enable || player.hasPermission("commandgui.bypass")) {
|
||||||
|
@@ -1,16 +1,16 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
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.replace.Replace;
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class Help {
|
public class Help {
|
||||||
private static String prefix = Util.Prefix;
|
private static String prefix = Util.getPrefix();
|
||||||
public static void sendHelp(CommandSender sender, String Prefix) {
|
public static void sendHelp(CommandSender sender, String Prefix) {
|
||||||
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
||||||
if (sender.hasPermission("commandgui.command")) {
|
if (sender.hasPermission("commandgui.command")) {
|
||||||
|
@@ -18,7 +18,7 @@ public class AliasRegister {
|
|||||||
File f = new File(Main.getPath() + "/GUIs/");
|
File f = new File(Main.getPath() + "/GUIs/");
|
||||||
File[] fileArray = f.listFiles();
|
File[] fileArray = f.listFiles();
|
||||||
if (Main.allAliases.toString().equals("[]")) {
|
if (Main.allAliases.toString().equals("[]")) {
|
||||||
send.console(Util.Prefix + " §4No GUI files available");
|
send.console(Util.getSpigot() + " §4No GUI files available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (String alias : Main.allAliases) {
|
for (String alias : Main.allAliases) {
|
||||||
|
@@ -4,8 +4,8 @@ package de.jatitv.commandguiv2.Spigot.cmdManagement.register;
|
|||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.config;
|
package de.jatitv.commandguiv2.Spigot.config;
|
||||||
|
|
||||||
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;
|
@@ -0,0 +1,160 @@
|
|||||||
|
package de.jatitv.commandguiv2.Spigot.config.config;
|
||||||
|
|
||||||
|
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.minecraftVersion.MCVersion;
|
||||||
|
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
|
||||||
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
|
||||||
|
public class ConfigCreate {
|
||||||
|
|
||||||
|
public static Integer ConfigVersion = 4;
|
||||||
|
|
||||||
|
public static void configCreate() {
|
||||||
|
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||||
|
if (new File(Main.getPath(), "config.yml").exists()) {
|
||||||
|
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Main.prefix + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||||||
|
} else send.console(Main.prefix + " §4config.yml are created...");
|
||||||
|
|
||||||
|
File config = new File(Main.getPath(), "config.yml");
|
||||||
|
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
|
if (yamlConfiguration.getInt("ConfigVersion") < ConfigVersion && new File(Main.getPath(), "config.yml").exists()) {
|
||||||
|
send.console(Util.getPrefix() +" §4----------------------");
|
||||||
|
send.console(Util.getPrefix() +" ");
|
||||||
|
send.console(Util.getPrefix() +" §6New features have been added to CommandGUI. The Config is adapted!");
|
||||||
|
send.console(Util.getPrefix() +" ");
|
||||||
|
send.console(Util.getPrefix() +" §4----------------------");
|
||||||
|
}
|
||||||
|
|
||||||
|
yamlConfiguration.set("ConfigVersion", ConfigVersion);
|
||||||
|
|
||||||
|
Config.set("Plugin.UpdateCheckOnJoin", true, yamlConfiguration);
|
||||||
|
Config.set("Plugin.Debug", false, yamlConfiguration);
|
||||||
|
Config.set("Plugin.HelpAlias", true, yamlConfiguration);
|
||||||
|
Config.set("Plugin.language", "english", yamlConfiguration);
|
||||||
|
Config.set("Plugin.Currency", "$", yamlConfiguration);
|
||||||
|
Config.set("Plugin.DefaultGUI", "default", yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Storage.Type", "YML", yamlConfiguration);
|
||||||
|
Config.set("Storage.MySQL.IP", "localhost", yamlConfiguration);
|
||||||
|
Config.set("Storage.MySQL.Port", 3306, yamlConfiguration);
|
||||||
|
Config.set("Storage.MySQL.Database", "database", yamlConfiguration);
|
||||||
|
Config.set("Storage.MySQL.User", "root", yamlConfiguration);
|
||||||
|
Config.set("Storage.MySQL.Password", "password", yamlConfiguration);
|
||||||
|
Config.set("Storage.MySQL.SSL", false, yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("BungeeCord.Enable", false, yamlConfiguration);
|
||||||
|
Config.set("BungeeCord.ThisServer", "server", yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("UseItem.Enable", true, yamlConfiguration);
|
||||||
|
Config.set("UseItem.AllowToggle", true, yamlConfiguration);
|
||||||
|
Config.set("UseItem.AllowSetSlot", true, yamlConfiguration);
|
||||||
|
Config.set("UseItem.BlockMoveAndDrop", true, yamlConfiguration);
|
||||||
|
Config.set("UseItem.OpenGUI", "default", yamlConfiguration);
|
||||||
|
Config.set("UseItem.Permission.NeededToUse", true, yamlConfiguration);
|
||||||
|
Config.set("UseItem.KeepAtCommandClear", true, yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("UseItem.InventorySlot.Slot", 1, yamlConfiguration);
|
||||||
|
Config.set("UseItem.InventorySlot.SlotEnforce", false, yamlConfiguration);
|
||||||
|
Config.set("UseItem.InventorySlot.FreeSlot", false, yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("UseItem.Item.Material", "paper", yamlConfiguration);
|
||||||
|
if (!(MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12)) {
|
||||||
|
Config.set("UseItem.Item.PlayerHead.Enable", false, yamlConfiguration);
|
||||||
|
Config.set("UseItem.Item.PlayerHead.Base64.Enable", false, yamlConfiguration);
|
||||||
|
Config.set("UseItem.Item.PlayerHead.Base64.Base64Value", "", yamlConfiguration);
|
||||||
|
Config.set("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", false, yamlConfiguration);
|
||||||
|
Config.set("UseItem.Item.PlayerHead.Playername", "", yamlConfiguration);
|
||||||
|
}
|
||||||
|
Config.set("UseItem.Item.Name", "&bDefault &6GUI", yamlConfiguration);
|
||||||
|
Config.set("UseItem.Item.Lore", Arrays.asList("&eThis is an example GUI"), yamlConfiguration);
|
||||||
|
Config.set("UseItem.Join.GiveOnEveryJoin", true, yamlConfiguration);
|
||||||
|
Config.set("UseItem.Join.GiveOnlyOnFirstJoin", false, yamlConfiguration);
|
||||||
|
|
||||||
|
//convert
|
||||||
|
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin")) {
|
||||||
|
Config.set("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin", yamlConfiguration);
|
||||||
|
Config.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin"), yamlConfiguration);
|
||||||
|
}
|
||||||
|
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin")) {
|
||||||
|
Config.set("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin", yamlConfiguration);
|
||||||
|
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin"), yamlConfiguration);
|
||||||
|
}
|
||||||
|
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange")) {
|
||||||
|
Config.set("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange", yamlConfiguration);
|
||||||
|
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange"), yamlConfiguration);
|
||||||
|
}
|
||||||
|
|
||||||
|
Config.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", true, yamlConfiguration);
|
||||||
|
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", true, 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("Sound.Enable", true, yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Sound.OpenInventory.Enable", true, yamlConfiguration);
|
||||||
|
if (MCVersion.minecraft1_8) {
|
||||||
|
Config.set("Sound.OpenInventory.Sound", "CHEST_OPEN", yamlConfiguration);
|
||||||
|
} else Config.set("Sound.OpenInventory.Sound", "BLOCK_CHEST_OPEN", yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Sound.Click.Enable", true, yamlConfiguration);
|
||||||
|
if (MCVersion.minecraft1_8) {
|
||||||
|
Config.set("Sound.Click.Sound", "NOTE_STICKS", yamlConfiguration);
|
||||||
|
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||||
|
Config.set("Sound.Click.Sound", "BLOCK_NOTE_HAT", yamlConfiguration);
|
||||||
|
} else Config.set("Sound.Click.Sound", "BLOCK_NOTE_BLOCK_HAT", yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Sound.NoMoney.Enable", true, yamlConfiguration);
|
||||||
|
if (MCVersion.minecraft1_8) {
|
||||||
|
Config.set("Sound.NoMoney.Sound", "NOTE_PIANO", yamlConfiguration);
|
||||||
|
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||||
|
Config.set("Sound.NoMoney.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
|
||||||
|
} else Config.set("Sound.NoMoney.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Sound.NoInventorySpace.Enable", true, yamlConfiguration);
|
||||||
|
if (MCVersion.minecraft1_8) {
|
||||||
|
Config.set("Sound.NoInventorySpace.Sound", "NOTE_PIANO", yamlConfiguration);
|
||||||
|
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||||
|
Config.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
|
||||||
|
} else Config.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Sound.Give.Enable", true, yamlConfiguration);
|
||||||
|
if (MCVersion.minecraft1_8) {
|
||||||
|
Config.set("Sound.Give.Sound", "LEVEL_UP", yamlConfiguration);
|
||||||
|
} else Config.set("Sound.Give.Sound", "ENTITY_PLAYER_LEVELUP", yamlConfiguration);
|
||||||
|
|
||||||
|
Config.set("Sound.PlayerNotFound.Enable", true, yamlConfiguration);
|
||||||
|
if (MCVersion.minecraft1_8) {
|
||||||
|
Config.set("Sound.PlayerNotFound.Sound", "NOTE_PIANO", yamlConfiguration);
|
||||||
|
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||||
|
Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
|
||||||
|
} else Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
|
||||||
|
|
||||||
|
try {
|
||||||
|
yamlConfiguration.save(config);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
send.console(Main.prefix + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||||
|
}
|
||||||
|
}
|
@@ -1,19 +1,20 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.config.config;
|
package de.jatitv.commandguiv2.Spigot.config.config;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
||||||
|
import de.jatitv.commandguiv2.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 net.t2code.lib.Spigot.Lib.replace.Replace;
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
import net.t2code.lib.Util;
|
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class SelectConfig {private static String prefix = Util.Prefix;
|
public class SelectConfig {
|
||||||
|
|
||||||
public static Boolean DisableUpdateChecker;
|
public static Boolean DisableUpdateChecker;
|
||||||
public static Boolean UpdateCheckOnJoin;
|
public static Boolean UpdateCheckOnJoin;
|
||||||
@@ -42,8 +43,19 @@ public class SelectConfig {private static String prefix = Util.Prefix;
|
|||||||
public static Boolean UseItem_Permission;
|
public static Boolean UseItem_Permission;
|
||||||
public static Boolean UseItem_KeepAtCommandClear;
|
public static Boolean UseItem_KeepAtCommandClear;
|
||||||
|
|
||||||
|
public static Boolean UseItemGameModeChangeEnable;
|
||||||
public static int UseItemGameModeChangeDelayInTicks;
|
public static int UseItemGameModeChangeDelayInTicks;
|
||||||
public static Boolean UseItemGameModeChangeDisableInSpectator;
|
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 Boolean UseItem_InventorySlot_FreeSlot;
|
public static Boolean UseItem_InventorySlot_FreeSlot;
|
||||||
public static Integer UseItem_InventorySlot;
|
public static Integer UseItem_InventorySlot;
|
||||||
@@ -55,7 +67,7 @@ public class SelectConfig {private static String prefix = Util.Prefix;
|
|||||||
public static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
|
public static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
|
||||||
public static String UseItem_PlayerName;
|
public static String UseItem_PlayerName;
|
||||||
public static String UseItem_Name;
|
public static String UseItem_Name;
|
||||||
public static List UseItem_Lore;
|
public static List<String> UseItem_Lore;
|
||||||
|
|
||||||
public static Boolean Sound_Enable = true;
|
public static Boolean Sound_Enable = true;
|
||||||
|
|
||||||
@@ -71,7 +83,6 @@ public class SelectConfig {private static String prefix = Util.Prefix;
|
|||||||
public static Sound Sound_NoMoney;
|
public static Sound Sound_NoMoney;
|
||||||
public static String Sound_NoMoney_input;
|
public static String Sound_NoMoney_input;
|
||||||
|
|
||||||
|
|
||||||
public static Boolean Sound_NoInventorySpace_Enable = true;
|
public static Boolean Sound_NoInventorySpace_Enable = true;
|
||||||
public static Sound Sound_NoInventorySpace;
|
public static Sound Sound_NoInventorySpace;
|
||||||
public static String Sound_NoInventorySpace_input;
|
public static String Sound_NoInventorySpace_input;
|
||||||
@@ -129,16 +140,31 @@ public class SelectConfig {private static String prefix = Util.Prefix;
|
|||||||
UseItem_Base64value = yamlConfiguration.getString("UseItem.Item.PlayerHead.Base64.Base64Value");
|
UseItem_Base64value = yamlConfiguration.getString("UseItem.Item.PlayerHead.Base64.Base64Value");
|
||||||
UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
|
UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
|
||||||
UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName");
|
UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName");
|
||||||
UseItem_Name = Replace.replace(prefix,yamlConfiguration.getString("UseItem.Item.Name"));
|
UseItem_Name = Replace.replace(Util.getPrefix(),yamlConfiguration.getString("UseItem.Item.Name"));
|
||||||
UseItem_Lore = yamlConfiguration.getList("UseItem.Item.Lore");
|
UseItem_Lore = yamlConfiguration.getStringList("UseItem.Item.Lore");
|
||||||
UseItem_GiveOnEveryJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnEveryJoin");
|
UseItem_GiveOnEveryJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnEveryJoin");
|
||||||
UseItem_GiveOnlyOnFirstJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnlyOnFirstJoin");
|
UseItem_GiveOnlyOnFirstJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnlyOnFirstJoin");
|
||||||
Cursor_ToGUIItem_OnLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable");
|
Cursor_ToGUIItem_OnLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable");
|
||||||
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");
|
||||||
|
|
||||||
UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameModeChange.DelayInTicks");
|
UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Change.Enable");
|
||||||
UseItemGameModeChangeDisableInSpectator = yamlConfiguration.getBoolean("Advanced.UseItem.GameModeChange.DisableInSpectator");
|
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");
|
||||||
|
|
||||||
Sound_Enable = yamlConfiguration.getBoolean("Sound.Enable");
|
Sound_Enable = yamlConfiguration.getBoolean("Sound.Enable");
|
||||||
Sound_OpenInventory_Enable = yamlConfiguration.getBoolean("Sound.OpenInventory.Enable");
|
Sound_OpenInventory_Enable = yamlConfiguration.getBoolean("Sound.OpenInventory.Enable");
|
||||||
@@ -154,33 +180,33 @@ public class SelectConfig {private static String prefix = Util.Prefix;
|
|||||||
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(".", "_"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void sound(String Prefix) {
|
public static void sound(String Prefix) {
|
||||||
String soundOpenInventory;
|
String soundOpenInventory;
|
||||||
if (MCVersion.minecraft1_8) {
|
if (MCVersion.minecraft1_8) {
|
||||||
soundOpenInventory = ConfigCreate.Sound_OpenInventory_1_8;
|
soundOpenInventory = "CHEST_OPEN";
|
||||||
} else {
|
} else {
|
||||||
soundOpenInventory = ConfigCreate.Sound_OpenInventory_ab_1_9;
|
soundOpenInventory = "BLOCK_CHEST_OPEN";
|
||||||
}
|
}
|
||||||
|
|
||||||
String soundClick;
|
String soundClick;
|
||||||
if (MCVersion.minecraft1_8) {
|
if (MCVersion.minecraft1_8) {
|
||||||
soundClick = ConfigCreate.Sound_Click_1_8;
|
soundClick = "NOTE_STICKS";
|
||||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||||
soundClick = ConfigCreate.Sound_Click_1_9_bis_1_12;
|
soundClick = "BLOCK_NOTE_HAT";
|
||||||
} else {
|
} else {
|
||||||
soundClick = ConfigCreate.Sound_Click_ab_1_13;
|
soundClick = "BLOCK_NOTE_BLOCK_HAT";
|
||||||
}
|
}
|
||||||
|
|
||||||
String soundNoMoney;
|
String soundNoMoney;
|
||||||
if (MCVersion.minecraft1_8) {
|
if (MCVersion.minecraft1_8) {
|
||||||
soundNoMoney = ConfigCreate.Sound_NoMoney_1_8;
|
soundNoMoney = "NOTE_PIANO";
|
||||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||||
soundNoMoney = ConfigCreate.Sound_NoMoney_1_9_bis_1_12;
|
soundNoMoney = "BLOCK_NOTE_HARP";
|
||||||
} else {
|
} else {
|
||||||
soundNoMoney = ConfigCreate.Sound_NoMoney_ab_1_13;
|
soundNoMoney = "BLOCK_NOTE_BLOCK_HARP";
|
||||||
}
|
}
|
||||||
|
|
||||||
String soundNoInventorySpace;
|
String soundNoInventorySpace;
|
@@ -1,4 +1,4 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.config.languages;
|
package de.jatitv.commandguiv2.Spigot.config.languages;
|
||||||
|
|
||||||
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;
|
||||||
@@ -42,6 +42,8 @@ public class LanguagesCreate {
|
|||||||
set("UseItem.SlotNotEmpty", MSG.EN_ItemSlotNotEmpty, yamlConfigurationEN);
|
set("UseItem.SlotNotEmpty", MSG.EN_ItemSlotNotEmpty, yamlConfigurationEN);
|
||||||
set("UseItem.SlotAlreadySet", MSG.EN_ItemSlotAlreadySet, yamlConfigurationEN);
|
set("UseItem.SlotAlreadySet", MSG.EN_ItemSlotAlreadySet, yamlConfigurationEN);
|
||||||
set("UseItem.ItemSlot_wrongValue", MSG.EN_ItemSlot_wrongValue, yamlConfigurationEN);
|
set("UseItem.ItemSlot_wrongValue", MSG.EN_ItemSlot_wrongValue, yamlConfigurationEN);
|
||||||
|
set("UseItem.DisabledInGameMode", MSG.EN_UseItemDisabledInGameMode, 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);
|
||||||
@@ -104,6 +106,8 @@ public class LanguagesCreate {
|
|||||||
set("UseItem.SlotNotEmpty", MSG.DE_ItemSlotNotEmpty, yamlConfigurationDE);
|
set("UseItem.SlotNotEmpty", MSG.DE_ItemSlotNotEmpty, yamlConfigurationDE);
|
||||||
set("UseItem.SlotAlreadySet", MSG.DE_ItemSlotAlreadySet, yamlConfigurationDE);
|
set("UseItem.SlotAlreadySet", MSG.DE_ItemSlotAlreadySet, yamlConfigurationDE);
|
||||||
set("UseItem.ItemSlot_wrongValue", MSG.DE_ItemSlot_wrongValue, yamlConfigurationDE);
|
set("UseItem.ItemSlot_wrongValue", MSG.DE_ItemSlot_wrongValue, yamlConfigurationDE);
|
||||||
|
set("UseItem.DisabledInGameMode", MSG.DE_UseItemDisabledInGameMode, 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);
|
||||||
@@ -167,6 +171,8 @@ public class LanguagesCreate {
|
|||||||
set("UseItem.SlotNotEmpty", MSG.NO_ItemSlotNotEmpty, yamlConfigurationNO);
|
set("UseItem.SlotNotEmpty", MSG.NO_ItemSlotNotEmpty, yamlConfigurationNO);
|
||||||
set("UseItem.SlotAlreadySet", MSG.NO_ItemSlotAlreadySet, yamlConfigurationNO);
|
set("UseItem.SlotAlreadySet", MSG.NO_ItemSlotAlreadySet, yamlConfigurationNO);
|
||||||
set("UseItem.ItemSlot_wrongValue", MSG.NO_ItemSlot_wrongValue, yamlConfigurationNO);
|
set("UseItem.ItemSlot_wrongValue", MSG.NO_ItemSlot_wrongValue, yamlConfigurationNO);
|
||||||
|
set("UseItem.DisabledInGameMode", MSG.NO_UseItemDisabledInGameMode, 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);
|
@@ -9,7 +9,7 @@
|
|||||||
// \_____\_____|\____/|_____|
|
// \_____\_____|\____/|_____|
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
|
|
||||||
package de.jatitv.commandguiv2.Spigot.system.config.languages;
|
package de.jatitv.commandguiv2.Spigot.config.languages;
|
||||||
|
|
||||||
public class MSG {
|
public class MSG {
|
||||||
|
|
||||||
@@ -38,6 +38,8 @@ public class MSG {
|
|||||||
public static String EN_ItemSlotNotEmpty = "[prefix] &6The slot &e[slot] &6is currently occupied!";
|
public static String EN_ItemSlotNotEmpty = "[prefix] &6The slot &e[slot] &6is currently occupied!";
|
||||||
public static String EN_ItemSlotAlreadySet = "[prefix] &6The slot §e[slot] §6is already set!";
|
public static String EN_ItemSlotAlreadySet = "[prefix] &6The slot §e[slot] §6is already set!";
|
||||||
public static String EN_ItemSlot_wrongValue = "[prefix] &cThe specified slot must be between 1 and 9!";
|
public static String EN_ItemSlot_wrongValue = "[prefix] &cThe specified slot must be between 1 and 9!";
|
||||||
|
public static String EN_UseItemDisabledInGameMode = "[prefix] &cThe UseItem is disabled in this GameMode!";
|
||||||
|
public static String EN_UseItemDisabledInWorld = "[prefix] &cThe UseItem is disabled in this World!";
|
||||||
|
|
||||||
public static String EN_GUInotFound = "[prefix] &cThe GUI chosen by the does not exist.";
|
public static String EN_GUInotFound = "[prefix] &cThe GUI chosen by the does not exist.";
|
||||||
public static String EN_GUIisDisabled = "[prefix] &cThe GUI [gui] &cis currently Disabled!";
|
public static String EN_GUIisDisabled = "[prefix] &cThe GUI [gui] &cis currently Disabled!";
|
||||||
@@ -79,6 +81,8 @@ public class MSG {
|
|||||||
public static String DE_ItemSlotNotEmpty = "[prefix] &6Der Slot §e[slot] §6ist derzeit belegt!.";
|
public static String DE_ItemSlotNotEmpty = "[prefix] &6Der Slot §e[slot] §6ist derzeit belegt!.";
|
||||||
public static String DE_ItemSlotAlreadySet = "[prefix] &6Der Slot §e[slot] §6ist bereits eingestellt!";
|
public static String DE_ItemSlotAlreadySet = "[prefix] &6Der Slot §e[slot] §6ist bereits eingestellt!";
|
||||||
public static String DE_ItemSlot_wrongValue = "[prefix] &cDer angegebene Slot muss sich zwischen 1 und 9 befinden!";
|
public static String DE_ItemSlot_wrongValue = "[prefix] &cDer angegebene Slot muss sich zwischen 1 und 9 befinden!";
|
||||||
|
public static String DE_UseItemDisabledInGameMode = "[prefix] &cDas UseItem ist in diesem GameMode 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!";
|
||||||
@@ -130,6 +134,8 @@ public class MSG {
|
|||||||
public static String NO_ItemSlotNotEmpty = "[prefix] &6Plassen &e[slot] &6er opptatt for øyeblikket!";
|
public static String NO_ItemSlotNotEmpty = "[prefix] &6Plassen &e[slot] &6er opptatt for øyeblikket!";
|
||||||
public static String NO_ItemSlotAlreadySet = "[prefix] &6Plassen §e[slot] §6er allerede satt!";
|
public static String NO_ItemSlotAlreadySet = "[prefix] &6Plassen §e[slot] §6er allerede satt!";
|
||||||
public static String NO_ItemSlot_wrongValue = "[prefix] &cDen spesifiserte plassen må være mellom 1 og 9!";
|
public static String NO_ItemSlot_wrongValue = "[prefix] &cDen spesifiserte plassen må være mellom 1 og 9!";
|
||||||
|
public static String NO_UseItemDisabledInGameMode = "[prefix] &cBrukselementet er deaktivert i denne spillmodusen!!";
|
||||||
|
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!";
|
@@ -1,7 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.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.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
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.replace.Replace;
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
@@ -10,7 +10,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
public class SelectMessages {
|
public class SelectMessages {
|
||||||
private static String prefix = Util.Prefix;
|
|
||||||
|
|
||||||
public static String selectMSG;
|
public static String selectMSG;
|
||||||
|
|
||||||
@@ -32,6 +32,8 @@ public class SelectMessages {
|
|||||||
public static String ItemSlotNotEmpty;
|
public static String ItemSlotNotEmpty;
|
||||||
public static String ItemSlotAlreadySet;
|
public static String ItemSlotAlreadySet;
|
||||||
public static String ItemSlot_wrongValue;
|
public static String ItemSlot_wrongValue;
|
||||||
|
public static String UseItemDisabledInGameMode;
|
||||||
|
public static String UseItemDisabledInWorld;
|
||||||
|
|
||||||
public static String Buy_msg;
|
public static String Buy_msg;
|
||||||
public static String No_money;
|
public static String No_money;
|
||||||
@@ -97,6 +99,8 @@ public class SelectMessages {
|
|||||||
ItemSlotNotEmpty = select("UseItem.SlotNotEmpty", yamlConfiguration_msg);
|
ItemSlotNotEmpty = select("UseItem.SlotNotEmpty", yamlConfiguration_msg);
|
||||||
ItemSlotAlreadySet = select("UseItem.SlotAlreadySet", yamlConfiguration_msg);
|
ItemSlotAlreadySet = select("UseItem.SlotAlreadySet", yamlConfiguration_msg);
|
||||||
ItemSlot_wrongValue = select("UseItem.ItemSlot_wrongValue", yamlConfiguration_msg);
|
ItemSlot_wrongValue = select("UseItem.ItemSlot_wrongValue", yamlConfiguration_msg);
|
||||||
|
UseItemDisabledInGameMode =select("UseItem.DisabledInGameMode",yamlConfiguration_msg);
|
||||||
|
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);
|
No_money = select("Cost.No_money", yamlConfiguration_msg);
|
||||||
@@ -129,6 +133,6 @@ public class SelectMessages {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String select(String path, YamlConfiguration yamlConfiguration){
|
private static String select(String path, YamlConfiguration yamlConfiguration){
|
||||||
return Replace.replace(prefix,yamlConfiguration.getString(path));
|
return Replace.replace(Util.getPrefix(),yamlConfiguration.getString(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -5,15 +5,16 @@ import com.mojang.authlib.properties.Property;
|
|||||||
import de.jatitv.commandguiv2.Spigot.Listener.GUI_Listener;
|
import de.jatitv.commandguiv2.Spigot.Listener.GUI_Listener;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
|
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
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.items.ItemVersion;
|
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
|
import net.t2code.luckybox.api.LuckyBoxAPI;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -29,7 +30,7 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class OpenGUI {
|
public class OpenGUI {
|
||||||
private static Plugin plugin = Main.plugin;
|
private static Plugin plugin = Main.plugin;
|
||||||
private static String prefix = Util.Prefix;
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
public static void openGUI(Player player, Object gui, String guiString) {
|
public static void openGUI(Player player, Object gui, String guiString) {
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||||
@@ -54,6 +55,16 @@ public class OpenGUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
case "plugin.T2C-LuckyBox":
|
||||||
|
if (Main.LuckyBox) {
|
||||||
|
LuckyBoxAPI.openShop(player);
|
||||||
|
} else {
|
||||||
|
if (player.hasPermission("commandgui.admin")) {
|
||||||
|
send.player(player, prefix + " §4T2C-LuckyBox could not be found! §9Please download it here: " +
|
||||||
|
"§6https://www.spigotmc.org/resources/luckybox.98154/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MCVersion.minecraft1_13) {
|
if (MCVersion.minecraft1_13) {
|
||||||
@@ -90,10 +101,10 @@ public class OpenGUI {
|
|||||||
send.error(plugin, "Playerheads are only available from version 1.13!");
|
send.error(plugin, "Playerheads are only available from version 1.13!");
|
||||||
send.console(prefix + " §bGUI: §6" + Replace.replace(prefix, gui.GUI_Name).toString() + " §bSlot: §6" + (slot.Slot + 1) + " §7- " + Replace.replace(prefix, slot.Name));
|
send.console(prefix + " §bGUI: §6" + Replace.replace(prefix, gui.GUI_Name).toString() + " §bSlot: §6" + (slot.Slot + 1) + " §7- " + Replace.replace(prefix, slot.Name));
|
||||||
} else {
|
} else {
|
||||||
|
ItemStack item = ItemVersion.getHeadIS();
|
||||||
|
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
||||||
if (slot.Base64_Enable) {
|
if (slot.Base64_Enable) {
|
||||||
ItemStack item = ItemVersion.getHeadIS();
|
|
||||||
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
||||||
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||||
@@ -120,8 +131,6 @@ public class OpenGUI {
|
|||||||
inventory.setItem(slot.Slot, item);
|
inventory.setItem(slot.Slot, item);
|
||||||
} else {
|
} else {
|
||||||
if (slot.PlayerWhoHasOpenedTheGUI) {
|
if (slot.PlayerWhoHasOpenedTheGUI) {
|
||||||
ItemStack item = ItemVersion.getHeadIS();
|
|
||||||
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
||||||
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||||
@@ -138,8 +147,6 @@ public class OpenGUI {
|
|||||||
item.setAmount(am);
|
item.setAmount(am);
|
||||||
inventory.setItem(slot.Slot, item);
|
inventory.setItem(slot.Slot, item);
|
||||||
} else {
|
} else {
|
||||||
ItemStack item = ItemVersion.getHeadIS();
|
|
||||||
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
||||||
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||||
|
@@ -24,20 +24,20 @@ public class Bungee_Sender_Reciver implements PluginMessageListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
||||||
|
send.debug(Main.plugin,"stream: "+stream.toString());
|
||||||
try {
|
try {
|
||||||
String subChannel = stream.readUTF();
|
String subChannel = stream.readUTF();
|
||||||
String input = stream.readUTF();
|
String input = stream.readUTF();
|
||||||
|
send.debug(Main.plugin,"subChannel: " +subChannel);
|
||||||
|
send.debug(Main.plugin,"input: " +input);
|
||||||
switch (subChannel) {
|
switch (subChannel) {
|
||||||
case "join":
|
case "join":
|
||||||
Main.bungeeplayers.add(input);
|
|
||||||
Main.bungeejoinplayers.add(input);
|
Main.bungeejoinplayers.add(input);
|
||||||
break;
|
break;
|
||||||
case "left":
|
case "left":
|
||||||
Main.bungeeplayers.remove(input);
|
|
||||||
Main.bungeejoinplayers.remove(input);
|
Main.bungeejoinplayers.remove(input);
|
||||||
break;
|
break;
|
||||||
case "clear":
|
case "clear":
|
||||||
Main.bungeeplayers.clear();
|
|
||||||
Main.bungeejoinplayers.clear();
|
Main.bungeejoinplayers.clear();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -3,7 +3,7 @@ package de.jatitv.commandguiv2.Spigot.system;
|
|||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
import com.mojang.authlib.properties.Property;
|
import com.mojang.authlib.properties.Property;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||||
@@ -11,7 +11,6 @@ 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 net.t2code.lib.Spigot.Lib.replace.Replace;
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Item;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
@@ -21,7 +20,6 @@ import java.lang.reflect.Field;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public class Give_UseItem {
|
public class Give_UseItem {
|
||||||
private static String prefix = Util.Prefix;
|
|
||||||
|
|
||||||
|
|
||||||
public static void onGive(Player player) {
|
public static void onGive(Player player) {
|
||||||
@@ -37,7 +35,10 @@ public class Give_UseItem {
|
|||||||
}
|
}
|
||||||
if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
||||||
player.getInventory().addItem(itemStack(player));
|
player.getInventory().addItem(itemStack(player));
|
||||||
} else player.getInventory().setItem(slot - 1, itemStack(player));
|
} else {
|
||||||
|
send.debug(Main.plugin,"setUseItem: " + player.getName() + " Slot: "+ Integer.parseInt(String.valueOf(slot-1)));
|
||||||
|
player.getInventory().setItem(slot - 1, itemStack(player));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onGiveADD(Player player) {
|
public static void onGiveADD(Player player) {
|
||||||
@@ -58,8 +59,8 @@ public class Give_UseItem {
|
|||||||
playerheadmeta.setDisplayName(SelectConfig.UseItem_Name);
|
playerheadmeta.setDisplayName(SelectConfig.UseItem_Name);
|
||||||
if (SelectConfig.UseItem_Base64_Enable) {
|
if (SelectConfig.UseItem_Base64_Enable) {
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
playerheadmeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore));
|
playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
|
||||||
} else playerheadmeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore));
|
} else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_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.UseItem_Base64value));
|
||||||
Field profileField = null;
|
Field profileField = null;
|
||||||
@@ -77,8 +78,8 @@ public class Give_UseItem {
|
|||||||
} else p = SelectConfig.UseItem_PlayerName;
|
} else p = SelectConfig.UseItem_PlayerName;
|
||||||
playerheadmeta.setOwner(p);
|
playerheadmeta.setOwner(p);
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
playerheadmeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore));
|
playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
|
||||||
} else playerheadmeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore));
|
} else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore));
|
||||||
}
|
}
|
||||||
item.setItemMeta(playerheadmeta);
|
item.setItemMeta(playerheadmeta);
|
||||||
}
|
}
|
||||||
@@ -87,8 +88,8 @@ public class Give_UseItem {
|
|||||||
ItemMeta itemMeta = item.getItemMeta();
|
ItemMeta itemMeta = item.getItemMeta();
|
||||||
itemMeta.setDisplayName(SelectConfig.UseItem_Name);
|
itemMeta.setDisplayName(SelectConfig.UseItem_Name);
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
itemMeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore));
|
itemMeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
|
||||||
} else itemMeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore));
|
} else itemMeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore));
|
||||||
item.setItemMeta(itemMeta);
|
item.setItemMeta(itemMeta);
|
||||||
item.setAmount(1);
|
item.setAmount(1);
|
||||||
}
|
}
|
||||||
|
@@ -2,21 +2,20 @@ package de.jatitv.commandguiv2.Spigot.system;
|
|||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.GUI_Listener;
|
import de.jatitv.commandguiv2.Spigot.Listener.GUI_Listener;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events_from1_10;
|
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events_from1_10;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Admin;
|
|
||||||
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;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
|
import de.jatitv.commandguiv2.Spigot.config.DefaultGUICreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.LanguagesCreate;
|
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.PluginEvent;
|
import de.jatitv.commandguiv2.Spigot.Listener.PluginEvent;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.Objekte.Obj_Select;
|
import de.jatitv.commandguiv2.Spigot.Objekte.Obj_Select;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.ConfigCreate;
|
import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
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;
|
||||||
@@ -62,9 +61,13 @@ public class Load {
|
|||||||
|
|
||||||
if (SelectConfig.Bungee) {
|
if (SelectConfig.Bungee) {
|
||||||
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin,"cgui:bungee")){
|
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin,"cgui:bungee")){
|
||||||
send.debug(plugin, "registerIncomingPluginChannel §ecgui:bungee");
|
send.debug(plugin, "registerOutgoingPluginChannel §ecgui:bungee");
|
||||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin,"cgui:bungee");
|
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin,"cgui:bungee");
|
||||||
}
|
}
|
||||||
|
if (!Bukkit.getMessenger().isIncomingChannelRegistered(plugin,"cgui:onlinepl")){
|
||||||
|
send.debug(plugin, "registerIncomingPluginChannel §ecgui:onlinepl");
|
||||||
|
Bukkit.getMessenger().registerIncomingPluginChannel(plugin,"cgui:onlinepl", new Bungee_Sender_Reciver());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -4,7 +4,8 @@
|
|||||||
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.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
|
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;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -31,7 +32,7 @@ import java.util.zip.GZIPOutputStream;
|
|||||||
public class Metrics {
|
public class Metrics {
|
||||||
|
|
||||||
public static void Bstats() {
|
public static void Bstats() {
|
||||||
int pluginId = Main.bstatsID; // <-- Replace with the id of your plugin!
|
int pluginId = Util.getBstatsID(); // <-- Replace with the id of your plugin!
|
||||||
Metrics metrics = new Metrics(Main.plugin, pluginId);
|
Metrics metrics = new Metrics(Main.plugin, pluginId);
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("updatecheckonjoin", () -> String.valueOf(SelectConfig.UpdateCheckOnJoin)));
|
metrics.addCustomChart(new Metrics.SimplePie("updatecheckonjoin", () -> String.valueOf(SelectConfig.UpdateCheckOnJoin)));
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("storage_type_mysql", () -> SelectConfig.Storage));
|
metrics.addCustomChart(new Metrics.SimplePie("storage_type_mysql", () -> SelectConfig.Storage));
|
||||||
|
@@ -1,226 +0,0 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.config.config;
|
|
||||||
|
|
||||||
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.minecraftVersion.MCVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
|
|
||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
public class ConfigCreate {
|
|
||||||
|
|
||||||
private static String prefix = Util.Prefix;
|
|
||||||
|
|
||||||
public static Integer ConfigVersion = 2;
|
|
||||||
|
|
||||||
private static Boolean UpdateCheckOnJoin = true;
|
|
||||||
private static Boolean Debug = false;
|
|
||||||
private static Boolean HelpAlias = true;
|
|
||||||
private static String language = "english";
|
|
||||||
private static String Currency = "$";
|
|
||||||
private static String DefaultGUI = "default";
|
|
||||||
|
|
||||||
|
|
||||||
private static String Storage = "YML";
|
|
||||||
private static String ip = "localhost";
|
|
||||||
private static Integer port = 3306;
|
|
||||||
private static String database = "database";
|
|
||||||
private static String user = "root";
|
|
||||||
private static String password = "password";
|
|
||||||
private static Boolean SSL = false;
|
|
||||||
|
|
||||||
private static Boolean Bungee = false;
|
|
||||||
private static String thisServer = "server";
|
|
||||||
|
|
||||||
|
|
||||||
private static Boolean UseItem_Enable = true;
|
|
||||||
private static Boolean UseItem_AllowToggle = true;
|
|
||||||
private static Boolean UseItem_AllowSetSlot = true;
|
|
||||||
private static Boolean UseItem_BlockMoveAndDrop = true;
|
|
||||||
private static String UseItem_OpenGUI = "default";
|
|
||||||
private static Boolean UseItem_Permission = true;
|
|
||||||
private static Boolean UseItem_KeepAtCommandClear = true;
|
|
||||||
|
|
||||||
private static Integer UseItem_InventorySlot = 1;
|
|
||||||
private static Boolean UseItem_InventorySlotEnforce = false;
|
|
||||||
private static Boolean UseItem_InventorySlot_FreeSlot = false;
|
|
||||||
private static String UseItem_Material = "paper";
|
|
||||||
private static Boolean UseItem_PlayerHead_Enable = false;
|
|
||||||
private static Boolean base64_Enable = false;
|
|
||||||
private static String base64value= "";
|
|
||||||
private static Boolean UseItem_PlayerWhoHasOpenedTheGUI = false;
|
|
||||||
private static String UseItem_PlayerName = "";
|
|
||||||
private static String UseItem_Name = "&bDefault &6GUI";
|
|
||||||
private static List UseItem_Lore = Arrays.asList("&eThis is an example GUI");
|
|
||||||
private static Boolean UseItem_GiveOnEveryJoin = true;
|
|
||||||
private static Boolean UseItem_GiveOnlyOnFirstJoin = false;
|
|
||||||
private static Boolean Cursor_ToGUIItem_OnLogin = true;
|
|
||||||
private static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin = true;
|
|
||||||
private static Boolean Cursor_ServerChange_EXPERIMENTELL = false;
|
|
||||||
|
|
||||||
private static int UseItemGameModeChangeDelayInTicks = 1;
|
|
||||||
private static boolean UseItemGameModeChangeDisableInSpectator = true;
|
|
||||||
|
|
||||||
private static Boolean Sound_Enable = true;
|
|
||||||
|
|
||||||
private static Boolean Sound_OpenInventory_Enable = true;
|
|
||||||
public static String Sound_OpenInventory_1_8 = "CHEST_OPEN";
|
|
||||||
public static String Sound_OpenInventory_ab_1_9 = "BLOCK_CHEST_OPEN";
|
|
||||||
|
|
||||||
private static Boolean Sound_Click_Enable = true;
|
|
||||||
public static String Sound_Click_1_8 = "NOTE_STICKS";
|
|
||||||
public static String Sound_Click_1_9_bis_1_12 = "BLOCK_NOTE_HAT";
|
|
||||||
public static String Sound_Click_ab_1_13 = "BLOCK_NOTE_BLOCK_HAT";
|
|
||||||
|
|
||||||
private static Boolean Sound_NoMoney_Enable = true;
|
|
||||||
public static String Sound_NoMoney_1_8 = "NOTE_PIANO";
|
|
||||||
public static String Sound_NoMoney_1_9_bis_1_12 = "BLOCK_NOTE_HARP";
|
|
||||||
public static String Sound_NoMoney_ab_1_13 = "BLOCK_NOTE_BLOCK_HARP";
|
|
||||||
|
|
||||||
private static Boolean Sound_NoInventorySpace_Enable = true;
|
|
||||||
public static String Sound_NoInventorySpace_1_8 = "NOTE_PIANO";
|
|
||||||
public static String Sound_NoInventorySpace_1_9_bis_1_12 = "BLOCK_NOTE_HARP";
|
|
||||||
public static String Sound_NoInventorySpace_ab_1_13 = "BLOCK_NOTE_BLOCK_HARP";
|
|
||||||
|
|
||||||
private static Boolean Sound_Give_Enable = true;
|
|
||||||
public static String Sound_Give_1_8 = "LEVEL_UP";
|
|
||||||
public static String Sound_Give_ab_1_9 = "ENTITY_PLAYER_LEVELUP";
|
|
||||||
|
|
||||||
private static Boolean Sound_PlayerNotFound_Enable = true;
|
|
||||||
public static String Sound_PlayerNotFound_1_8 = "NOTE_PIANO";
|
|
||||||
public static String Sound_PlayerNotFound_1_9_bis_1_12 = "BLOCK_NOTE_HARP";
|
|
||||||
public static String Sound_PlayerNotFound_ab_1_13 = "BLOCK_NOTE_BLOCK_HARP";
|
|
||||||
|
|
||||||
|
|
||||||
public static void configCreate() {
|
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
|
||||||
if (new File(Main.getPath(), "config.yml").exists()){
|
|
||||||
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Main.prefix + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
|
||||||
} else send.console(Main.prefix + " §4config.yml are created...");
|
|
||||||
|
|
||||||
|
|
||||||
File config = new File(Main.getPath(), "config.yml");
|
|
||||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
|
||||||
|
|
||||||
yamlConfiguration.set("ConfigVersion", ConfigVersion);
|
|
||||||
|
|
||||||
Config.set("Plugin.UpdateCheckOnJoin", UpdateCheckOnJoin, yamlConfiguration);
|
|
||||||
Config.set("Plugin.Debug", Debug, yamlConfiguration);
|
|
||||||
Config.set("Plugin.HelpAlias", HelpAlias, yamlConfiguration);
|
|
||||||
Config.set("Plugin.language", language, yamlConfiguration);
|
|
||||||
Config.set("Plugin.Currency", Currency, yamlConfiguration);
|
|
||||||
Config.set("Plugin.DefaultGUI", DefaultGUI, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Storage.Type", Storage, yamlConfiguration);
|
|
||||||
Config.set("Storage.MySQL.IP", ip, yamlConfiguration);
|
|
||||||
Config.set("Storage.MySQL.Port", port, yamlConfiguration);
|
|
||||||
Config.set("Storage.MySQL.Database", database, yamlConfiguration);
|
|
||||||
Config.set("Storage.MySQL.User", user, yamlConfiguration);
|
|
||||||
Config.set("Storage.MySQL.Password", password, yamlConfiguration);
|
|
||||||
Config.set("Storage.MySQL.SSL", SSL, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("BungeeCord.Enable", Bungee, yamlConfiguration);
|
|
||||||
Config.set("BungeeCord.ThisServer", thisServer, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("UseItem.Enable", UseItem_Enable, yamlConfiguration);
|
|
||||||
Config.set("UseItem.AllowToggle", UseItem_AllowToggle, yamlConfiguration);
|
|
||||||
Config.set("UseItem.AllowSetSlot", UseItem_AllowSetSlot, yamlConfiguration);
|
|
||||||
Config.set("UseItem.BlockMoveAndDrop", UseItem_BlockMoveAndDrop, yamlConfiguration);
|
|
||||||
Config.set("UseItem.OpenGUI", UseItem_OpenGUI, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Permission.NeededToUse", UseItem_Permission, yamlConfiguration);
|
|
||||||
Config.set("UseItem.KeepAtCommandClear", UseItem_KeepAtCommandClear, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("UseItem.InventorySlot.Slot", UseItem_InventorySlot, yamlConfiguration);
|
|
||||||
Config.set("UseItem.InventorySlot.SlotEnforce", UseItem_InventorySlotEnforce, yamlConfiguration);
|
|
||||||
Config.set("UseItem.InventorySlot.FreeSlot", UseItem_InventorySlot_FreeSlot, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("UseItem.Item.Material", UseItem_Material, yamlConfiguration);
|
|
||||||
if (!(MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12)) {
|
|
||||||
Config.set("UseItem.Item.PlayerHead.Enable", UseItem_PlayerHead_Enable, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Item.PlayerHead.Base64.Enable", base64_Enable, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Item.PlayerHead.Base64.Base64Value", base64value, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", UseItem_PlayerWhoHasOpenedTheGUI, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Item.PlayerHead.Playername", UseItem_PlayerName, yamlConfiguration);
|
|
||||||
}
|
|
||||||
Config.set("UseItem.Item.Name", UseItem_Name, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Item.Lore", UseItem_Lore, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Join.GiveOnEveryJoin", UseItem_GiveOnEveryJoin, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Join.GiveOnlyOnFirstJoin", UseItem_GiveOnlyOnFirstJoin, yamlConfiguration);
|
|
||||||
|
|
||||||
//convert
|
|
||||||
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin")){
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin", yamlConfiguration);
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin"), yamlConfiguration);
|
|
||||||
}
|
|
||||||
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin")){
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin", yamlConfiguration);
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin"), yamlConfiguration);
|
|
||||||
}
|
|
||||||
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange")){
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange", yamlConfiguration);
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange"), yamlConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", Cursor_ToGUIItem_OnLogin, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", Cursor_ToGUIItem_OnlyOnFirstLogin, yamlConfiguration);
|
|
||||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", Cursor_ServerChange_EXPERIMENTELL, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Advanced.UseItem.GameModeChange.DelayInTicks", UseItemGameModeChangeDelayInTicks, yamlConfiguration);
|
|
||||||
Config.set("Advanced.UseItem.GameModeChange.DisableInSpectator", UseItemGameModeChangeDisableInSpectator, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Sound.Enable", Sound_Enable, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Sound.OpenInventory.Enable", Sound_OpenInventory_Enable, yamlConfiguration);
|
|
||||||
if (MCVersion.minecraft1_8) {
|
|
||||||
Config.set("Sound.OpenInventory.Sound", Sound_OpenInventory_1_8, yamlConfiguration);
|
|
||||||
} else Config.set("Sound.OpenInventory.Sound", Sound_OpenInventory_ab_1_9, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Sound.Click.Enable", Sound_Click_Enable, yamlConfiguration);
|
|
||||||
if (MCVersion.minecraft1_8) {
|
|
||||||
Config.set("Sound.Click.Sound", Sound_Click_1_8, yamlConfiguration);
|
|
||||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
|
||||||
Config.set("Sound.Click.Sound", Sound_Click_1_9_bis_1_12, yamlConfiguration);
|
|
||||||
} else Config.set("Sound.Click.Sound", Sound_Click_ab_1_13, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Sound.NoMoney.Enable", Sound_NoMoney_Enable, yamlConfiguration);
|
|
||||||
if (MCVersion.minecraft1_8) {
|
|
||||||
Config.set("Sound.NoMoney.Sound", Sound_NoMoney_1_8, yamlConfiguration);
|
|
||||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
|
||||||
Config.set("Sound.NoMoney.Sound", Sound_NoMoney_1_9_bis_1_12, yamlConfiguration);
|
|
||||||
} else Config.set("Sound.NoMoney.Sound", Sound_NoMoney_ab_1_13, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Sound.NoInventorySpace.Enable", Sound_NoInventorySpace_Enable, yamlConfiguration);
|
|
||||||
if (MCVersion.minecraft1_8) {
|
|
||||||
Config.set("Sound.NoInventorySpace.Sound", Sound_NoInventorySpace_1_8, yamlConfiguration);
|
|
||||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
|
||||||
Config.set("Sound.NoInventorySpace.Sound", Sound_NoInventorySpace_1_9_bis_1_12, yamlConfiguration);
|
|
||||||
} else Config.set("Sound.NoInventorySpace.Sound", Sound_NoInventorySpace_ab_1_13, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Sound.Give.Enable", Sound_Give_Enable, yamlConfiguration);
|
|
||||||
if (MCVersion.minecraft1_8) {
|
|
||||||
Config.set("Sound.Give.Sound", Sound_Give_1_8, yamlConfiguration);
|
|
||||||
} else Config.set("Sound.Give.Sound", Sound_Give_ab_1_9, yamlConfiguration);
|
|
||||||
|
|
||||||
Config.set("Sound.PlayerNotFound.Enable", Sound_PlayerNotFound_Enable, yamlConfiguration);
|
|
||||||
if (MCVersion.minecraft1_8) {
|
|
||||||
Config.set("Sound.PlayerNotFound.Sound", Sound_PlayerNotFound_1_8, yamlConfiguration);
|
|
||||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
|
||||||
Config.set("Sound.PlayerNotFound.Sound", Sound_PlayerNotFound_1_9_bis_1_12, yamlConfiguration);
|
|
||||||
} else Config.set("Sound.PlayerNotFound.Sound", Sound_PlayerNotFound_ab_1_13, yamlConfiguration);
|
|
||||||
|
|
||||||
try {
|
|
||||||
yamlConfiguration.save(config);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
send.console(Main.prefix + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,6 +1,6 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
package de.jatitv.commandguiv2.Spigot.system.database;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class Select_Database {
|
public class Select_Database {
|
||||||
|
@@ -1,10 +1,34 @@
|
|||||||
package de.jatitv.commandguiv2;
|
package de.jatitv.commandguiv2;
|
||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
public static double requiredT2CodeLibVersion = 8;
|
private static double requiredT2CodeLibVersion = 10.3;
|
||||||
public static String Prefix = "§8[§4C§9GUI§8]";
|
private static String Prefix = "§8[§4C§9GUI§8]";
|
||||||
public static Integer SpigotID = 90671;
|
private static Integer SpigotID = 90671;
|
||||||
public static Integer BstatsID = 10840;
|
private static Integer BstatsID = 10840;
|
||||||
public static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID;
|
private static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID;
|
||||||
public static String Discord = "http://dc.t2code.net";
|
private static String Discord = "http://dc.t2code.net";
|
||||||
|
|
||||||
|
public static double getRequiredT2CodeLibVersion() {
|
||||||
|
return requiredT2CodeLibVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPrefix() {
|
||||||
|
return Prefix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getSpigotID() {
|
||||||
|
return SpigotID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Integer getBstatsID() {
|
||||||
|
return BstatsID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getSpigot() {
|
||||||
|
return Spigot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getDiscord() {
|
||||||
|
return Discord;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,15 +1,13 @@
|
|||||||
package de.jatitv.commandguiv2.api;
|
package de.jatitv.commandguiv2.api;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.ItemChange;
|
import de.jatitv.commandguiv2.Spigot.Listener.ItemChange;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events_from1_10;
|
|
||||||
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;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
|
import de.jatitv.commandguiv2.Spigot.config.DefaultGUICreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@@ -17,10 +15,14 @@ public class CGuiAPI {
|
|||||||
public static Boolean JoinDisable = false;
|
public static Boolean JoinDisable = false;
|
||||||
|
|
||||||
public static void onItemChange(Player player) {
|
public static void onItemChange(Player player) {
|
||||||
ItemChange.itemChange(player);
|
ItemChange.itemChange(player, false);
|
||||||
|
}
|
||||||
|
public static void onItemChange(Player player, Boolean setCursor) {
|
||||||
|
ItemChange.itemChange(player, setCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void disableItemGiveOnJoin(Boolean disableItemGiveOnJoin) {
|
public static void disableItemGiveOnJoin(Boolean disableItemGiveOnJoin) {
|
||||||
|
send.debug(Main.plugin,"CGuiAPI: " +disableItemGiveOnJoin);
|
||||||
JoinDisable = disableItemGiveOnJoin;
|
JoinDisable = disableItemGiveOnJoin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,8 +0,0 @@
|
|||||||
MySQL:
|
|
||||||
Enable: false
|
|
||||||
IP: localhost
|
|
||||||
Port: 3306
|
|
||||||
Database: database
|
|
||||||
User: user
|
|
||||||
Password: ''
|
|
||||||
SSL: false
|
|
Reference in New Issue
Block a user