14 Commits

Author SHA1 Message Date
2f114cca41 Update guiDeclaration.yml 2022-06-28 13:25:38 +02:00
d0277deeb8 Update guiDeclaration.yml 2022-06-28 13:25:19 +02:00
a6dff7e243 2.8.4 | Minor code changes
In this update minor code changes were made to better structure the interaction with T2CodeLib
2022-06-28 08:25:23 +02:00
e2e649aef2 Revert "„README.md“ ändern"
This reverts commit 7c7cd51cec.
2022-06-10 03:20:24 +02:00
JaTiTV
7c7cd51cec „README.md“ ändern 2022-06-10 03:20:08 +02:00
e7f5b00b31 Bugfix 2022-06-09 04:06:26 +02:00
57ba6e6687 add new defaultconfigs 2022-06-08 06:01:47 +02:00
d168a7afec fix 2022-06-08 05:56:05 +02:00
92d3e9a2d8 files with explanations
NEW: In case of a new installation, files with explanations are now also created in the plugin folder
2022-06-08 05:50:18 +02:00
b45895dff8 Update Util.java 2022-06-08 05:14:56 +02:00
c43a5fd90c 2.8.2
Changes:
- The structure of config.yml has been slightly changed (nothing needs to be changed as the settings paths remain the same)
- The code structure has been rebuilt / improved

Fix:
- Fixed an error that occurred when a player joined the sever and immediately left.
2022-06-08 05:11:26 +02:00
48c06696ef 2.8.1
Bugfix for the AdminSubCommand option
2022-06-07 20:20:26 +02:00
16123ec578 2.8.1
Bugfix for the AdminSubCommand option
2022-06-07 20:16:50 +02:00
JaTiTV
7f2b346f7b Merge pull request '2.8.0-Voting' (#12) from 2.8.0-Voting into main
Reviewed-on: JaTiTV/CommandGUI#12
2022-06-07 20:16:33 +02:00
56 changed files with 2258 additions and 634 deletions

View File

@@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>CommandGUI_V2</artifactId> <artifactId>CommandGUI_V2</artifactId>
<version>2.8.0</version> <version>2.8.4</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>CommandGUI</name> <name>CommandGUI</name>
@@ -53,10 +53,7 @@
</build> </build>
<repositories> <repositories>
<repository> <!-- repo.t2code / T2Code -->
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository> <repository>
<id>Builders-Paradise</id> <id>Builders-Paradise</id>
<url>https://repo.t2code.net/repository/Builders-Paradise/</url> <url>https://repo.t2code.net/repository/Builders-Paradise/</url>
@@ -65,6 +62,7 @@
<id>T2Code</id> <id>T2Code</id>
<url>https://repo.t2code.net/repository/T2Code/</url> <url>https://repo.t2code.net/repository/T2Code/</url>
</repository> </repository>
<!-- placeholderAPI -->
<repository> <repository>
<id>placeholderapi</id> <id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url> <url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
@@ -72,26 +70,12 @@
</repositories> </repositories>
<dependencies> <dependencies>
<!-- repo.t2code / T2Code -->
<dependency> <dependency>
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>bungee</artifactId> <artifactId>bungee</artifactId>
<version>1615</version> <version>1615</version>
</dependency> </dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>PlugmanGUI</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>12.0</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>LuckyBox-API</artifactId>
<version>4.2.2</version>
</dependency>
<dependency> <dependency>
<groupId>net.t2code.minecraft.1_16.r2</groupId> <groupId>net.t2code.minecraft.1_16.r2</groupId>
<artifactId>spigot</artifactId> <artifactId>spigot</artifactId>
@@ -107,6 +91,29 @@
<artifactId>spigot</artifactId> <artifactId>spigot</artifactId>
<version>1.8r1</version> <version>1.8r1</version>
</dependency> </dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>PlugmanGUI</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>12.1</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>LuckyBox-API</artifactId>
<version>4.2.2</version>
</dependency>
<!-- placeholderAPI -->
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.1</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.zaxxer/HikariCP -->
<dependency> <dependency>
<groupId>com.zaxxer</groupId> <groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId> <artifactId>HikariCP</artifactId>
@@ -122,11 +129,6 @@
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<version>1.7.22</version> <version>1.7.22</version>
</dependency> </dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.1</version>
<scope>provided</scope>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -1,8 +1,5 @@
package de.jatitv.commandguiv2.Bungee; package de.jatitv.commandguiv2.Bungee;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
import de.jatitv.commandguiv2.Util;
import net.md_5.bungee.BungeeCord; import net.md_5.bungee.BungeeCord;
import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.connection.ProxiedPlayer; import net.md_5.bungee.api.connection.ProxiedPlayer;
@@ -35,7 +32,6 @@ public class BListener implements Listener {
} }
} }
} catch (IOException e) { } catch (IOException e) {
Main.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
e.printStackTrace(); e.printStackTrace();
} }
} }

View File

@@ -69,7 +69,7 @@ public final class BMain extends Plugin {
Bsend.console(prefix + "§4=============================================================================="); Bsend.console(prefix + "§4==============================================================================");
} }
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) { public static Boolean pluginNotFound(String pl, Integer spigotID, String 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: " +
@@ -78,10 +78,19 @@ public final class BMain extends Plugin {
BMain.plugin.onDisable(); BMain.plugin.onDisable();
return true; return true;
} else { } else {
if (Double.parseDouble(ProxyServer.getInstance().getPluginManager().getPlugin(pl).getDescription().getVersion()) < ver) { String plVer = ProxyServer.getInstance().getPluginManager().getPlugin(pl).getDescription().getVersion();
if (ver.contains("_")) {
if (!plVer.equals(ver)) {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
ProxyServer.getInstance().getConsole().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires the version §2" + ver + " §4of §6" + pl + " §4Please use this version! Please download it here or contact us in Discord: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " Or contact us in Discord: http://dc.t2code.net");
return true;
}
return false;
}
String[] split = plVer.split("_");
if (Double.parseDouble(split[0]) < Double.parseDouble(ver)) {
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 + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + "."); ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + ".");
// BMain.plugin.getPluginLoader().disablePlugin(BMain.plugin);
BMain.plugin.onDisable(); BMain.plugin.onDisable();
return true; return true;
} }

View File

@@ -4,7 +4,7 @@ package de.jatitv.commandguiv2.Spigot;
import de.jatitv.commandguiv2.Spigot.objects.functions.Function; import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
import de.jatitv.commandguiv2.Spigot.system.Load; import de.jatitv.commandguiv2.Spigot.system.Load;
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui; import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
import de.jatitv.commandguiv2.Spigot.system.database.MySQL; import de.jatitv.commandguiv2.Spigot.database.MySQL;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate; import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
@@ -18,7 +18,6 @@ import org.bukkit.plugin.java.JavaPlugin;
import java.io.File; import java.io.File;
import java.util.*; import java.util.*;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger;
public final class Main extends JavaPlugin { public final class Main extends JavaPlugin {
@@ -50,8 +49,6 @@ public final class Main extends JavaPlugin {
@Override @Override
public void onEnable() { public void onEnable() {
// Plugin startup logic // Plugin startup logic
// Plugin startup logic
Logger logger = this.getLogger();
plugin = this; plugin = this;
autor = plugin.getDescription().getAuthors(); autor = plugin.getDescription().getAuthors();
version = plugin.getDescription().getVersion(); version = plugin.getDescription().getVersion();
@@ -65,7 +62,6 @@ public final class Main extends JavaPlugin {
} }
Load.onLoad(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getSpigotID(), Util.getDiscord(), Util.getBstatsID()); Load.onLoad(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getSpigotID(), Util.getDiscord(), Util.getBstatsID());
enable = true; enable = true;
} }
public static void addonLoad() { public static void addonLoad() {
@@ -73,10 +69,12 @@ public final class Main extends JavaPlugin {
PlotSquaredGUI = true; PlotSquaredGUI = true;
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI")); addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
} }
if (PluginCheck.luckyBox()) { if (PluginCheck.luckyBox()) {
LuckyBox = true; LuckyBox = true;
addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox")); addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox"));
} }
if (PluginCheck.plugManGUI()) { if (PluginCheck.plugManGUI()) {
PlugManGUI = true; PlugManGUI = true;
addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI")); addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI"));
@@ -87,27 +85,32 @@ public final class Main extends JavaPlugin {
send.console(Util.getPrefix() + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!"); send.console(Util.getPrefix() + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!");
} }
public static Boolean pluginNotFound(String pl, Integer spigotID) { public static Boolean pluginNotFound(String pl, Integer spigotID, String ver) {
if (Bukkit.getPluginManager().getPlugin(pl) == null) { if (Bukkit.getPluginManager().getPlugin(pl) == null) {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: " + Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: "
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin."); + "§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
return true;
} else return false;
}
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) {
if (Bukkit.getPluginManager().getPlugin(pl) == null) {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4could not be found. Please download it here: " +
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
Main.plugin.getPluginLoader().disablePlugin(Main.plugin); Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
return true; return true;
} else { } else {
if (Double.parseDouble(Bukkit.getPluginManager().getPlugin(pl).getDescription().getVersion()) < ver) { String plVer = Bukkit.getPluginManager().getPlugin(pl).getDescription().getVersion();
if (ver.contains("_")) {
if (!plVer.equals(ver)) {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!"); plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + "."); Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires the version §2"
+ ver + " §4of §6" + pl + " §4Please use this version! Please download it here or contact us in Discord: §6https://spigotmc.org/resources/"
+ pl + "." + spigotID + " Or contact us in Discord: http://dc.t2code.net");
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
return true;
}
return false;
}
String[] split = plVer.split("_");
if (Double.parseDouble(split[0]) < Double.parseDouble(ver)) {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
Bukkit.getConsoleSender().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires at least version §2"
+ ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID
+ " §4to use this version of " + plugin.getDescription().getName() + ".");
Main.plugin.getPluginLoader().disablePlugin(Main.plugin); Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
return true; return true;
} }

View File

@@ -30,7 +30,7 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
Player player = (Player) sender; Player player = (Player) sender;
Commands.gui(player); Commands.gui(player);
} else { } else {
if (args[0].equals(SelectConfig.adminSubCommand)) { if (args[0].equals(SelectConfig.getAdminSubCommand())) {
if (args.length == 1) { if (args.length == 1) {
Help.sendHelp(sender, prefix); Help.sendHelp(sender, prefix);
return false; return false;
@@ -106,7 +106,7 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
Tab.tab(list, sender, 0, args, arg1); Tab.tab(list, sender, 0, args, arg1);
Tab.tab(list, sender, 0, SelectConfig.adminSubCommand, 1, args, arg2); Tab.tab(list, sender, 0, SelectConfig.getAdminSubCommand(), 1, args, arg2);
Tab.tab(list, sender, 1, "give", 2, args, "commandgui.giveitem.other", true); Tab.tab(list, sender, 1, "give", 2, args, "commandgui.giveitem.other", true);
// if (args.length == 1) { // if (args.length == 1) {
@@ -136,18 +136,5 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
return list; return list;
} }
public static boolean hasPermission(CommandSender sender, String permission) {
if (permission.equals("")) {
return true;
}
String[] Permissions = permission.split(";");
for (String perm : Permissions) {
if (sender.hasPermission(perm)) {
return true;
}
}
return false;
}
} }

View File

@@ -22,13 +22,13 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
Player player = (Player) sender; Player player = (Player) sender;
if (sender.hasPermission("commandgui.useitem.toggle")) { if (sender.hasPermission("commandgui.useitem.toggle")) {
if (args.length == 0) { if (args.length == 0) {
if (SelectConfig.UseItem_AllowToggle) { if (SelectConfig.getUseItem_AllowToggle()) {
Help.sendGUIItemHelp(sender); Help.sendGUIItemHelp(sender);
} else send.sender(sender, "§4UseItem toggle is disabled!");// todo } else send.sender(sender, "§4UseItem toggle is disabled!");// todo
} else { } else {
if (args.length == 1 || args.length == 2) { if (args.length == 1 || args.length == 2) {
if (sender instanceof Player) { if (sender instanceof Player) {
if (SelectConfig.UseItem_AllowToggle) { if (SelectConfig.getUseItem_AllowToggle()) {
switch (args[0].toLowerCase()) { switch (args[0].toLowerCase()) {
case "on": case "on":
Commands.itemOn(player); Commands.itemOn(player);
@@ -65,7 +65,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{ private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
put("on", "commandgui.useitem.toggle"); put("on", "commandgui.useitem.toggle");
put("off", "commandgui.useitem.toggle"); put("off", "commandgui.useitem.toggle");
if (SelectConfig.UseItem_AllowSetSlot) { if (SelectConfig.getUseItem_AllowSetSlot()) {
put("slot", "commandgui.useitem.toggle"); put("slot", "commandgui.useitem.toggle");
} }
}}; }};
@@ -74,7 +74,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) { public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
List<String> list = new ArrayList<>(); List<String> list = new ArrayList<>();
if (sender instanceof Player) { if (sender instanceof Player) {
if (SelectConfig.UseItem_AllowToggle) { if (SelectConfig.getUseItem_AllowToggle()) {
Player p = (Player) sender; Player p = (Player) sender;
if (args.length == 1) { if (args.length == 1) {
for (String command : arg1.keySet()) { for (String command : arg1.keySet()) {

View File

@@ -1,17 +1,19 @@
package de.jatitv.commandguiv2.Spigot.cmdManagement; package de.jatitv.commandguiv2.Spigot.cmdManagement;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events; import de.jatitv.commandguiv2.Spigot.useItem.Events;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select; import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui; import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister; import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI; import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
import de.jatitv.commandguiv2.Spigot.system.UseItem; import de.jatitv.commandguiv2.Spigot.useItem.UseItem;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate; import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.Permissions; import de.jatitv.commandguiv2.Spigot.system.Permissions;
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase; import de.jatitv.commandguiv2.Spigot.database.SelectDatabase;
import de.jatitv.commandguiv2.Spigot.sound.Sound;
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI; import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
@@ -58,13 +60,13 @@ public class Commands {
send.console(Util.getPrefix() + "§8-------------------------------"); send.console(Util.getPrefix() + "§8-------------------------------");
send.console(Util.getPrefix() + " §6Plugin reload..."); send.console(Util.getPrefix() + " §6Plugin reload...");
send.console(Util.getPrefix() + "§8-------------------------------"); send.console(Util.getPrefix() + "§8-------------------------------");
CmdExecuter_GUI.arg1.clear();
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
SelectConfig.onSelect(); SelectConfig.onSelect();
Main.plugin.reloadConfig(); Main.plugin.reloadConfig();
if (!Objects.equals(SelectDatabase.getStorage().toString(), SelectConfig.storage)) {
CmdExecuter_GUI.arg1.clear();
CmdExecuter_GUI.arg1.put(SelectConfig.getAdminSubCommand(), "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
if (!Objects.equals(SelectDatabase.getStorage().toString(), SelectConfig.getStorage())) {
if (sender instanceof Player) send.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!"); if (sender instanceof Player) send.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
send.warning(Main.plugin, "You have changed the storage medium! To apply this change, you must restart the server!"); send.warning(Main.plugin, "You have changed the storage medium! To apply this change, you must restart the server!");
} }
@@ -86,7 +88,7 @@ public class Commands {
e.printStackTrace(); e.printStackTrace();
} }
if (SelectConfig.Bungee) { if (SelectConfig.getBungee()) {
Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "commandgui:bungee"); Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "commandgui:bungee");
} }
@@ -100,25 +102,20 @@ public class Commands {
public static void give(CommandSender sender, Player target) { public static void give(CommandSender sender, Player target) {
if (Bukkit.getPlayer(target.getName()) != null) { if (Bukkit.getPlayer(target.getName()) != null) {
UseItem.giveUseItem(target); UseItem.giveUseItem(target);
send.sender(sender, SelectMessages.Give_Sender.replace("[player]", target.getName()).replace("[item]", SelectConfig.UseItem_Name)); send.sender(sender, SelectMessages.Give_Sender.replace("[player]", target.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
send.player(target, SelectMessages.Give_Receiver.replace("[sender]", sender.getName()).replace("[item]", SelectConfig.UseItem_Name)); send.player(target, SelectMessages.Give_Receiver.replace("[sender]", sender.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
if (SelectConfig.Sound_Give_Enable && SelectConfig.Sound_Enable) { Sound.play(target, SoundEnum.Give);
target.playSound(target.getLocation(), SelectConfig.Sound_Give, 3, 1);
}
} else { } else {
sender.sendMessage(SelectMessages.PlayerNotFond.replace("[player]", target.getName())); sender.sendMessage(SelectMessages.PlayerNotFond.replace("[player]", target.getName()));
if (SelectConfig.Sound_PlayerNotFound_Enable && SelectConfig.Sound_Enable) { if (sender instanceof Player) Sound.play((Player) sender, SoundEnum.PlayerNotFound);
if (sender instanceof Player)
((Player) sender).playSound(((Player) sender).getLocation(), SelectConfig.Sound_PlayerNotFound, 3, 1);
}
} }
} }
public static void itemOn(Player player) { public static void itemOn(Player player) {
UseItem.removeItem(player); UseItem.removeItem(player);
Integer slot = null; Integer slot = null;
if (SelectConfig.UseItem_InventorySlotEnforce) { if (SelectConfig.getUseItem_InventorySlotEnforce()) {
slot = SelectConfig.UseItem_InventorySlot; slot = SelectConfig.getUseItem_InventorySlot();
} else { } else {
slot = Events.useItemSlotHashMap.get(player.getName()); slot = Events.useItemSlotHashMap.get(player.getName());
} }
@@ -140,9 +137,7 @@ public class Commands {
send.player(player, SelectMessages.ItemON); send.player(player, SelectMessages.ItemON);
} else { } else {
send.player(player, SelectMessages.NoInventorySpace); send.player(player, SelectMessages.NoInventorySpace);
if (SelectConfig.Sound_NoInventorySpace_Enable && SelectConfig.Sound_Enable) { Sound.play(player,SoundEnum.NoInventorySpace);
player.playSound(player.getLocation(), SelectConfig.Sound_NoInventorySpace, 3, 1);
}
} }
} }
} }
@@ -154,7 +149,7 @@ public class Commands {
} }
public static void onSetSlot(Player player, Integer setSlot) { public static void onSetSlot(Player player, Integer setSlot) {
if (!SelectConfig.UseItem_AllowSetSlot) { if (!SelectConfig.getUseItem_AllowSetSlot()) {
send.player(player, Util.getPrefix() + " §4Function disabled"); send.player(player, Util.getPrefix() + " §4Function disabled");
return; return;
} }
@@ -175,7 +170,7 @@ public class Commands {
} }
} }
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(setSlot - 1) != null) { if (SelectConfig.getUseItem_InventorySlotEnforce() || player.getInventory().getItem(setSlot - 1) != null) {
send.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString())); send.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString()));
return; return;
} }
@@ -192,11 +187,11 @@ public class Commands {
} }
public static void gui(Player player) { public static void gui(Player player) {
if (Main.guiHashMap.containsKey(SelectConfig.DefaultGUI)) { if (Main.guiHashMap.containsKey(SelectConfig.getDefaultGUI())) {
Gui gui = Main.guiHashMap.get(SelectConfig.DefaultGUI); Gui gui = Main.guiHashMap.get(SelectConfig.getDefaultGUI());
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) { if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) { if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) {
OpenGUI.openGUI(player, SelectConfig.DefaultGUI, true); OpenGUI.openGUI(player, SelectConfig.getDefaultGUI(), true);
} else send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui") } else send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
.replace("[perm]", "commandgui.command")); .replace("[perm]", "commandgui.command"));
} else send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName)); } else send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));

View File

@@ -14,7 +14,7 @@ public class Help {
private static String prefix = Util.getPrefix(); private static String prefix = Util.getPrefix();
public static void sendHelp(CommandSender sender, String Prefix) { public static void sendHelp(CommandSender sender, String Prefix) {
Gui gui = Main.guiHashMap.get(SelectConfig.DefaultGUI); Gui gui = Main.guiHashMap.get(SelectConfig.getDefaultGUI());
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----"); send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
cgui(sender, gui); cgui(sender, gui);

View File

@@ -93,47 +93,6 @@ public class ConfigCreate {
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", true, yamlConfiguration); Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", true, yamlConfiguration);
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", false, yamlConfiguration); Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Change.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Change.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.List", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
Config.set("Advanced.UseItem.World.Change.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.World.Change.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
/*
Config.set("Advanced.UseItem.ItemBlockBlacklist", Arrays.asList("CHEST", "TRAPPED_CHEST", "FURNACE", "NOTE_BLOCK",
"CRAFTING_TABLE", "ENDER_CHEST", "ANVIL", "LOOM", "COMPOSTER", "BARREL", "SMOKER",
"BLAST_FURNACE", "CARTOGRAPHY_TABLE", "FLETCHING_TABLE", "GRINDSTONE", "SMITHING_TABLE", "STONECUTTER",
"HOPPER", "DISPENSER", "DROPPER", "REPEATER", "COMPARATOR", "LEVER", "DAYLIGHT_DETECTOR",
"STONE_BUTTON", "OAK_BUTTON", "SPRUCE_BUTTON", "BIRCH_BUTTON", "JUNGLE_BUTTON", "ACACIA_BUTTON", "DARK_OAK_BUTTON", "CRIMSON_BUTTON",
"IRON_DOOR", "OAK_DOOR", "SPRUCE_DOOR", "BIRCH_DOOR", "JUNGLE_DOOR", "ACACIA_DOOR", "DARK_OAK_DOOR", "CRIMSON_DOOR", "WARPED_DOOR",
"OAK_FENCE", "SPRUCE_FENCE", "BIRCH_FENCE", "JUNGLE_FENCE", "ACACIA_FENCE", "DARK_OAK_FENCE", "CRIMSON_FENCE", "WARPED_FENCE", "NETHER_BRICK_FENCE"), yamlConfiguration);
*/
if (!yamlConfiguration.contains("Advanced.UseItem.ItemBlockBlacklist")) {
List<String> materialList = Arrays.asList("BUTTON", "DOOR", "FENCE", "CHEST", "FURNACE", "NOTE_BLOCK", "CRAFTING_TABLE", "WORKBENCH",
"ANVIL", "LOOM", "COMPOSTER", "BARREL", "SMOKER", "BLAST_FURNACE", "CARTOGRAPHY_TABLE", "FLETCHING_TABLE", "GRINDSTONE",
"SMITHING_TABLE", "STONECUTTER", "HOPPER", "DISPENSER", "DROPPER", "REPEATER", "COMPARATOR", "LEVER", "DAYLIGHT_DETECTOR", "BREWING_STAND", "TRAPDOOR", "BEACON"
);
List<String> materialBlacklist = new ArrayList<>();
for (Material material : Material.values()) {
for (String target : materialList) {
if (material.toString().contains(target)) materialBlacklist.add(material.toString());
}
}
Config.set("Advanced.UseItem.ItemBlockBlacklist", materialBlacklist, yamlConfiguration);
}
Config.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration); Config.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration);
Config.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration); Config.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
if (Main.legacy) { if (Main.legacy) {
@@ -192,6 +151,35 @@ public class ConfigCreate {
Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration); Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration); } else Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Change.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Change.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.List", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
Config.set("Advanced.UseItem.World.Change.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.World.Change.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
if (!yamlConfiguration.contains("Advanced.UseItem.ItemBlockBlacklist")) {
List<String> materialList = Arrays.asList("BUTTON", "DOOR", "FENCE", "CHEST", "FURNACE", "NOTE_BLOCK", "CRAFTING_TABLE", "WORKBENCH",
"ANVIL", "LOOM", "COMPOSTER", "BARREL", "SMOKER", "BLAST_FURNACE", "CARTOGRAPHY_TABLE", "FLETCHING_TABLE", "GRINDSTONE",
"SMITHING_TABLE", "STONECUTTER", "HOPPER", "DISPENSER", "DROPPER", "REPEATER", "COMPARATOR", "LEVER", "DAYLIGHT_DETECTOR", "BREWING_STAND", "TRAPDOOR", "BEACON"
);
List<String> materialBlacklist = new ArrayList<>();
for (Material material : Material.values()) {
for (String target : materialList) {
if (material.toString().contains(target)) materialBlacklist.add(material.toString());
}
}
Config.set("Advanced.UseItem.ItemBlockBlacklist", materialBlacklist, yamlConfiguration);
}
try { try {
yamlConfiguration.save(config); yamlConfiguration.save(config);
} catch (IOException e) { } catch (IOException e) {

View File

@@ -3,7 +3,6 @@ package de.jatitv.commandguiv2.Spigot.config.config;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.configConverter.ConfigConverterUnderV5; import de.jatitv.commandguiv2.Spigot.config.configConverter.ConfigConverterUnderV5;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
@@ -17,102 +16,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class SelectConfig { public class SelectConfig {
public static Boolean Debug;
public static Boolean HelpAlias;
public static String adminSubCommand;
public static String language;
public static String Currency;
public static String storage;
public static Boolean Bungee;
public static String thisServer;
public static String DefaultGUI;
public static Boolean UseItem_Enable;
public static Boolean UseItem_AllowToggle;
public static Boolean UseItem_AllowSetSlot;
public static Boolean UseItem_GiveOnEveryJoin;
public static Boolean UseItem_GiveOnlyOnFirstJoin;
public static Boolean UseItem_ServerChange;
public static Boolean Cursor_ToGUIItem_OnLogin;
public static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin;
public static Boolean UseItem_BlockMoveAndDrop;
public static String UseItem_OpenGUI;
public static Boolean UseItem_Permission;
public static Boolean UseItem_KeepAtCommandClear;
public static Boolean UseItemGameModeChangeEnable;
public static int UseItemGameModeChangeDelayInTicks;
public static Boolean UseItemGameModeProtection;
public static Boolean UseItemGameModeRemoveItemWhenItIsDisabled;
public static String UseItemGameModeMode;
public static List<String> UseItemGameModeList;
public static Boolean UseItemWorldChangeEnable;
public static int UseItemWorldChangeDelayInTicks;
public static Boolean UseItemWorldProtection;
public static Boolean UseItemWorldRemoveItemWhenItIsDisabled;
public static String UseItemWorldMode;
public static List<String> UseItemWorldList;
public static List<String> UseItemItemBlockBlacklist;
public static Boolean disableInfoBySneak = false;
public static Boolean UseItem_InventorySlot_FreeSlot;
public static Integer UseItem_InventorySlot;
public static Boolean UseItem_InventorySlotEnforce;
public static String UseItem_Material;
public static Boolean UseItem_PlayerHead_Enable;
public static Boolean UseItem_Base64_Enable;
public static String UseItem_Base64value;
public static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
public static String UseItem_PlayerName;
public static String UseItem_Name;
public static List<String> UseItem_Lore;
public static Boolean toggleItemOnOrYesBase64;
public static String toggleItemOnOrYesBase64Value;
public static String toggleItemOnOrYesMaterial;
public static Boolean toggleItemOffOrNoBase64;
public static String toggleItemOffOrNoBase64Value;
public static String toggleItemOffOrNoMaterial;
public static String togglePermTrue;
public static String togglePermFalse;
public static String placeholderTrue;
public static String placeholderFalse;
public static Boolean Sound_Enable = true;
public static Boolean Sound_OpenInventory_Enable = true;
public static Sound Sound_OpenInventory;
public static String Sound_OpenInventory_input;
public static Boolean Sound_Click_Enable = true;
public static Sound Sound_Click;
public static String Sound_Click_input;
public static Boolean Sound_NoMoney_Enable = true;
public static Sound Sound_NoMoney;
public static String Sound_NoMoney_input;
public static Boolean Sound_NoInventorySpace_Enable = true;
public static Sound Sound_NoInventorySpace;
public static String Sound_NoInventorySpace_input;
public static Boolean Sound_Give_Enable = true;
public static Sound Sound_Give;
public static String Sound_Give_input;
public static Boolean Sound_PlayerNotFound_Enable = true;
public static Sound Sound_PlayerNotFound;
public static String Sound_PlayerNotFound_input;
public static void onSelect() { public static void onSelect() {
File config = new File(Main.getPath(), "config.yml"); File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config); YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
@@ -130,18 +33,18 @@ public class SelectConfig {
Debug = yamlConfiguration.getBoolean("Plugin.Debug"); Debug = yamlConfiguration.getBoolean("Plugin.Debug");
HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias"); HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
adminSubCommand = yamlConfiguration.getString("Plugin.AdminSubCommand"); adminSubCommand = yamlConfiguration.getString("Plugin.AdminSubCommand").toLowerCase();
language = yamlConfiguration.getString("Plugin.language"); language = yamlConfiguration.getString("Plugin.language");
Currency = yamlConfiguration.getString("Plugin.Currency"); Currency = yamlConfiguration.getString("Plugin.Currency");
DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI"); DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI");
storage = yamlConfiguration.getString("Storage.Type").toUpperCase(); storage = yamlConfiguration.getString("Storage.Type").toUpperCase();
MySQL.ip = yamlConfiguration.getString("Storage.MySQL.IP"); mysqlIp = yamlConfiguration.getString("Storage.MySQL.IP");
MySQL.port = yamlConfiguration.getInt("Storage.MySQL.Port"); mysqlPort = yamlConfiguration.getInt("Storage.MySQL.Port");
MySQL.database = yamlConfiguration.getString("Storage.MySQL.Database"); mysqlDatabase = yamlConfiguration.getString("Storage.MySQL.Database");
MySQL.user = yamlConfiguration.getString("Storage.MySQL.User"); mysqlUser = yamlConfiguration.getString("Storage.MySQL.User");
MySQL.password = yamlConfiguration.getString("Storage.MySQL.Password"); mysqlPassword = yamlConfiguration.getString("Storage.MySQL.Password");
MySQL.SSL = yamlConfiguration.getBoolean("Storage.MySQL.SSL"); mysqlSSL = yamlConfiguration.getBoolean("Storage.MySQL.SSL");
Bungee = yamlConfiguration.getBoolean("BungeeCord.Enable"); Bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
thisServer = yamlConfiguration.getString("BungeeCord.ThisServer"); thisServer = yamlConfiguration.getString("BungeeCord.ThisServer");
@@ -172,31 +75,6 @@ public class SelectConfig {
Cursor_ToGUIItem_OnlyOnFirstLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Spigot.OnlyOnFirstLogin"); Cursor_ToGUIItem_OnlyOnFirstLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Spigot.OnlyOnFirstLogin");
UseItem_ServerChange = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange"); UseItem_ServerChange = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange");
UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Change.Enable");
UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameMode.Change.DelayInTicks");
UseItemGameModeProtection = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.Enable");
UseItemGameModeRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled");
UseItemGameModeMode = yamlConfiguration.getString("Advanced.UseItem.GameMode.Protection.Mode");
List<String> gml = new ArrayList<>();
for (String gm : yamlConfiguration.getStringList("Advanced.UseItem.GameMode.Protection.List")) {
gml.add(gm.toUpperCase());
}
UseItemGameModeList = gml;
UseItemWorldChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.World.Change.Enable");
UseItemWorldChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.World.Change.DelayInTicks");
UseItemWorldProtection = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.Enable");
UseItemWorldRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled");
UseItemWorldMode = yamlConfiguration.getString("Advanced.UseItem.World.Protection.Mode");
UseItemWorldList = yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
if (yamlConfiguration.get("Advanced.UseItem.DisableInfoBySneak") != null) {
disableInfoBySneak = yamlConfiguration.getBoolean("Advanced.UseItem.DisableInfoBySneak");
}
UseItemItemBlockBlacklist = yamlConfiguration.getStringList("Advanced.UseItem.ItemBlockBlacklist");
toggleItemOnOrYesBase64 = yamlConfiguration.getBoolean("Toggle.Items.OnOrYes.Item.Base64.Enable"); toggleItemOnOrYesBase64 = yamlConfiguration.getBoolean("Toggle.Items.OnOrYes.Item.Base64.Enable");
toggleItemOnOrYesBase64Value = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Base64.Base64Value"); toggleItemOnOrYesBase64Value = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Base64.Base64Value");
toggleItemOnOrYesMaterial = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Material"); toggleItemOnOrYesMaterial = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Material");
@@ -225,6 +103,31 @@ public class SelectConfig {
Sound_Give_input = (yamlConfiguration.getString("Sound.Give.Sound").toUpperCase().replace(".", "_")); Sound_Give_input = (yamlConfiguration.getString("Sound.Give.Sound").toUpperCase().replace(".", "_"));
Sound_PlayerNotFound_Enable = yamlConfiguration.getBoolean("Sound.PlayerNotFound.Enable"); Sound_PlayerNotFound_Enable = yamlConfiguration.getBoolean("Sound.PlayerNotFound.Enable");
Sound_PlayerNotFound_input = (yamlConfiguration.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_")); Sound_PlayerNotFound_input = (yamlConfiguration.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_"));
UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Change.Enable");
UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameMode.Change.DelayInTicks");
UseItemGameModeProtection = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.Enable");
UseItemGameModeRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled");
UseItemGameModeMode = yamlConfiguration.getString("Advanced.UseItem.GameMode.Protection.Mode");
List<String> gml = new ArrayList<>();
for (String gm : yamlConfiguration.getStringList("Advanced.UseItem.GameMode.Protection.List")) {
gml.add(gm.toUpperCase());
}
UseItemGameModeList = gml;
UseItemWorldChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.World.Change.Enable");
UseItemWorldChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.World.Change.DelayInTicks");
UseItemWorldProtection = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.Enable");
UseItemWorldRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled");
UseItemWorldMode = yamlConfiguration.getString("Advanced.UseItem.World.Protection.Mode");
UseItemWorldList = yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
if (yamlConfiguration.get("Advanced.UseItem.DisableInfoBySneak") != null) {
disableInfoBySneak = yamlConfiguration.getBoolean("Advanced.UseItem.DisableInfoBySneak");
}
UseItemItemBlockBlacklist = yamlConfiguration.getStringList("Advanced.UseItem.ItemBlockBlacklist");
} }
@@ -358,4 +261,431 @@ public class SelectConfig {
e.printStackTrace(); e.printStackTrace();
} }
} }
private static Boolean Debug;
private static Boolean HelpAlias;
private static String adminSubCommand;
private static String language;
private static String Currency;
private static String storage;
private static String mysqlIp;
private static Integer mysqlPort;
private static String mysqlDatabase;
private static String mysqlUser;
private static String mysqlPassword;
private static Boolean mysqlSSL;
private static Boolean Bungee;
private static String thisServer;
private static String DefaultGUI;
private static Boolean UseItem_Enable;
private static Boolean UseItem_AllowToggle;
private static Boolean UseItem_AllowSetSlot;
private static Boolean UseItem_GiveOnEveryJoin;
private static Boolean UseItem_GiveOnlyOnFirstJoin;
private static Boolean UseItem_ServerChange;
private static Boolean Cursor_ToGUIItem_OnLogin;
private static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin;
private static Boolean UseItem_BlockMoveAndDrop;
private static String UseItem_OpenGUI;
private static Boolean UseItem_Permission;
private static Boolean UseItem_KeepAtCommandClear;
private static Boolean UseItemGameModeChangeEnable;
private static int UseItemGameModeChangeDelayInTicks;
private static Boolean UseItemGameModeProtection;
private static Boolean UseItemGameModeRemoveItemWhenItIsDisabled;
private static String UseItemGameModeMode;
private static List<String> UseItemGameModeList;
private static Boolean UseItemWorldChangeEnable;
private static int UseItemWorldChangeDelayInTicks;
private static Boolean UseItemWorldProtection;
private static Boolean UseItemWorldRemoveItemWhenItIsDisabled;
private static String UseItemWorldMode;
private static List<String> UseItemWorldList;
private static List<String> UseItemItemBlockBlacklist;
private static Boolean disableInfoBySneak = false;
private static Boolean UseItem_InventorySlot_FreeSlot;
private static Integer UseItem_InventorySlot;
private static Boolean UseItem_InventorySlotEnforce;
private static String UseItem_Material;
private static Boolean UseItem_PlayerHead_Enable;
private static Boolean UseItem_Base64_Enable;
private static String UseItem_Base64value;
private static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
private static String UseItem_PlayerName;
private static String UseItem_Name;
private static List<String> UseItem_Lore;
private static Boolean toggleItemOnOrYesBase64;
private static String toggleItemOnOrYesBase64Value;
private static String toggleItemOnOrYesMaterial;
private static Boolean toggleItemOffOrNoBase64;
private static String toggleItemOffOrNoBase64Value;
private static String toggleItemOffOrNoMaterial;
private static String togglePermTrue;
private static String togglePermFalse;
private static String placeholderTrue;
private static String placeholderFalse;
private static Boolean Sound_Enable = true;
private static Boolean Sound_OpenInventory_Enable = true;
private static Sound Sound_OpenInventory;
private static String Sound_OpenInventory_input;
private static Boolean Sound_Click_Enable = true;
private static Sound Sound_Click;
private static String Sound_Click_input;
private static Boolean Sound_NoMoney_Enable = true;
private static Sound Sound_NoMoney;
private static String Sound_NoMoney_input;
private static Boolean Sound_NoInventorySpace_Enable = true;
private static Sound Sound_NoInventorySpace;
private static String Sound_NoInventorySpace_input;
private static Boolean Sound_Give_Enable = true;
private static Sound Sound_Give;
private static String Sound_Give_input;
private static Boolean Sound_PlayerNotFound_Enable = true;
private static Sound Sound_PlayerNotFound;
private static String Sound_PlayerNotFound_input;
public static Boolean getDebug() {
return Debug;
}
public static Boolean getHelpAlias() {
return HelpAlias;
}
public static String getAdminSubCommand() {
return adminSubCommand;
}
public static String getLanguage() {
return language;
}
public static String getCurrency() {
return Currency;
}
public static String getStorage() {
return storage;
}
public static String getMysqlIp() {
return mysqlIp;
}
public static Integer getMysqlPort() {
return mysqlPort;
}
public static String getMysqlDatabase() {
return mysqlDatabase;
}
public static String getMysqlUser() {
return mysqlUser;
}
public static String getMysqlPassword() {
return mysqlPassword;
}
public static Boolean getMysqlSSL() {
return mysqlSSL;
}
public static Boolean getBungee() {
return Bungee;
}
public static String getThisServer() {
return thisServer;
}
public static String getDefaultGUI() {
return DefaultGUI;
}
public static Boolean getUseItem_Enable() {
return UseItem_Enable;
}
public static Boolean getUseItem_AllowToggle() {
return UseItem_AllowToggle;
}
public static Boolean getUseItem_AllowSetSlot() {
return UseItem_AllowSetSlot;
}
public static Boolean getUseItem_GiveOnEveryJoin() {
return UseItem_GiveOnEveryJoin;
}
public static Boolean getUseItem_GiveOnlyOnFirstJoin() {
return UseItem_GiveOnlyOnFirstJoin;
}
public static Boolean getUseItem_ServerChange() {
return UseItem_ServerChange;
}
public static Boolean getCursor_ToGUIItem_OnLogin() {
return Cursor_ToGUIItem_OnLogin;
}
public static Boolean getCursor_ToGUIItem_OnlyOnFirstLogin() {
return Cursor_ToGUIItem_OnlyOnFirstLogin;
}
public static Boolean getUseItem_BlockMoveAndDrop() {
return UseItem_BlockMoveAndDrop;
}
public static String getUseItem_OpenGUI() {
return UseItem_OpenGUI;
}
public static Boolean getUseItem_Permission() {
return UseItem_Permission;
}
public static Boolean getUseItem_KeepAtCommandClear() {
return UseItem_KeepAtCommandClear;
}
public static Boolean getUseItemGameModeChangeEnable() {
return UseItemGameModeChangeEnable;
}
public static int getUseItemGameModeChangeDelayInTicks() {
return UseItemGameModeChangeDelayInTicks;
}
public static Boolean getUseItemGameModeProtection() {
return UseItemGameModeProtection;
}
public static Boolean getUseItemGameModeRemoveItemWhenItIsDisabled() {
return UseItemGameModeRemoveItemWhenItIsDisabled;
}
public static String getUseItemGameModeMode() {
return UseItemGameModeMode;
}
public static List<String> getUseItemGameModeList() {
return UseItemGameModeList;
}
public static Boolean getUseItemWorldChangeEnable() {
return UseItemWorldChangeEnable;
}
public static int getUseItemWorldChangeDelayInTicks() {
return UseItemWorldChangeDelayInTicks;
}
public static Boolean getUseItemWorldProtection() {
return UseItemWorldProtection;
}
public static Boolean getUseItemWorldRemoveItemWhenItIsDisabled() {
return UseItemWorldRemoveItemWhenItIsDisabled;
}
public static String getUseItemWorldMode() {
return UseItemWorldMode;
}
public static List<String> getUseItemWorldList() {
return UseItemWorldList;
}
public static List<String> getUseItemItemBlockBlacklist() {
return UseItemItemBlockBlacklist;
}
public static Boolean getDisableInfoBySneak() {
return disableInfoBySneak;
}
public static Boolean getUseItem_InventorySlot_FreeSlot() {
return UseItem_InventorySlot_FreeSlot;
}
public static Integer getUseItem_InventorySlot() {
return UseItem_InventorySlot;
}
public static Boolean getUseItem_InventorySlotEnforce() {
return UseItem_InventorySlotEnforce;
}
public static String getUseItem_Material() {
return UseItem_Material;
}
public static Boolean getUseItem_PlayerHead_Enable() {
return UseItem_PlayerHead_Enable;
}
public static Boolean getUseItem_Base64_Enable() {
return UseItem_Base64_Enable;
}
public static String getUseItem_Base64value() {
return UseItem_Base64value;
}
public static Boolean getUseItem_PlayerWhoHasOpenedTheGUI() {
return UseItem_PlayerWhoHasOpenedTheGUI;
}
public static String getUseItem_PlayerName() {
return UseItem_PlayerName;
}
public static String getUseItem_Name() {
return UseItem_Name;
}
public static List<String> getUseItem_Lore() {
return UseItem_Lore;
}
public static Boolean getToggleItemOnOrYesBase64() {
return toggleItemOnOrYesBase64;
}
public static String getToggleItemOnOrYesBase64Value() {
return toggleItemOnOrYesBase64Value;
}
public static String getToggleItemOnOrYesMaterial() {
return toggleItemOnOrYesMaterial;
}
public static Boolean getToggleItemOffOrNoBase64() {
return toggleItemOffOrNoBase64;
}
public static String getToggleItemOffOrNoBase64Value() {
return toggleItemOffOrNoBase64Value;
}
public static String getToggleItemOffOrNoMaterial() {
return toggleItemOffOrNoMaterial;
}
public static String getTogglePermTrue() {
return togglePermTrue;
}
public static String getTogglePermFalse() {
return togglePermFalse;
}
public static String getPlaceholderTrue() {
return placeholderTrue;
}
public static String getPlaceholderFalse() {
return placeholderFalse;
}
public static Boolean getSound_Enable() {
return Sound_Enable;
}
public static Boolean getSound_OpenInventory_Enable() {
return Sound_OpenInventory_Enable;
}
public static Sound getSound_OpenInventory() {
return Sound_OpenInventory;
}
public static String getSound_OpenInventory_input() {
return Sound_OpenInventory_input;
}
public static Boolean getSound_Click_Enable() {
return Sound_Click_Enable;
}
public static Sound getSound_Click() {
return Sound_Click;
}
public static String getSound_Click_input() {
return Sound_Click_input;
}
public static Boolean getSound_NoMoney_Enable() {
return Sound_NoMoney_Enable;
}
public static Sound getSound_NoMoney() {
return Sound_NoMoney;
}
public static String getSound_NoMoney_input() {
return Sound_NoMoney_input;
}
public static Boolean getSound_NoInventorySpace_Enable() {
return Sound_NoInventorySpace_Enable;
}
public static Sound getSound_NoInventorySpace() {
return Sound_NoInventorySpace;
}
public static String getSound_NoInventorySpace_input() {
return Sound_NoInventorySpace_input;
}
public static Boolean getSound_Give_Enable() {
return Sound_Give_Enable;
}
public static Sound getSound_Give() {
return Sound_Give;
}
public static String getSound_Give_input() {
return Sound_Give_input;
}
public static Boolean getSound_PlayerNotFound_Enable() {
return Sound_PlayerNotFound_Enable;
}
public static Sound getSound_PlayerNotFound() {
return Sound_PlayerNotFound;
}
public static String getSound_PlayerNotFound_input() {
return Sound_PlayerNotFound_input;
}
} }

View File

@@ -2,14 +2,13 @@ package de.jatitv.commandguiv2.Spigot.config.configConverter;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.functions.CreateFunctions; import de.jatitv.commandguiv2.Spigot.config.functions.CreateFunctions;
import de.jatitv.commandguiv2.Spigot.system.FunctionItemEnum; import de.jatitv.commandguiv2.Spigot.enums.FunctionItemEnum;
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum; import de.jatitv.commandguiv2.Spigot.enums.FunctionVoteEnum;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;

View File

@@ -1,11 +1,10 @@
package de.jatitv.commandguiv2.Spigot.config.functions; package de.jatitv.commandguiv2.Spigot.config.functions;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.FunctionItemEnum; import de.jatitv.commandguiv2.Spigot.enums.FunctionItemEnum;
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum; import de.jatitv.commandguiv2.Spigot.enums.FunctionVoteEnum;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File; import java.io.File;

View File

@@ -88,17 +88,17 @@ public class SelectMessages {
File msg; File msg;
msg = new File(Main.getPath(), "languages/" + SelectConfig.language + "_messages.yml"); msg = new File(Main.getPath(), "languages/" + SelectConfig.getLanguage() + "_messages.yml");
if (!msg.isFile()) { if (!msg.isFile()) {
send.console(Prefix); send.console(Prefix);
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
send.console(Prefix + " §4The selected §c" + SelectConfig.language + " §4language file was not found."); send.console(Prefix + " §4The selected §c" + SelectConfig.getLanguage() + " §4language file was not found.");
send.console(Prefix + " §6The default language §eEnglish §6is used!"); send.console(Prefix + " §6The default language §eEnglish §6is used!");
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
send.console(Prefix); send.console(Prefix);
msg = new File(Main.getPath(), "languages/" + "english_messages.yml"); msg = new File(Main.getPath(), "languages/" + "english_messages.yml");
selectMSG = "english"; selectMSG = "english";
} else selectMSG = SelectConfig.language; } else selectMSG = SelectConfig.getLanguage();
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg); YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg);
VaultNotSetUp = select("Plugin.VaultNotSetUp", yamlConfiguration_msg); VaultNotSetUp = select("Plugin.VaultNotSetUp", yamlConfiguration_msg);

View File

@@ -1,4 +1,4 @@
package de.jatitv.commandguiv2.Spigot.system.database; package de.jatitv.commandguiv2.Spigot.database;
import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource; import com.zaxxer.hikari.HikariDataSource;
@@ -6,7 +6,6 @@ import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.Bukkit;
import java.sql.*; import java.sql.*;
import java.time.ZoneId; import java.time.ZoneId;
@@ -15,13 +14,7 @@ import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
public class MySQL { public class MySQL {
public static String ip = "localhost";
public static Integer port = 3306;
public static String database;
public static String user = "root";
public static String password = "";
protected static String url;
public static Boolean SSL;
private static final HikariConfig config = new HikariConfig(); private static final HikariConfig config = new HikariConfig();
private static HikariDataSource ds; private static HikariDataSource ds;
@@ -31,9 +24,11 @@ public class MySQL {
ZoneId timeZone = now.getTimeZone().toZoneId(); ZoneId timeZone = now.getTimeZone().toZoneId();
send.debug(Main.plugin, "Server TimeZone is : " + timeZone); send.debug(Main.plugin, "Server TimeZone is : " + timeZone);
try { try {
config.setJdbcUrl("jdbc:mysql://" + ip + ":" + port + "/" + database + "?useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&autoReconnect=true&serverTimezone=" + timeZone + "&useSSL=" + SSL); config.setJdbcUrl("jdbc:mysql://" + SelectConfig.getMysqlIp() + ":" + SelectConfig.getMysqlPort() + "/" + SelectConfig.getMysqlDatabase()
config.setUsername(user); + "?useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&autoReconnect=true&serverTimezone=" + timeZone
config.setPassword(password); + "&useSSL=" + SelectConfig.getMysqlSSL());
config.setUsername(SelectConfig.getMysqlUser());
config.setPassword(SelectConfig.getMysqlPassword());
config.addDataSourceProperty("cachePrepStmts", "true"); config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", "250"); config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048"); config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
@@ -44,7 +39,7 @@ public class MySQL {
send.error(Main.plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms"); send.error(Main.plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
} }
if (SelectConfig.Debug || Main.version.toLowerCase().contains("dev") || Main.version.toLowerCase().contains("beta") || Main.version.toLowerCase().contains("snapshot")) { if (SelectConfig.getDebug() || Main.version.toLowerCase().contains("dev") || Main.version.toLowerCase().contains("beta") || Main.version.toLowerCase().contains("snapshot")) {
try { try {
send.error(Main.plugin, "MySQL DEBUG:"); send.error(Main.plugin, "MySQL DEBUG:");
Connection con = ds.getConnection(); Connection con = ds.getConnection();

View File

@@ -1,4 +1,4 @@
package de.jatitv.commandguiv2.Spigot.system.database; package de.jatitv.commandguiv2.Spigot.database;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;

View File

@@ -1,20 +1,21 @@
package de.jatitv.commandguiv2.Spigot.system.database; package de.jatitv.commandguiv2.Spigot.database;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events; import de.jatitv.commandguiv2.Spigot.useItem.Events;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.enums.StorageEnum;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import java.sql.SQLException; import java.sql.SQLException;
public class SelectDatabase { public class SelectDatabase {
private static StorageType Storage; private static StorageEnum Storage;
public static StorageType getStorage() { public static StorageEnum getStorage() {
return Storage; return Storage;
} }
public static void setStorage(StorageType storage) { public static void setStorage(StorageEnum storage) {
Storage = storage; Storage = storage;
} }

View File

@@ -1,8 +1,7 @@
package de.jatitv.commandguiv2.Spigot.system.database; package de.jatitv.commandguiv2.Spigot.database;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select; import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@@ -1,4 +1,4 @@
package de.jatitv.commandguiv2.Spigot.system; package de.jatitv.commandguiv2.Spigot.enums;
public enum EcoEnum { public enum EcoEnum {
VAULT, MONEY, VAULT, MONEY,

View File

@@ -1,5 +1,5 @@
package de.jatitv.commandguiv2.Spigot.system; package de.jatitv.commandguiv2.Spigot.enums;
public enum FunctionItemEnum { public enum FunctionItemEnum {
REMOVE, ADD REMOVE, ADD

View File

@@ -1,4 +1,4 @@
package de.jatitv.commandguiv2.Spigot.system; package de.jatitv.commandguiv2.Spigot.enums;
public enum FunctionVoteEnum { public enum FunctionVoteEnum {
REMOVE, ADD REMOVE, ADD

View File

@@ -0,0 +1,10 @@
package de.jatitv.commandguiv2.Spigot.enums;
public enum SoundEnum {
OpenInventory,
Click,
NoMoney,
NoInventorySpace,
Give,
PlayerNotFound
}

View File

@@ -0,0 +1,7 @@
package de.jatitv.commandguiv2.Spigot.enums;
public enum StorageEnum {
MYSQL,
SQLITE,
YML
}

View File

@@ -1,17 +1,18 @@
package de.jatitv.commandguiv2.Spigot.listener; package de.jatitv.commandguiv2.Spigot.gui;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events; import de.jatitv.commandguiv2.Spigot.listener.ServerChange;
import de.jatitv.commandguiv2.Spigot.useItem.Events;
import de.jatitv.commandguiv2.Spigot.objects.functions.Function; import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands; import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot; import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
import de.jatitv.commandguiv2.Spigot.system.Bungee_Sender_Reciver; import de.jatitv.commandguiv2.Spigot.listener.Bungee_Sender_Reciver;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui; import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum;
import de.jatitv.commandguiv2.Spigot.system.Placeholder; import de.jatitv.commandguiv2.Spigot.system.Placeholder;
import de.jatitv.commandguiv2.Spigot.sound.Sound;
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.eco.Eco; import net.t2code.lib.Spigot.Lib.eco.Eco;
import net.t2code.lib.Spigot.Lib.items.ItemVersion; import net.t2code.lib.Spigot.Lib.items.ItemVersion;
@@ -19,21 +20,18 @@ 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.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
public class GUIListener implements Listener { public class GUIListener implements Listener {
@@ -103,7 +101,7 @@ public class GUIListener implements Listener {
if (function.setConfigEnable) setConfig(function, player, e); if (function.setConfigEnable) setConfig(function, player, e);
if (function.functionVotePoints) votePoints(e, function, player); if (function.functionVotePoints) votePoints(e, function, player);
if (function.functionItem) item(function, player); if (function.functionItem) item(function, player);
if (SelectConfig.Sound_Enable && SelectConfig.Sound_Click_Enable) sound(function, slot, player, gui); Sound.play(player, SoundEnum.Click, function, slot, gui);
} }
private static void command(Function slot, Player player) { private static void command(Function slot, Player player) {
@@ -112,7 +110,7 @@ public class GUIListener implements Listener {
@Override @Override
public void run() { public void run() {
if (slot.command_BungeeCommand) { if (slot.command_BungeeCommand) {
if (SelectConfig.Bungee) { if (SelectConfig.getBungee()) {
for (String cmd : slot.command) { for (String cmd : slot.command) {
Bungee_Sender_Reciver.sendToBungee(player, cmd.replace("[player]", player.getName()), slot.commandAsConsole); Bungee_Sender_Reciver.sendToBungee(player, cmd.replace("[player]", player.getName()), slot.commandAsConsole);
} }
@@ -146,11 +144,11 @@ public class GUIListener implements Listener {
for (String msg : slot.message) { for (String msg : slot.message) {
if (Main.PaPi) { if (Main.PaPi) {
if (slot.cost_Enable) { if (slot.cost_Enable) {
send.player(player, Replace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency)); send.player(player, Replace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
} else send.player(player, Replace.replace(prefix, player, Placeholder.replace(msg, player))); } else send.player(player, Replace.replace(prefix, player, Placeholder.replace(msg, player)));
} else { } else {
if (slot.cost_Enable) { if (slot.cost_Enable) {
send.player(player, Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency)); send.player(player, Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
} else send.player(player, Replace.replace(prefix, Placeholder.replace(msg, player))); } else send.player(player, Replace.replace(prefix, Placeholder.replace(msg, player)));
} }
} }
@@ -238,23 +236,9 @@ public class GUIListener implements Listener {
}.runTaskLater(plugin, 1L); }.runTaskLater(plugin, 1L);
} }
private static void sound(Function function, Slot slot, Player player, Gui gui) {
if (function.customSound_Enable) {
if (!function.customSound_NoSound) {
try {
player.playSound(player.getLocation(), Sound.valueOf(function.customSound_Sound.toUpperCase().replace(".", "_")), 3, 1);
} catch (Exception e1) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
.replace("[sound]", "§6GUI: §e" + Replace.replace(prefix, gui.guiName) + "§r §6Slot: §e" + slot.slot + " §6CustomSound: §9" + function.customSound_Sound));
player.playSound(player.getLocation(), SelectConfig.Sound_Click, 3, 1);
}
}
} else player.playSound(player.getLocation(), SelectConfig.Sound_Click, 3, 1);
}
private static void togglePerm(Function function, Gui gui, Player player) { private static void togglePerm(Function function, Gui gui, Player player) {
if (player.hasPermission(function.togglePermissionPerm)) { if (player.hasPermission(function.togglePermissionPerm)) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), SelectConfig.togglePermFalse.replace("[player]", player.getName()).replace("[perm]", function.togglePermissionPerm)); Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), SelectConfig.getTogglePermFalse().replace("[player]", player.getName()).replace("[perm]", function.togglePermissionPerm));
new BukkitRunnable() { new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
@@ -263,7 +247,7 @@ public class GUIListener implements Listener {
} }
}.runTaskLater(plugin, 4L); }.runTaskLater(plugin, 4L);
} else } else
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), SelectConfig.togglePermTrue.replace("[player]", player.getName()).replace("[perm]", function.togglePermissionPerm)); Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), SelectConfig.getTogglePermTrue().replace("[player]", player.getName()).replace("[perm]", function.togglePermissionPerm));
new BukkitRunnable() { new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
@@ -332,8 +316,7 @@ public class GUIListener implements Listener {
} }
}.runTaskLater(plugin, 1L); }.runTaskLater(plugin, 1L);
send.player(player, SelectMessages.noMoneyItem.replace("[item]", item[0]).replace("[amount]", item[1])); send.player(player, SelectMessages.noMoneyItem.replace("[item]", item[0]).replace("[amount]", item[1]));
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable) Sound.play(player,SoundEnum.NoMoney);
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
} else { } else {
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name)) send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
.replace("[price]", item[1] + " " + item[0])); .replace("[price]", item[1] + " " + item[0]));
@@ -349,8 +332,7 @@ public class GUIListener implements Listener {
} }
}.runTaskLater(plugin, 1L); }.runTaskLater(plugin, 1L);
send.player(player, SelectMessages.noMoneyVote.replace("[amount]", function.votePoints.toString())); send.player(player, SelectMessages.noMoneyVote.replace("[amount]", function.votePoints.toString()));
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable) Sound.play(player,SoundEnum.NoMoney);
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
} else { } else {
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name)) send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
.replace("[price]", function.votePoints + " VotePoints")); .replace("[price]", function.votePoints + " VotePoints"));
@@ -367,11 +349,10 @@ public class GUIListener implements Listener {
} }
}.runTaskLater(plugin, 1L); }.runTaskLater(plugin, 1L);
send.player(player, Replace.replacePrice(prefix, SelectMessages.noMoney, String.valueOf(function.price))); send.player(player, Replace.replacePrice(prefix, SelectMessages.noMoney, String.valueOf(function.price)));
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable) Sound.play(player,SoundEnum.NoMoney);
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
} else { } else {
send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name)) send.player(player, SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
.replace("[price]", function.price + " " + SelectConfig.Currency)); .replace("[price]", function.price + " " + SelectConfig.getCurrency()));
execute(function, slot, player, e, gui); execute(function, slot, player, e, gui);
} }
break; break;

View File

@@ -64,10 +64,10 @@ public class GuiBuilder {
private static void setDisplayNameAndLore(ItemMeta itemMeta, Player player, Function slot) { private static void setDisplayNameAndLore(ItemMeta itemMeta, Player player, Function slot) {
if (Main.PaPi) { if (Main.PaPi) {
itemMeta.setDisplayName(Replace.replace(prefix, player, Placeholder.replace(slot.name, player))); itemMeta.setDisplayName(Replace.replace(prefix, player, Placeholder.replace(slot.name, player)));
itemMeta.setLore(Replace.replacePrice(prefix, player, Placeholder.replace(slot.lore, player), slot.price + " " + SelectConfig.Currency)); itemMeta.setLore(Replace.replacePrice(prefix, player, Placeholder.replace(slot.lore, player), slot.price + " " + SelectConfig.getCurrency()));
} else { } else {
itemMeta.setDisplayName(Replace.replace(prefix, Placeholder.replace(slot.name,player))); itemMeta.setDisplayName(Replace.replace(prefix, Placeholder.replace(slot.name,player)));
itemMeta.setLore(Replace.replacePrice(prefix, Placeholder.replace(slot.lore,player), slot.price + " " + SelectConfig.Currency)); itemMeta.setLore(Replace.replacePrice(prefix, Placeholder.replace(slot.lore,player), slot.price + " " + SelectConfig.getCurrency()));
} }
} }

View File

@@ -1,13 +1,15 @@
package de.jatitv.commandguiv2.Spigot.gui; package de.jatitv.commandguiv2.Spigot.gui;
import de.jatitv.commandguiv2.Spigot.listener.GUIListener; import de.jatitv.commandguiv2.Spigot.system.Permissions;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events; import de.jatitv.commandguiv2.Spigot.useItem.Events;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.objects.functions.Function; import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui; import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot; import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
import de.jatitv.commandguiv2.Spigot.sound.Sound;
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import io.github.solyze.plugmangui.inventories.PluginListGUI; import io.github.solyze.plugmangui.inventories.PluginListGUI;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
@@ -65,7 +67,7 @@ public class OpenGUI {
if (MCVersion.minecraft1_13) { if (MCVersion.minecraft1_13) {
GUIListener.GUICode = ""; GUIListener.GUICode = "";
} else GUIListener.GUICode = "§6§8§9§r"; } else GUIListener.GUICode = "§6§8§9§r";
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) { if (gui.guiEnable || player.hasPermission(Permissions.updatemsg)) {
Inventory inventory; Inventory inventory;
if (Main.PaPi) { if (Main.PaPi) {
inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (Replace.replace(prefix, player, GUIListener.GUICode + gui.guiName))); inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (Replace.replace(prefix, player, GUIListener.GUICode + gui.guiName)));
@@ -127,9 +129,7 @@ public class OpenGUI {
} }
if (sound) { if (sound) {
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) { Sound.play(player, SoundEnum.OpenInventory);
player.playSound(player.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
}
} }
player.openInventory(inventory); player.openInventory(inventory);
send.debug(plugin, "§6" + player.getName() + " §5Open §6" + Replace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms"); send.debug(plugin, "§6" + player.getName() + " §5Open §6" + Replace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
@@ -137,14 +137,14 @@ public class OpenGUI {
} }
private static void toggleOn(Function function, Integer slot, Player player, Inventory inventory) { private static void toggleOn(Function function, Integer slot, Player player, Inventory inventory) {
if (SelectConfig.toggleItemOnOrYesBase64) { if (SelectConfig.getToggleItemOnOrYesBase64()) {
GuiBuilder.base64(SelectConfig.toggleItemOnOrYesBase64Value, function, slot, player, inventory); GuiBuilder.base64(SelectConfig.getToggleItemOnOrYesBase64Value(), function, slot, player, inventory);
} else GuiBuilder.item(SelectConfig.toggleItemOnOrYesMaterial, function, slot, player, inventory); } else GuiBuilder.item(SelectConfig.getToggleItemOnOrYesMaterial(), function, slot, player, inventory);
} }
private static void toggleOff(Function function, Integer slot, Player player, Inventory inventory) { private static void toggleOff(Function function, Integer slot, Player player, Inventory inventory) {
if (SelectConfig.toggleItemOffOrNoBase64) { if (SelectConfig.getToggleItemOffOrNoBase64()) {
GuiBuilder.base64(SelectConfig.toggleItemOffOrNoBase64Value, function, slot, player, inventory); GuiBuilder.base64(SelectConfig.getToggleItemOffOrNoBase64Value(), function, slot, player, inventory);
} else GuiBuilder.item(SelectConfig.toggleItemOffOrNoMaterial, function, slot, player, inventory); } else GuiBuilder.item(SelectConfig.getToggleItemOffOrNoMaterial(), function, slot, player, inventory);
} }
} }

View File

@@ -1,4 +1,4 @@
package de.jatitv.commandguiv2.Spigot.system; package de.jatitv.commandguiv2.Spigot.listener;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;

View File

@@ -3,18 +3,13 @@
package de.jatitv.commandguiv2.Spigot.listener; package de.jatitv.commandguiv2.Spigot.listener;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.database.SelectDatabase;
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI; import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
import org.bukkit.Bukkit;
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.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerLoginEvent; import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.scheduler.BukkitRunnable;
public class PluginEvent implements Listener { public class PluginEvent implements Listener {
private static String prefix = Util.getPrefix(); private static String prefix = Util.getPrefix();
@@ -25,55 +20,4 @@ public class PluginEvent implements Listener {
SelectDatabase.nameCheck(player); SelectDatabase.nameCheck(player);
UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord()); UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord());
} }
@EventHandler
public void onClearServer(ServerCommandEvent event) {
if (SelectConfig.UseItem_KeepAtCommandClear) {
if (event.getCommand().contains("clear " + event.getCommand().replace("/", "").replace("clear ", ""))) {
new BukkitRunnable() {
@Override
public void run() {
try {
Player player = Bukkit.getPlayer(event.getCommand().replace("/", "").replace("clear ", ""));
if (player == null){
return;
}
clearGive(player);
} catch (Exception ex){
ex.printStackTrace();
return;
}
}
}.runTaskLater(Main.plugin, 1L);
}
}
}
@EventHandler
public void onClearPlayer(PlayerCommandPreprocessEvent event) {
if (SelectConfig.UseItem_KeepAtCommandClear) {
if (event.getMessage().toLowerCase().contains("clear")) {
new BukkitRunnable() {
@Override
public void run() {
clearGive(event.getPlayer());
}
}.runTaskLater(Main.plugin, 1L);
}
if (event.getMessage().toLowerCase().contains("clear " + event.getMessage().toLowerCase().replace("/", "").replace("clear ", ""))) {
new BukkitRunnable() {
@Override
public void run() {
clearGive(Bukkit.getPlayer(event.getMessage().toLowerCase().replace("/", "").replace("clear ", "")));
}
}.runTaskLater(Main.plugin, 1L);
}
}
}
private static void clearGive(Player player) {
ItemChange.itemChange(player, false);
}
} }

View File

@@ -8,7 +8,6 @@ import java.io.DataOutputStream;
import java.io.IOException; import java.io.IOException;
public class ServerChange { public class ServerChange {
public static void send(Player player, String server){ public static void send(Player player, String server){
ByteArrayOutputStream b = new ByteArrayOutputStream(); ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b); DataOutputStream out = new DataOutputStream(b);

View File

@@ -5,11 +5,9 @@ import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
import de.jatitv.commandguiv2.Spigot.objects.functions.Function; import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui; import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot; import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
import de.jatitv.commandguiv2.Spigot.system.Debug; import de.jatitv.commandguiv2.Spigot.enums.EcoEnum;
import de.jatitv.commandguiv2.Spigot.system.EcoEnum; import de.jatitv.commandguiv2.Spigot.enums.FunctionItemEnum;
import de.jatitv.commandguiv2.Spigot.system.FunctionItemEnum; import de.jatitv.commandguiv2.Spigot.enums.FunctionVoteEnum;
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
@@ -31,14 +29,14 @@ public class Obj_Select {
File f = new File(Main.getPath() + "/GUIs/"); File f = new File(Main.getPath() + "/GUIs/");
File[] fileArray = f.listFiles(); File[] fileArray = f.listFiles();
for (File config_gui : fileArray) { for (File config : fileArray) {
try { try {
String sub = config_gui.getName().substring(config_gui.getName().length() - 4); if (config.getName().equals("guiDeclaration.yml")) continue;
String sub = config.getName().substring(config.getName().length() - 4);
if (sub.equals(".yml")) { if (sub.equals(".yml")) {
String key = config_gui.getName().replace(".yml", ""); String key = config.getName().replace(".yml", "");
Main.allAliases.add(key); Main.allAliases.add(key);
YamlConfiguration yamlConfiguration_gui = YamlConfiguration.loadConfiguration(config_gui); YamlConfiguration yamlConfiguration_gui = YamlConfiguration.loadConfiguration(config);
Boolean guiEnable = yamlConfiguration_gui.getBoolean("GUI.Enable"); Boolean guiEnable = yamlConfiguration_gui.getBoolean("GUI.Enable");
Integer guiLines = yamlConfiguration_gui.getInt("GUI.Lines"); Integer guiLines = yamlConfiguration_gui.getInt("GUI.Lines");
@@ -83,11 +81,11 @@ public class Obj_Select {
key, commandAliasEnable, commandPermission, slots); key, commandAliasEnable, commandPermission, slots);
Main.guiHashMap.put(key, gui); Main.guiHashMap.put(key, gui);
CmdExecuter_GUI.arg1.put(config_gui.getName() CmdExecuter_GUI.arg1.put(config.getName()
.replace(".yml", ""), "commandgui.gui." + key); .replace(".yml", ""), "commandgui.gui." + key);
yamlConfiguration_gui.save(config_gui); yamlConfiguration_gui.save(config);
} }
} catch (Exception e) { } catch (Exception e) {
Main.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]); Main.sendTryCatch(Obj_Select.class, e.getStackTrace()[0]);
@@ -102,6 +100,7 @@ public class Obj_Select {
File[] fileArray = f.listFiles(); File[] fileArray = f.listFiles();
for (File config : fileArray) { for (File config : fileArray) {
if (config.getName().equals("functionDeclaration.yml")) return;
String sub = config.getName().substring(config.getName().length() - 4); String sub = config.getName().substring(config.getName().length() - 4);
if (sub.equals(".yml")) { if (sub.equals(".yml")) {
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config); YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
@@ -171,21 +170,26 @@ public class Obj_Select {
Boolean functionVotePoints = yamlConfiguration.getBoolean("Slots.Function.FunctionVotePoints.Enable"); Boolean functionVotePoints = yamlConfiguration.getBoolean("Slots.Function.FunctionVotePoints.Enable");
FunctionVoteEnum functionVotePointsMode = null; FunctionVoteEnum functionVotePointsMode = null;
if (yamlConfiguration.get("Slots.Function.FunctionVotePoints.Mode") != null) {
try { try {
functionVotePointsMode = FunctionVoteEnum.valueOf(yamlConfiguration.getString("Slots.Function.FunctionVotePoints.Mode").toUpperCase()); functionVotePointsMode = FunctionVoteEnum.valueOf(yamlConfiguration.getString("Slots.Function.FunctionVotePoints.Mode").toUpperCase());
} catch (Exception ex) { } catch (Exception ex) {
send.error(Main.plugin, "The VotePoints Mode " + yamlConfiguration.getString("Slots.Function.FunctionVotePoints.Mode").toUpperCase() + " in the function file " send.error(Main.plugin, "The VotePoints Mode " + yamlConfiguration.getString("Slots.Function.FunctionVotePoints.Mode").toUpperCase() + " in the function file "
+ config.getName() + " does not exist. Please use one of the supported modules. (ADD, REMOVE)"); + config.getName() + " does not exist. Please use one of the supported modules. (ADD, REMOVE)");
} }
}
Integer functionVotePointsAmount = yamlConfiguration.getInt("Slots.Function.FunctionVotePoints.Amount"); Integer functionVotePointsAmount = yamlConfiguration.getInt("Slots.Function.FunctionVotePoints.Amount");
Boolean functionItem = yamlConfiguration.getBoolean("Slots.Function.FunctionItem.Enable"); Boolean functionItem = yamlConfiguration.getBoolean("Slots.Function.FunctionItem.Enable");
FunctionItemEnum functionItemMode = null; FunctionItemEnum functionItemMode = null;
if (yamlConfiguration.get("Slots.Function.FunctionItem.Mode") != null) {
try { try {
functionItemMode = FunctionItemEnum.valueOf(yamlConfiguration.getString("Slots.Function.FunctionItem.Mode").toUpperCase()); functionItemMode = FunctionItemEnum.valueOf(yamlConfiguration.getString("Slots.Function.FunctionItem.Mode").toUpperCase());
} catch (Exception ex) { } catch (Exception ex) {
send.error(Main.plugin, "The Item Mode " + yamlConfiguration.getString("Slots.Function.FunctionItem.Mode").toUpperCase() + " in the function file " send.error(Main.plugin, "The Item Mode " + yamlConfiguration.getString("Slots.Function.FunctionItem.Mode").toUpperCase() + " in the function file "
+ config.getName() + " does not exist. Please use one of the supported modules. (ADD, REMOVE)"); + config.getName() + " does not exist. Please use one of the supported modules. (ADD, REMOVE)");
} }
}
String functionItemItem = yamlConfiguration.getString("Slots.Function.FunctionItem.Item"); String functionItemItem = yamlConfiguration.getString("Slots.Function.FunctionItem.Item");
Function function = new Function(key, empty, itemAmount, playerHead_Enable, base64_Enable, base64Value, playerWhoHasOpenedTheGUI, playerName, item, name, lore, Function function = new Function(key, empty, itemAmount, playerHead_Enable, base64_Enable, base64Value, playerWhoHasOpenedTheGUI, playerName, item, name, lore,

View File

@@ -1,8 +1,8 @@
package de.jatitv.commandguiv2.Spigot.objects.functions; package de.jatitv.commandguiv2.Spigot.objects.functions;
import de.jatitv.commandguiv2.Spigot.system.EcoEnum; import de.jatitv.commandguiv2.Spigot.enums.EcoEnum;
import de.jatitv.commandguiv2.Spigot.system.FunctionItemEnum; import de.jatitv.commandguiv2.Spigot.enums.FunctionItemEnum;
import de.jatitv.commandguiv2.Spigot.system.FunctionVoteEnum; import de.jatitv.commandguiv2.Spigot.enums.FunctionVoteEnum;
import java.util.List; import java.util.List;

View File

@@ -0,0 +1,60 @@
package de.jatitv.commandguiv2.Spigot.sound;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
import de.jatitv.commandguiv2.Spigot.enums.SoundEnum;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import org.bukkit.entity.Player;
public class Sound {
private static String prefix = Util.getPrefix();
public static void play(Player player, SoundEnum soundEnum) {
if (!SelectConfig.getSound_Enable()) return;
play(player, soundEnum, null, null, null);
}
public static void play(Player player, SoundEnum soundEnum, Function function, Slot slot, Gui gui) {
if (!SelectConfig.getSound_Enable()) return;
switch (soundEnum) {
case OpenInventory:
if (!SelectConfig.getSound_OpenInventory_Enable()) return;
player.playSound(player.getLocation(), SelectConfig.getSound_OpenInventory(), 3, 1);
break;
case Click:
if (!SelectConfig.getSound_Click_Enable()) return;
if (!function.customSound_Enable) player.playSound(player.getLocation(), SelectConfig.getSound_Click(), 3, 1);
if (function.customSound_NoSound) return;
try {
player.playSound(player.getLocation(), org.bukkit.Sound.valueOf(function.customSound_Sound.toUpperCase().replace(".", "_")), 3, 1);
} catch (Exception e1) {
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
.replace("[sound]", "§6GUI: §e" + Replace.replace(prefix, gui.guiName) + "§r §6Slot: §e" + slot.slot + " §6CustomSound: §9" + function.customSound_Sound));
player.playSound(player.getLocation(), SelectConfig.getSound_Click(), 3, 1);
}
break;
case NoMoney:
if (!SelectConfig.getSound_NoMoney_Enable()) return;
player.playSound(player.getLocation(), SelectConfig.getSound_NoMoney(), 3, 1);
break;
case NoInventorySpace:
if (!SelectConfig.getSound_NoInventorySpace_Enable()) return;
player.playSound(player.getLocation(), SelectConfig.getSound_NoInventorySpace(), 3, 1);
break;
case Give:
if (!SelectConfig.getSound_Give_Enable()) return;
player.playSound(player.getLocation(), SelectConfig.getSound_Give(), 3, 1);
break;
case PlayerNotFound:
if (!SelectConfig.getSound_PlayerNotFound_Enable()) return;
player.playSound(player.getLocation(), SelectConfig.getSound_PlayerNotFound(), 3, 1);
break;
}
}
}

View File

@@ -1,7 +1,8 @@
package de.jatitv.commandguiv2.Spigot.system; package de.jatitv.commandguiv2.Spigot.system;
import de.jatitv.commandguiv2.Spigot.listener.GUIListener; import de.jatitv.commandguiv2.Spigot.gui.GUIListener;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.EventsFrom110; import de.jatitv.commandguiv2.Spigot.listener.Bungee_Sender_Reciver;
import de.jatitv.commandguiv2.Spigot.useItem.EventsFrom110;
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI; import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem; import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem;
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help; import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help;
@@ -10,16 +11,16 @@ import de.jatitv.commandguiv2.Spigot.config.functions.CreateFunctions;
import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI; import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate; import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.database.MySQL; import de.jatitv.commandguiv2.Spigot.database.MySQL;
import de.jatitv.commandguiv2.Spigot.listener.PluginEvent; import de.jatitv.commandguiv2.Spigot.listener.PluginEvent;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events; import de.jatitv.commandguiv2.Spigot.useItem.Events;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.objects.Obj_Select; import de.jatitv.commandguiv2.Spigot.objects.Obj_Select;
import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate; import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.system.database.SQLITE; import de.jatitv.commandguiv2.Spigot.database.SQLITE;
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase; import de.jatitv.commandguiv2.Spigot.database.SelectDatabase;
import de.jatitv.commandguiv2.Spigot.system.database.StorageType; import de.jatitv.commandguiv2.Spigot.enums.StorageEnum;
import 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;
@@ -47,6 +48,21 @@ public class Load {
send.console(prefix + " §8-------------------------------"); send.console(prefix + " §8-------------------------------");
if (!new File(Main.getPath(), "config.yml").exists()) { if (!new File(Main.getPath(), "config.yml").exists()) {
try {
plugin.saveResource("configDeclaration.yml", false);
} catch (Exception e) {
e.printStackTrace();
}
try {
plugin.saveResource("GUIs/guiDeclaration.yml", false);
} catch (Exception e) {
e.printStackTrace();
}
try {
plugin.saveResource("Functions/functionDeclaration.yml", false);
} catch (Exception e) {
e.printStackTrace();
}
try { try {
CreateGUI.configCreate(); CreateGUI.configCreate();
} catch (Exception e) { } catch (Exception e) {
@@ -71,7 +87,7 @@ public class Load {
SelectConfig.setConfigVersion(); SelectConfig.setConfigVersion();
if (SelectConfig.Bungee) { if (SelectConfig.getBungee()) {
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin, "cgui:bungee")) { if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin, "cgui:bungee")) {
send.debug(plugin, "registerOutgoingPluginChannel §ecgui:bungee"); send.debug(plugin, "registerOutgoingPluginChannel §ecgui:bungee");
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "cgui:bungee"); Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "cgui:bungee");
@@ -96,11 +112,7 @@ public class Load {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
try {
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
} catch (Exception e) {
e.printStackTrace();
}
try { try {
SelectMessages.onSelect(prefix); SelectMessages.onSelect(prefix);
} catch (Exception e) { } catch (Exception e) {
@@ -111,6 +123,11 @@ public class Load {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
try {
CmdExecuter_GUI.arg1.put(SelectConfig.getAdminSubCommand(), "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
} catch (Exception e) {
e.printStackTrace();
}
send.console(prefix + " §8-------------------------------"); send.console(prefix + " §8-------------------------------");
loadStorage(prefix); loadStorage(prefix);
@@ -128,7 +145,7 @@ public class Load {
e.printStackTrace(); e.printStackTrace();
} }
if (SelectConfig.HelpAlias) { if (SelectConfig.getHelpAlias()) {
Main.plugin.getCommand("commandguihelp").setExecutor(new CmdExecuter_Help()); Main.plugin.getCommand("commandguihelp").setExecutor(new CmdExecuter_Help());
send.debug(plugin, "CommandRegister: commandguihelp"); send.debug(plugin, "CommandRegister: commandguihelp");
} }
@@ -160,11 +177,11 @@ public class Load {
private static void loadStorage(String prefix) { private static void loadStorage(String prefix) {
try { try {
SelectDatabase.setStorage(StorageType.valueOf(SelectConfig.storage)); SelectDatabase.setStorage(StorageEnum.valueOf(SelectConfig.getStorage()));
} catch (Exception ignored) { } catch (Exception ignored) {
send.error(Main.plugin, "The storage medium " + SelectConfig.storage + " is not supported!"); send.error(Main.plugin, "The storage medium " + SelectConfig.getStorage() + " is not supported!");
send.error(Main.plugin, "Storage medium " + StorageType.SQLITE + " is used."); send.error(Main.plugin, "Storage medium " + StorageEnum.SQLITE + " is used.");
SelectDatabase.setStorage(StorageType.SQLITE); SelectDatabase.setStorage(StorageEnum.SQLITE);
} }
switch (SelectDatabase.getStorage()) { switch (SelectDatabase.getStorage()) {

View File

@@ -4,9 +4,7 @@
package de.jatitv.commandguiv2.Spigot.system; package de.jatitv.commandguiv2.Spigot.system;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.database.SelectDatabase;
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
import de.jatitv.commandguiv2.Spigot.system.database.StorageType;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;

View File

@@ -1,6 +1,6 @@
package de.jatitv.commandguiv2.Spigot.system; package de.jatitv.commandguiv2.Spigot.system;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events; import de.jatitv.commandguiv2.Spigot.useItem.Events;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@@ -10,8 +10,8 @@ import java.util.List;
public class Placeholder { public class Placeholder {
public static String useitem(Player p) { public static String useitem(Player p) {
if (Events.useItemHashMap.get(p.getName())) { if (Events.useItemHashMap.get(p.getName())) {
return SelectConfig.placeholderTrue; return SelectConfig.getPlaceholderTrue();
} else return SelectConfig.placeholderFalse; } else return SelectConfig.getPlaceholderFalse();
} }
public static String useitem_boolean(Player p) { public static String useitem_boolean(Player p) {

View File

@@ -1,7 +0,0 @@
package de.jatitv.commandguiv2.Spigot.system.database;
public enum StorageType {
MYSQL,
SQLITE,
YML
}

View File

@@ -1,16 +1,15 @@
package de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener; package de.jatitv.commandguiv2.Spigot.useItem;
import de.jatitv.commandguiv2.Spigot.listener.ItemChange;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands; import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI; import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
import de.jatitv.commandguiv2.Spigot.system.UseItem; import de.jatitv.commandguiv2.Spigot.database.SelectDatabase;
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
import de.jatitv.commandguiv2.api.CGuiAPI; import de.jatitv.commandguiv2.api.CGuiAPI;
import net.t2code.lib.Spigot.Lib.items.ItemVersion; import net.t2code.lib.Spigot.Lib.items.ItemVersion;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.Bukkit;
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;
@@ -23,6 +22,7 @@ import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryMoveItemEvent; import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.inventory.InventoryPickupItemEvent; import org.bukkit.event.inventory.InventoryPickupItemEvent;
import org.bukkit.event.player.*; import org.bukkit.event.player.*;
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@@ -40,7 +40,7 @@ public class Events implements Listener {
useItemHashMap.put(e.getPlayer().getName(), SelectDatabase.selectItemStatus(e.getPlayer())); useItemHashMap.put(e.getPlayer().getName(), SelectDatabase.selectItemStatus(e.getPlayer()));
Integer i = SelectDatabase.selectSlot(e.getPlayer()); Integer i = SelectDatabase.selectSlot(e.getPlayer());
if (i == null) { if (i == null) {
useItemSlotHashMap.put(e.getPlayer().getName(), SelectConfig.UseItem_InventorySlot); useItemSlotHashMap.put(e.getPlayer().getName(), SelectConfig.getUseItem_InventorySlot());
} else useItemSlotHashMap.put(e.getPlayer().getName(), i); } else useItemSlotHashMap.put(e.getPlayer().getName(), i);
if (CGuiAPI.JoinDisable) { if (CGuiAPI.JoinDisable) {
@@ -63,6 +63,8 @@ public class Events implements Listener {
useItemHashMap.remove(e.getPlayer().getName()); useItemHashMap.remove(e.getPlayer().getName());
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onDeathDrop(PlayerDeathEvent e) { public void onDeathDrop(PlayerDeathEvent e) {
Player player = e.getEntity().getPlayer(); Player player = e.getEntity().getPlayer();
@@ -72,7 +74,7 @@ public class Events implements Listener {
while (var3.hasNext()) { while (var3.hasNext()) {
ItemStack items = (ItemStack) var3.next(); ItemStack items = (ItemStack) var3.next();
if (items != null && items.hasItemMeta() && items.getItemMeta().hasDisplayName() if (items != null && items.hasItemMeta() && items.getItemMeta().hasDisplayName()
&& items.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && items.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
e.getDrops().remove(items); e.getDrops().remove(items);
} }
} }
@@ -82,10 +84,10 @@ public class Events implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onRespawn(PlayerRespawnEvent e) { public void onRespawn(PlayerRespawnEvent e) {
Player player = e.getPlayer(); Player player = e.getPlayer();
if (SelectConfig.UseItem_Enable) { if (SelectConfig.getUseItem_Enable()) {
ItemChange.itemChange(player, false); ItemChange.itemChange(player, false);
//if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) { //if (!SelectConfig.getUseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
// if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) { // if (SelectConfig.getUseItem_GiveOnlyOnFirstJoin) {
// if (!player.hasPlayedBefore()) { // if (!player.hasPlayedBefore()) {
// new BukkitRunnable() { // new BukkitRunnable() {
// @Override // @Override
@@ -109,7 +111,7 @@ public class Events implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onGameModeChange(PlayerGameModeChangeEvent e) { public void onGameModeChange(PlayerGameModeChangeEvent e) {
Player player = e.getPlayer(); Player player = e.getPlayer();
if (!SelectConfig.UseItemGameModeChangeEnable) { if (!SelectConfig.getUseItemGameModeChangeEnable()) {
return; return;
} }
new BukkitRunnable() { new BukkitRunnable() {
@@ -117,13 +119,13 @@ public class Events implements Listener {
public void run() { public void run() {
ItemChange.itemChange(player, false); ItemChange.itemChange(player, false);
} }
}.runTaskLater(Main.plugin, SelectConfig.UseItemGameModeChangeDelayInTicks * 1L); }.runTaskLater(Main.plugin, SelectConfig.getUseItemGameModeChangeDelayInTicks() * 1L);
} }
@EventHandler @EventHandler
public void onWorldChange(PlayerChangedWorldEvent e) { public void onWorldChange(PlayerChangedWorldEvent e) {
Player player = e.getPlayer(); Player player = e.getPlayer();
if (!SelectConfig.UseItemWorldChangeEnable) { if (!SelectConfig.getUseItemWorldChangeEnable()) {
return; return;
} }
new BukkitRunnable() { new BukkitRunnable() {
@@ -131,30 +133,30 @@ public class Events implements Listener {
public void run() { public void run() {
ItemChange.itemChange(player, false); ItemChange.itemChange(player, false);
} }
}.runTaskLater(Main.plugin, SelectConfig.UseItemWorldChangeDelayInTicks * 1L); }.runTaskLater(Main.plugin, SelectConfig.getUseItemWorldChangeDelayInTicks() * 1L);
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onInteract(PlayerInteractEvent e) { public void onInteract(PlayerInteractEvent e) {
Player p = e.getPlayer(); Player p = e.getPlayer();
if (!p.isSneaking()) { if (!p.isSneaking()) {
for (String material : SelectConfig.UseItemItemBlockBlacklist) { for (String material : SelectConfig.getUseItemItemBlockBlacklist()) {
if (e.getClickedBlock() != null) { if (e.getClickedBlock() != null) {
if (e.getClickedBlock().getType() == Material.valueOf(material)) return; if (e.getClickedBlock().getType() == Material.valueOf(material)) return;
} }
} }
} }
if (SelectConfig.UseItem_Enable) { if (SelectConfig.getUseItem_Enable()) {
if (SelectConfig.UseItem_PlayerHead_Enable) { if (SelectConfig.getUseItem_PlayerHead_Enable()) {
if (e.getItem() != null && p.getItemInHand().getType() == ItemVersion.getHead()) { if (e.getItem() != null && p.getItemInHand().getType() == ItemVersion.getHead()) {
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
openGUI(e, p); openGUI(e, p);
} }
} }
} else { } else {
if (e.getItem() != null && p.getItemInHand().getType() == Material.valueOf(SelectConfig.UseItem_Material)) { if (e.getItem() != null && p.getItemInHand().getType() == Material.valueOf(SelectConfig.getUseItem_Material())) {
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
openGUI(e, p); openGUI(e, p);
} }
} }
@@ -165,7 +167,7 @@ public class Events implements Listener {
private static void openGUI(PlayerInteractEvent e, Player player) { private static void openGUI(PlayerInteractEvent e, Player player) {
e.setCancelled(true); e.setCancelled(true);
if ((!SelectConfig.disableInfoBySneak) && player.isSneaking()) { if ((!SelectConfig.getDisableInfoBySneak()) && player.isSneaking()) {
Commands.info(player); Commands.info(player);
return; return;
} }
@@ -176,45 +178,45 @@ public class Events implements Listener {
if (UseItem.protection(player, true)) return; if (UseItem.protection(player, true)) return;
if (SelectConfig.UseItemGameModeProtection) { if (SelectConfig.getUseItemGameModeProtection()) {
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) { if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
e.setCancelled(true); e.setCancelled(true);
send.player(player, SelectMessages.UseItemDisabledInGameMode); send.player(player, SelectMessages.UseItemDisabledInGameMode);
return; return;
} }
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) { if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
e.setCancelled(true); e.setCancelled(true);
send.player(player, SelectMessages.UseItemDisabledInGameMode); send.player(player, SelectMessages.UseItemDisabledInGameMode);
return; return;
} }
} }
if (SelectConfig.UseItemWorldProtection) { if (SelectConfig.getUseItemWorldProtection()) {
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) { if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
e.setCancelled(true); e.setCancelled(true);
send.player(player, SelectMessages.UseItemDisabledInWorld); send.player(player, SelectMessages.UseItemDisabledInWorld);
return; return;
} }
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) { if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
e.setCancelled(true); e.setCancelled(true);
send.player(player, SelectMessages.UseItemDisabledInWorld); send.player(player, SelectMessages.UseItemDisabledInWorld);
return; return;
} }
} }
if (!SelectConfig.UseItem_Permission || player.hasPermission("commandgui.useitem")) { if (!SelectConfig.getUseItem_Permission() || player.hasPermission("commandgui.useitem")) {
OpenGUI.openGUI(player, SelectConfig.UseItem_OpenGUI, true); OpenGUI.openGUI(player, SelectConfig.getUseItem_OpenGUI(), true);
} else { } else {
send.player(player,SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem") send.player(player,SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
.replace("[gui]", SelectConfig.UseItem_OpenGUI)); .replace("[gui]", SelectConfig.getUseItem_OpenGUI()));
} }
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onItemMoveEvent(InventoryMoveItemEvent e) { public void onItemMoveEvent(InventoryMoveItemEvent e) {
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return; if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
if (e.getItem() != null && e.getItem().hasItemMeta() && e.getItem().getItemMeta().hasDisplayName() if (e.getItem() != null && e.getItem().hasItemMeta() && e.getItem().getItemMeta().hasDisplayName()
&& e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
e.setCancelled(true); e.setCancelled(true);
} }
} }
@@ -222,19 +224,19 @@ public class Events implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onItemMove(InventoryDragEvent e) { public void onItemMove(InventoryDragEvent e) {
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return; if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
if (e.getWhoClicked() instanceof Player) { if (e.getWhoClicked() instanceof Player) {
Player p = (Player) e.getWhoClicked(); Player p = (Player) e.getWhoClicked();
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName() if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
p.closeInventory(); p.closeInventory();
e.setCancelled(true); e.setCancelled(true);
ItemChange.itemChange(p, false); ItemChange.itemChange(p, false);
} }
if (e.getOldCursor() != null && e.getOldCursor().hasItemMeta() && e.getOldCursor().getItemMeta().hasDisplayName() if (e.getOldCursor() != null && e.getOldCursor().hasItemMeta() && e.getOldCursor().getItemMeta().hasDisplayName()
&& e.getOldCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getOldCursor().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
p.closeInventory(); p.closeInventory();
e.setCancelled(true); e.setCancelled(true);
ItemChange.itemChange(p, false); ItemChange.itemChange(p, false);
@@ -244,14 +246,14 @@ public class Events implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onItemMove(InventoryClickEvent e) { public void onItemMove(InventoryClickEvent e) {
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return; if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName() if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
e.setCancelled(true); e.setCancelled(true);
} }
if (e.getCurrentItem() != null && e.getCurrentItem().hasItemMeta() && e.getCurrentItem().getItemMeta().hasDisplayName() if (e.getCurrentItem() != null && e.getCurrentItem().hasItemMeta() && e.getCurrentItem().getItemMeta().hasDisplayName()
&& e.getCurrentItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getCurrentItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
e.setCancelled(true); e.setCancelled(true);
} }
@@ -259,12 +261,12 @@ public class Events implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onItemMove(InventoryPickupItemEvent e) { public void onItemMove(InventoryPickupItemEvent e) {
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return; if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
if (e.getItem() != null && e.getItem().getItemStack() != null) { if (e.getItem() != null && e.getItem().getItemStack() != null) {
ItemStack item = e.getItem().getItemStack(); ItemStack item = e.getItem().getItemStack();
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName() if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
e.setCancelled(true); e.setCancelled(true);
} }
} }
@@ -272,22 +274,21 @@ public class Events implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onPlace(BlockPlaceEvent e) { public void onPlace(BlockPlaceEvent e) {
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return; if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
if (e.getItemInHand() != null && e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().hasDisplayName() if (e.getItemInHand() != null && e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().hasDisplayName()
&& e.getItemInHand().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getItemInHand().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
e.setCancelled(true); e.setCancelled(true);
} }
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onDrop(PlayerDropItemEvent e) { public void onDrop(PlayerDropItemEvent e) {
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return; if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
if (e.getItemDrop() != null && e.getItemDrop().getItemStack() != null) { if (e.getItemDrop() != null && e.getItemDrop().getItemStack() != null) {
ItemStack item = e.getItemDrop().getItemStack(); ItemStack item = e.getItemDrop().getItemStack();
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName() if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
e.setCancelled(true); e.setCancelled(true);
} }
} }
@@ -296,4 +297,54 @@ public class Events implements Listener {
private static boolean topInventoryIsEmpty(Player p) { private static boolean topInventoryIsEmpty(Player p) {
return p.getOpenInventory().getTopInventory().isEmpty(); return p.getOpenInventory().getTopInventory().isEmpty();
} }
@EventHandler
public void onClearServer(ServerCommandEvent event) {
if (SelectConfig.getUseItem_KeepAtCommandClear()) {
if (event.getCommand().contains("clear " + event.getCommand().replace("/", "").replace("clear ", ""))) {
new BukkitRunnable() {
@Override
public void run() {
try {
Player player = Bukkit.getPlayer(event.getCommand().replace("/", "").replace("clear ", ""));
if (player == null){
return;
}
clearGive(player);
} catch (Exception ex){
ex.printStackTrace();
return;
}
}
}.runTaskLater(Main.plugin, 1L);
}
}
}
@EventHandler
public void onClearPlayer(PlayerCommandPreprocessEvent event) {
if (SelectConfig.getUseItem_KeepAtCommandClear()) {
if (event.getMessage().toLowerCase().contains("clear")) {
new BukkitRunnable() {
@Override
public void run() {
clearGive(event.getPlayer());
}
}.runTaskLater(Main.plugin, 1L);
}
if (event.getMessage().toLowerCase().contains("clear " + event.getMessage().toLowerCase().replace("/", "").replace("clear ", ""))) {
new BukkitRunnable() {
@Override
public void run() {
clearGive(Bukkit.getPlayer(event.getMessage().toLowerCase().replace("/", "").replace("clear ", "")));
}
}.runTaskLater(Main.plugin, 1L);
}
}
}
private static void clearGive(Player player) {
ItemChange.itemChange(player, false);
}
} }

View File

@@ -1,4 +1,4 @@
package de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener; package de.jatitv.commandguiv2.Spigot.useItem;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
@@ -12,29 +12,27 @@ public class EventsFrom110 implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onHandSwap(PlayerSwapHandItemsEvent e) { public void onHandSwap(PlayerSwapHandItemsEvent e) {
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9) return; if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName() if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName()
&& e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
} }
if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName() if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName()
&& e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
e.setCancelled(true); e.setCancelled(true);
} }
} }
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onItemMove(PlayerSwapHandItemsEvent e) { public void onItemMove(PlayerSwapHandItemsEvent e) {
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9) return; if (!SelectConfig.getUseItem_BlockMoveAndDrop() || !SelectConfig.getUseItem_Enable()) return;
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
Player p = e.getPlayer(); Player p = e.getPlayer();
if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName() if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName()
&& e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
p.closeInventory(); p.closeInventory();
e.setCancelled(true); e.setCancelled(true);
} }
if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName() if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName()
&& e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { && e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
p.closeInventory(); p.closeInventory();
e.setCancelled(true); e.setCancelled(true);
} }

View File

@@ -1,8 +1,6 @@
package de.jatitv.commandguiv2.Spigot.listener; package de.jatitv.commandguiv2.Spigot.useItem;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.UseItem;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@@ -11,19 +9,19 @@ import org.bukkit.scheduler.BukkitRunnable;
public class ItemChange { public class ItemChange {
public static void itemChange(Player player, Boolean setCursor) { public static void itemChange(Player player, Boolean setCursor) {
Integer slot; Integer slot;
if (SelectConfig.UseItem_InventorySlotEnforce) { if (SelectConfig.getUseItem_InventorySlotEnforce()) {
slot = SelectConfig.UseItem_InventorySlot; slot = SelectConfig.getUseItem_InventorySlot();
} else { } else {
slot = Events.useItemSlotHashMap.get(player.getName()); slot = Events.useItemSlotHashMap.get(player.getName());
} }
if (!SelectConfig.UseItem_Enable) { if (!SelectConfig.getUseItem_Enable()) {
return; return;
} }
UseItem.removeItem(player); UseItem.removeItem(player);
if (UseItem.protection(player, false)) return; if (UseItem.protection(player, false)) return;
if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) { if (SelectConfig.getUseItem_GiveOnlyOnFirstJoin()) {
if (!SelectConfig.UseItem_AllowToggle || Events.useItemHashMap.get(player.getName())) { if (!SelectConfig.getUseItem_AllowToggle() || Events.useItemHashMap.get(player.getName())) {
if (!player.hasPlayedBefore()) { if (!player.hasPlayedBefore()) {
new BukkitRunnable() { new BukkitRunnable() {
@Override @Override
@@ -34,7 +32,7 @@ public class ItemChange {
} }
} }
}.runTaskLater(Main.plugin, 1L * 1); }.runTaskLater(Main.plugin, 1L * 1);
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin || SelectConfig.Cursor_ToGUIItem_OnLogin) { if (SelectConfig.getCursor_ToGUIItem_OnlyOnFirstLogin() || SelectConfig.getCursor_ToGUIItem_OnLogin()) {
player.getInventory().setHeldItemSlot(slot - 1); player.getInventory().setHeldItemSlot(slot - 1);
} }
} }
@@ -42,21 +40,23 @@ public class ItemChange {
send.debug(Main.plugin, "GiveOnlyOnFirstJoin: " + player.getName()); send.debug(Main.plugin, "GiveOnlyOnFirstJoin: " + player.getName());
return; return;
} }
if (!SelectConfig.UseItem_GiveOnEveryJoin) { if (!SelectConfig.getUseItem_GiveOnEveryJoin()) {
send.debug(Main.plugin, "!GiveOnEveryJoin: " + player.getName()); send.debug(Main.plugin, "!GiveOnEveryJoin: " + player.getName());
return; return;
} }
new BukkitRunnable() { new BukkitRunnable() {
@Override @Override
public void run() { public void run() {
if (!SelectConfig.UseItem_AllowToggle || Events.useItemHashMap.get(player.getName())) { Boolean pln = Events.useItemHashMap.get(player.getName());
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(slot - 1) == null) { if (pln == null) return;
if (!SelectConfig.getUseItem_AllowToggle() || pln) {
if (SelectConfig.getUseItem_InventorySlotEnforce() || player.getInventory().getItem(slot - 1) == null) {
send.debug(Main.plugin, "Give: " + player.getName()); send.debug(Main.plugin, "Give: " + player.getName());
UseItem.giveUseItem(player); UseItem.giveUseItem(player);
if (setCursor) { if (setCursor) {
setCursor(player, slot); setCursor(player, slot);
} }
} else if (SelectConfig.UseItem_InventorySlot_FreeSlot) { } else if (SelectConfig.getUseItem_InventorySlot_FreeSlot()) {
boolean empty = false; boolean empty = false;
for (int i = 0; i < 9; i++) { for (int i = 0; i < 9; i++) {
if (player.getInventory().getItem(i) == null) { if (player.getInventory().getItem(i) == null) {
@@ -77,11 +77,11 @@ public class ItemChange {
private static void setCursor(Player player, int slot) { private static void setCursor(Player player, int slot) {
send.debug(Main.plugin, "setCursor 1 Player: " + player.getName()); send.debug(Main.plugin, "setCursor 1 Player: " + player.getName());
if (!SelectConfig.Cursor_ToGUIItem_OnLogin) { if (!SelectConfig.getCursor_ToGUIItem_OnLogin()) {
return; return;
} }
send.debug(Main.plugin, "setCursor 2 Player: " + player.getName()); send.debug(Main.plugin, "setCursor 2 Player: " + player.getName());
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin) { if (SelectConfig.getCursor_ToGUIItem_OnlyOnFirstLogin()) {
if (!player.hasPlayedBefore()) { if (!player.hasPlayedBefore()) {
player.getInventory().setHeldItemSlot(slot - 1); player.getInventory().setHeldItemSlot(slot - 1);
send.debug(Main.plugin, "setCursor 3 Player: " + player.getName()); send.debug(Main.plugin, "setCursor 3 Player: " + player.getName());
@@ -89,13 +89,13 @@ public class ItemChange {
return; return;
} }
send.debug(Main.plugin, "setCursor 4 Player: " + player.getName()); send.debug(Main.plugin, "setCursor 4 Player: " + player.getName());
if (!SelectConfig.Bungee) { if (!SelectConfig.getBungee()) {
player.getInventory().setHeldItemSlot(slot - 1); player.getInventory().setHeldItemSlot(slot - 1);
send.debug(Main.plugin, "setCursor 5 Player: " + player.getName()); send.debug(Main.plugin, "setCursor 5 Player: " + player.getName());
return; return;
} }
send.debug(Main.plugin, "setCursor 6 Player: " + player.getName()); send.debug(Main.plugin, "setCursor 6 Player: " + player.getName());
if (SelectConfig.UseItem_ServerChange) { if (SelectConfig.getUseItem_ServerChange()) {
player.getInventory().setHeldItemSlot(slot - 1); player.getInventory().setHeldItemSlot(slot - 1);
send.debug(Main.plugin, "setCursor 7 Player: " + player.getName()); send.debug(Main.plugin, "setCursor 7 Player: " + player.getName());
return; return;

View File

@@ -1,8 +1,8 @@
package de.jatitv.commandguiv2.Spigot.system; package de.jatitv.commandguiv2.Spigot.useItem;
import com.mojang.authlib.GameProfile; import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.Property;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events; import de.jatitv.commandguiv2.Spigot.useItem.Events;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
@@ -21,17 +21,15 @@ import java.lang.reflect.Field;
import java.util.UUID; import java.util.UUID;
public class UseItem { public class UseItem {
public static void giveUseItem(Player player) { public static void giveUseItem(Player player) {
Integer slot; Integer slot;
if (protection(player, false)) return; if (protection(player, false)) return;
if (SelectConfig.UseItem_InventorySlotEnforce) { if (SelectConfig.getUseItem_InventorySlotEnforce()) {
slot = SelectConfig.UseItem_InventorySlot; slot = SelectConfig.getUseItem_InventorySlot();
} else { } else {
slot = Events.useItemSlotHashMap.get(player.getName()); slot = Events.useItemSlotHashMap.get(player.getName());
} }
if (SelectConfig.UseItem_InventorySlot_FreeSlot) { if (SelectConfig.getUseItem_InventorySlot_FreeSlot()) {
player.getInventory().addItem(itemStack(player)); player.getInventory().addItem(itemStack(player));
} else { } else {
send.debug(Main.plugin, "setUseItem: " + player.getName() + " Slot: " + Integer.parseInt(String.valueOf(slot - 1))); send.debug(Main.plugin, "setUseItem: " + player.getName() + " Slot: " + Integer.parseInt(String.valueOf(slot - 1)));
@@ -41,27 +39,27 @@ public class UseItem {
public static void addUseItem(Player player) { public static void addUseItem(Player player) {
if (protection(player, false)) return; if (protection(player, false)) return;
if (SelectConfig.UseItem_InventorySlot_FreeSlot) { if (SelectConfig.getUseItem_InventorySlot_FreeSlot()) {
player.getInventory().addItem(itemStack(player)); player.getInventory().addItem(itemStack(player));
} else player.getInventory().addItem(itemStack(player)); } else player.getInventory().addItem(itemStack(player));
} }
private static ItemStack itemStack(Player player) { private static ItemStack itemStack(Player player) {
ItemStack item = null; ItemStack item = null;
if (SelectConfig.UseItem_PlayerHead_Enable) { if (SelectConfig.getUseItem_PlayerHead_Enable()) {
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) { if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
send.player(player, Util.getPrefix() + "§c Playerheads for UseItem are only available from version §61.13§c!"); send.player(player, Util.getPrefix() + "§c Playerheads for UseItem are only available from version §61.13§c!");
send.error(Main.plugin, "Playerheads for UseItem are only available from version 1.13!"); send.error(Main.plugin, "Playerheads for UseItem are only available from version 1.13!");
} else { } else {
item = ItemVersion.getHeadIS(); item = ItemVersion.getHeadIS();
SkullMeta playerheadmeta = (SkullMeta) item.getItemMeta(); SkullMeta playerheadmeta = (SkullMeta) item.getItemMeta();
playerheadmeta.setDisplayName(SelectConfig.UseItem_Name); playerheadmeta.setDisplayName(SelectConfig.getUseItem_Name());
if (SelectConfig.UseItem_Base64_Enable) { if (SelectConfig.getUseItem_Base64_Enable()) {
if (Main.PaPi) { if (Main.PaPi) {
playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore)); playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
} else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore)); } else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
GameProfile profile = new GameProfile(UUID.randomUUID(), ""); GameProfile profile = new GameProfile(UUID.randomUUID(), "");
profile.getProperties().put("textures", new Property("textures", SelectConfig.UseItem_Base64value)); profile.getProperties().put("textures", new Property("textures", SelectConfig.getUseItem_Base64value()));
Field profileField = null; Field profileField = null;
try { try {
profileField = playerheadmeta.getClass().getDeclaredField("profile"); profileField = playerheadmeta.getClass().getDeclaredField("profile");
@@ -72,23 +70,23 @@ public class UseItem {
} }
} else { } else {
String p; String p;
if (SelectConfig.UseItem_PlayerWhoHasOpenedTheGUI) { if (SelectConfig.getUseItem_PlayerWhoHasOpenedTheGUI()) {
p = player.getName(); p = player.getName();
} else p = SelectConfig.UseItem_PlayerName; } else p = SelectConfig.getUseItem_PlayerName();
playerheadmeta.setOwner(p); playerheadmeta.setOwner(p);
if (Main.PaPi) { if (Main.PaPi) {
playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore)); playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
} else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore)); } else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
} }
item.setItemMeta(playerheadmeta); item.setItemMeta(playerheadmeta);
} }
} else { } else {
item = new ItemStack(Material.valueOf(SelectConfig.UseItem_Material)); item = new ItemStack(Material.valueOf(SelectConfig.getUseItem_Material()));
ItemMeta itemMeta = item.getItemMeta(); ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(SelectConfig.UseItem_Name); itemMeta.setDisplayName(SelectConfig.getUseItem_Name());
if (Main.PaPi) { if (Main.PaPi) {
itemMeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore)); itemMeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
} else itemMeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore)); } else itemMeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
item.setItemMeta(itemMeta); item.setItemMeta(itemMeta);
item.setAmount(1); item.setAmount(1);
} }
@@ -96,31 +94,31 @@ public class UseItem {
} }
public static boolean protection(Player player, Boolean interact) { public static boolean protection(Player player, Boolean interact) {
if (SelectConfig.UseItemGameModeProtection) { if (SelectConfig.getUseItemGameModeProtection()) {
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) { if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
if (interact) { if (interact) {
send.player(player, SelectMessages.UseItemDisabledInGameMode); send.player(player, SelectMessages.UseItemDisabledInGameMode);
} else if (!SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled) removeItem(player); } else if (!SelectConfig.getUseItemGameModeRemoveItemWhenItIsDisabled()) removeItem(player);
return true; return true;
} }
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) { if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
if (interact) { if (interact) {
send.player(player, SelectMessages.UseItemDisabledInGameMode); send.player(player, SelectMessages.UseItemDisabledInGameMode);
} else if (!SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled) removeItem(player); } else if (!SelectConfig.getUseItemGameModeRemoveItemWhenItIsDisabled()) removeItem(player);
return true; return true;
} }
} }
if (SelectConfig.UseItemWorldProtection) { if (SelectConfig.getUseItemWorldProtection()) {
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) { if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
if (interact) { if (interact) {
send.player(player, SelectMessages.UseItemDisabledInWorld); send.player(player, SelectMessages.UseItemDisabledInWorld);
} else if (!SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled) removeItem(player); } else if (!SelectConfig.getUseItemWorldRemoveItemWhenItIsDisabled()) removeItem(player);
return true; return true;
} }
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) { if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
if (interact) { if (interact) {
send.player(player, SelectMessages.UseItemDisabledInWorld); send.player(player, SelectMessages.UseItemDisabledInWorld);
} else if (!SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled) removeItem(player); } else if (!SelectConfig.getUseItemWorldRemoveItemWhenItIsDisabled()) removeItem(player);
return true; return true;
} }
} }
@@ -132,8 +130,8 @@ public class UseItem {
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) { for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
ItemStack itm = player.getInventory().getItem(iam); ItemStack itm = player.getInventory().getItem(iam);
if (itm != null) { if (itm != null) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) { if (itm.getType() == Material.valueOf(SelectConfig.getUseItem_Material()) || itm.getType() == ItemVersion.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) { if (itm.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
player.getInventory().remove(itm); player.getInventory().remove(itm);
player.updateInventory(); player.updateInventory();
break; break;

View File

@@ -1,15 +1,16 @@
package de.jatitv.commandguiv2; package de.jatitv.commandguiv2;
import net.t2code.lib.Spigot.system.T2CodeMain;
public class Util { public class Util {
private static Integer configVersion = 5; private static Integer configVersion = 5;
private static double requiredT2CodeLibVersion = 12.0; private static String requiredT2CodeLibVersion = "12.1";
private static String Prefix = "§8[§4C§9GUI§8]"; private static String Prefix = "§8[§4C§9GUI§8]";
private static Integer SpigotID = 90671; private static Integer SpigotID = 90671;
private static Integer BstatsID = 10840; private static Integer BstatsID = 10840;
private static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID; private static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID;
private static String Discord = "http://dc.t2code.net";
public static double getRequiredT2CodeLibVersion() { public static String getRequiredT2CodeLibVersion() {
return requiredT2CodeLibVersion; return requiredT2CodeLibVersion;
} }
@@ -30,7 +31,7 @@ public class Util {
} }
public static String getDiscord() { public static String getDiscord() {
return Discord; return T2CodeMain.getDiscord();
} }
public static Integer getConfigVersion() { public static Integer getConfigVersion() {

View File

@@ -1,7 +1,7 @@
package de.jatitv.commandguiv2.api; package de.jatitv.commandguiv2.api;
import de.jatitv.commandguiv2.Spigot.listener.ItemChange; import de.jatitv.commandguiv2.Spigot.useItem.ItemChange;
import de.jatitv.commandguiv2.Spigot.listener.UseItem_Listener.Events; import de.jatitv.commandguiv2.Spigot.useItem.Events;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands; import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
import de.jatitv.commandguiv2.Spigot.cmdManagement.Help; import de.jatitv.commandguiv2.Spigot.cmdManagement.Help;
@@ -9,7 +9,7 @@ import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.Permissions; import de.jatitv.commandguiv2.Spigot.system.Permissions;
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase; import de.jatitv.commandguiv2.Spigot.database.SelectDatabase;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@@ -26,13 +26,13 @@ public class CGuiAPI {
public static boolean hasUseItemInMainHand(Player player) { public static boolean hasUseItemInMainHand(Player player) {
ItemStack item = player.getInventory().getItemInMainHand(); ItemStack item = player.getInventory().getItemInMainHand();
return item.hasItemMeta() && item.getItemMeta().hasDisplayName() return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name); && item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name());
} }
public static boolean hasUseItemInOffHand(Player player) { public static boolean hasUseItemInOffHand(Player player) {
ItemStack item = player.getInventory().getItemInOffHand(); ItemStack item = player.getInventory().getItemInOffHand();
return item.hasItemMeta() && item.getItemMeta().hasDisplayName() return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name); && item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name());
} }
public static void onItemChange(Player player, Boolean setCursor) { public static void onItemChange(Player player, Boolean setCursor) {

View File

@@ -0,0 +1,158 @@
#####################################################
## To add another Function just create a new file. ##
#####################################################
Slots:
Function:
Item:
# Here you can create an empty slot.
# Note: When this is enabled, no functions will work.
Empty: false
# Here you can set the number of items
Amount: 1
PlayerHead:
# Here you can set if the item should be a player head
Enable: false
Base64:
# Here you can specify whether a Base64 player header should be used
Enable: false
# Here you can set the Base64 Value.
# You can find the Base64 Value for example on https://minecraft-heads.com.
Base64Value: ''
# Here you can set whether the player head should be used by the player who has opened the GUI.
PlayerWhoHasOpenedTheGUI: false
# Here you can set a specific player from which the player head should be used
PlayerName: ''
# Here you can set a Minecraft material to be used. This is ignored when PlayerHead is used
Material: 'DIRT'
# Here you set the DisplayName of the item
Name: 'Item Title'
# Here you set the lore of the item
Lore:
- '&8-----------------'
- '&bLine 1'
- '&bLine 2'
- '&8-----------------'
CustomSound:
# Here you can set whether a specific sound or the default sound from the config.yml should be used.
Enable: false
# Here you can deactivate the sound for this item. CustomSound must be activated for this!
NoSound: false
# Here you set the custom sound
Sound: ''
Cost:
# Here you can specify whether the function should cost or not
Enable: false
# Here you set which economy mode should be used.
# Use 'VAULT' / 'MONEY' for money via vault.
# Use 'ITEM' to pay with items.
# Use 'VOTEPOINTS' to pay with vote points from VotingPlugin (https://spigotmc.org/resources/votingplugin.15358/).
EcoModule: VAULT
# Set the item and the quantity for the ITEM mode here. (ITEM;AMOUNT)
Item: DIRT;5
# Set here the VotePoints for the VOTEPOINTS mode.
VotePoints: 0
# Set the money here for the mode VAULT or MONEY
Price: 0.0
Command:
# Here you can enable or disable the Command function
# Placeholder: [player] = PlayerName
Enable: false
# Here you can specify if this command should be executed on the bugee
BungeeCommand: false
# Here you can set if the command should be executed from the console
# Example: You can also create a store with this command.
# /give [player] stone | So all commands can be executed even those for which the player has no permission.
CommandAsConsole: false
# Here you can set commands. Several commands are also possible.
# They are processed from top to bottom and executed one after the other!
Command:
- 'command 1'
- 'command 2'
ServerChange:
# Here you can enable or disable the function ServerChange
# To use this function the function BungeeCord must be activated in the conig.yml and the plugin must be installed on the proxy!
Enable: false
# # Here you can say which server the player should be moved to.
Server: ''
OpenGUI:
# Here you can enable or disable the OpenGUI feature
Enable: false
# Here you can set which GUI should be opened.
# Use the file name of the GUI without .yml
GUI: ''
Toggle:
# Here you can enable a feature that allows players to give or remove permissions to each other
# The commands for the permission plugin can be set in the config (default for LuckPerms)
Permission:
# Activate this function here
Enable: false
# Set the permission here
Permission: ''
UseItem:
# When this function is enabled, players can toggle the UseItem on and off.
# For this function 'UseItem.AllowToggle' must be activated in config.yml!
Enable: false
Message:
# Here you can enable or disable the Message function
Enable: false
# Here you can set the messages to be sent to the player
# Placeholder: [player] = PlayerName | [prefix] = PluginPrefix | [price] = price if function Cost is activated
Message:
- 'Message line 1'
- 'Message line 2'
SetConfig:
# Here you can enable or disable the SetConfig function
Enable: false
File:
# Here you define in which file something should be changed
# Example at this file: 'plugins/CommandGUI/GUIs/default.yml'.
Path: ''
Option:
# Here you set the option to be changed
# Example on the option of this example slots: 'Slots.Example.Slot'
Path: ''
# Here you set which format should be set
# String = text in one line
# Boolean = true / false
# Integer = numbers without comma
# Double = number with comma | Please use . as comma
# List = text with multiple lines (- 'hi')
Premat: String
Value:
# Here you can set which value should be set when you click with the left mouse button.
LeftClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
# Here you set which value should be set when clicking with the right mouse button
RightClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
PluginReload:
# Here you can set if the plugin to which a file was changed should be reloaded directly
Enable: false
# Here you set the reload command to be used
# The command is executed by the console! No / is needed!
Command: ''
FunctionVotePoints:
# With this function you can give or subtract VotePoints from VotingPlugin to a player.
Enable: false
# Use to add: ADD
# Use to subtract: REMOVE
Mode: ADD
# Set the number of vote points to be subtracted / added here
Amount: 0
FunctionItem:
# With this function you can give or remove items to a player
Enable: false
# Use to add: ADD
# Use to subtract: REMOVE
Mode: REMOVE
# Enter the item (material) and the number behind it. Separate them with ; (ITEM;AMOUNT)
Item: DIRT;5

View File

@@ -0,0 +1,51 @@
################################################
## To add another GUI just create a new file. ##
################################################
GUI:
# Enable or disable the GUI
Enable: true
# Set the lines of the GUI here (1-6)
Lines: 1
# Here you set the display name of the GUI
Name: '&5default &9GUI'
FillItem:
# Activate or deactivate the FillItem here
Enable: true
# Here you can set the FillItem
Item: BLACK_STAINED_GLASS_PANE
# Here you set the settings for the alias
Command:
# Here you can enable or disable the alias of the GUI. The alias is the file name without .yml
Alias: true
Permission:
# Set here if a permission is needed for the alias or not. | Permission: commandgui.command.<alias>
Required: true
# Here you set the functions and slots
Slots:
# Here is an example of a slot
# To add another slot just copy the block. IMPORTANT: The slot name must not be duplicated (Slots.<name>).
function1:
# Here you set which slot the item / function should be in
Slot: 4
# Here you can activate and deactivate the slot
Enable: true
# Here you specify which function this slot should perform
Function: function1
Permission:
# Here you can set if a permission is needed to use this function.
Required: false
# Placeholder: [function] which function is used | [slot] is the slot number | [slotname] is the name of the key (Slots.KEY)
See: commandgui.gui.[function].slot.[slot].see
Use: commandgui.gui.[function].slot.[slot].use
function2:
Slot: 6
Enable: true
Function: function2
Permission:
Required: false
See: commandgui.gui.[function].slot.[slot].see
Use: commandgui.gui.[function].slot.[slot].use

View File

@@ -0,0 +1,313 @@
#########################################
## Please do not change ConfigVersion! ##
#########################################
ConfigVersion: 5
Plugin:
# Here you can set the debug mode of the plugin.
# It is recommended not to activate this on productive systems. Only if it is really needed!
Debug: false
# Here you can set whether the Helpalias command (/commandguihelp) should be activated.
# If this is changed the server MUST be restarted to change this!
HelpAlias: true
# Here you set which subcommand should be for the admin functions.
# (/commandgui 'admin' reload)
AdminSubCommand: admin
# here you set the language to be used
language: english
# Here you set the character or word that will be used as currency
Currency: $
# Here you set which GUI should be opened at '/commandgui' / '/gui'.
DefaultGUI: default
Storage:
# Set here if MySQL, SQLITE or YML should be used as storage.
Type: SQLITE
# Enter here the access data to the database you want to use, if you use MySQL
MySQL:
IP: localhost
Port: 3306
Database: database
User: root
Password: password
SSL: false
BungeeCord:
# Set here if the plugin runs in a BungeeCord subserver.
# The plugin file must then be installed on the proxy (BungeeCord, Waterfall) and on the servers.
Enable: false
# Set here the server name of the server
ThisServer: server
UseItem:
# Set here if the UseItem is to be used in use
Enable: true
# Set here if players are allowed to enable or disable the UseItem with '/gui-item <on/off>'.
# Permission 'commandgui.useitem.toggle' is additionally required
AllowToggle: true
# Set here if players are allowed to change the slot in the inventory where the UseItem is located with '/gui-item <slot>'.
# Permission 'commandgui.useitem.toggle' is additionally required
AllowSetSlot: true
# Set here if the dropping of the UseItem should be blocked
BlockMoveAndDrop: true
# Set here which GUI should open the UseItem
OpenGUI: default
Permission:
# Set here if the permission 'commandgui.useitem' is required to use the UseItem
NeededToUse: true
# Set here if the UseItem should stay in the inventory with the '/clear' command
KeepAtCommandClear: true
InventorySlot:
# Set here on which slot the UseItem should be located by default
Slot: 1
# Set here if the slot should be forced even if another item is on this slot (also the set slot of the player).
# NOTE: The item that was on this slot before will be deleted.
SlotEnforce: false
# Set here if the UseItem should be placed on another free slot, if the selected slot (also the set slot of the player) is occupied.
FreeSlot: false
# Set here the item that should be used as UseItem
Item:
# Set here which material should be used as UseItem
Material: paper
PlayerHead:
# Set here if a PlayerHead should be used as UseItem
Enable: false
Base64:
# Set here if a Base64 PlayerHead should be used as UseItem
Enable: false
# Here you can set the Base64 Value.
# You can find the Base64 Value for example on https://minecraft-heads.com.
Base64Value: ''
# Here you can set whether the player head should be used as a UseItem by the player
PlayerWhoHasOpenedTheGUI: false
# Here you can set a player name whose head should be used as UseItem
Playername: ''
# Set the DisplayName of the UseItem here
Name: '&6GUI UseItem'
# Set the lore of the UseItem here
Lore:
- 'Lore line 1'
- 'Lore line 2'
Join:
# Set here if the UseItem should be given at every server join
GiveOnEveryJoin: true
# Set here if the UseItem should only be given to the server at the first join of the player.
GiveOnlyOnFirstJoin: false
Cursor:
ToGUIItem:
OnLogin:
# Here you define whether the UseItem should be selected when joining the server.
Enable: true
Spigot:
# Set here if the UseItem should only be selected at the first join
OnOnlyFirstLogin: true
Bungee:
# Set here if the UseItem should be selected even if you change the server of the bungee network.
# The option BungeeCord must be activated for this!
OnServerChange: false
Toggle:
# Set the items to be used with the Toggle function here
Items:
# Set here the item that should be used if you have the permission or the UseItem is active.
OnOrYes:
Item:
Base64:
# Set here if a Base64 head should be used
Enable: false
# Here you can set the Base64 Value.
# You can find the Base64 Value for example on https://minecraft-heads.com.
Base64Value: ''
# Set the material to be used here
Material: GREEN_WOOL
# Set here the item to be used if you have the permission or the UseItem is disabled
OffOrNo:
Item:
Base64:
# Set here if a Base64 head should be used
Enable: false
# Here you can set the Base64 Value.
# You can find the Base64 Value for example on https://minecraft-heads.com.
Base64Value: ''
# Set the material to be used here
Material: RED_WOOL
Permission:
# Set here the commands to be used for Toggle.Permission
Commands:
'True': luckperms user [player] permission set [perm] true
'False': luckperms user [player] permission set [perm] false
# Set the design of the placeholders here
Placeholder:
# Placeholder for true / enabled
'True': '&2true'
# Placeholder for false / disabled
'False': '&4false'
Sound:
# Here you can disable all sounds
Enable: true
# Set here At which action which sound should be played or none at all
OpenInventory:
Enable: true
Sound: BLOCK_CHEST_OPEN
Click:
Enable: true
Sound: BLOCK_NOTE_BLOCK_HAT
NoMoney:
Enable: true
Sound: BLOCK_NOTE_BLOCK_HARP
NoInventorySpace:
Enable: true
Sound: BLOCK_NOTE_BLOCK_HARP
Give:
Enable: true
Sound: ENTITY_PLAYER_LEVELUP
PlayerNotFound:
Enable: true
Sound: BLOCK_NOTE_BLOCK_HARP
Advanced:
UseItem:
GameMode:
Change:
# Set here if the UseItem should be reset when the GameMode is changed.
Enable: true
# Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second).
DelayInTicks: 1
Protection:
# Set here in which gamemode the UseItem may be used
Enable: false
# Set here if the UseItem should be removed if you are in a not allowed Gamemode
RemoveItemWhenItIsDisabled: false
# Set here if a 'blacklist' or 'whitelist' should be used
Mode: blacklist
# Set the GameMode list here
List:
- CREATIVE
- Spectator
World:
Change:
# This specifies whether the UseItem should be reset when the world is changed.
Enable: true
# Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second).
DelayInTicks: 1
Protection:
# Set here in which world the UseItem may be used
Enable: false
# Here you specify whether the UseItem should be removed if you are in a world that is not permitted
RemoveItemWhenItIsDisabled: false
# Set here if a 'blacklist' or 'whitelist' should be used
Mode: blacklist
# Set the worlds here
List:
- World1
- World2
# Set here for which blocks the UseItem is blocked and the function of the block you are looking at should be used.
ItemBlockBlacklist:
- CHEST
- CRAFTING_TABLE
- FURNACE
- OAK_FENCE
- SPRUCE_FENCE
- BIRCH_FENCE
- JUNGLE_FENCE
- ACACIA_FENCE
- DARK_OAK_FENCE
- MANGROVE_FENCE
- CRIMSON_FENCE
- WARPED_FENCE
- NETHER_BRICK_FENCE
- ENDER_CHEST
- BEACON
- ANVIL
- CHIPPED_ANVIL
- DAMAGED_ANVIL
- REPEATER
- COMPARATOR
- HOPPER
- DISPENSER
- DROPPER
- LEVER
- DAYLIGHT_DETECTOR
- TRAPPED_CHEST
- NOTE_BLOCK
- STONE_BUTTON
- POLISHED_BLACKSTONE_BUTTON
- OAK_BUTTON
- SPRUCE_BUTTON
- BIRCH_BUTTON
- JUNGLE_BUTTON
- ACACIA_BUTTON
- DARK_OAK_BUTTON
- MANGROVE_BUTTON
- CRIMSON_BUTTON
- WARPED_BUTTON
- IRON_DOOR
- OAK_DOOR
- SPRUCE_DOOR
- BIRCH_DOOR
- JUNGLE_DOOR
- ACACIA_DOOR
- DARK_OAK_DOOR
- MANGROVE_DOOR
- CRIMSON_DOOR
- WARPED_DOOR
- IRON_TRAPDOOR
- IRON_TRAPDOOR
- OAK_TRAPDOOR
- OAK_TRAPDOOR
- SPRUCE_TRAPDOOR
- SPRUCE_TRAPDOOR
- BIRCH_TRAPDOOR
- BIRCH_TRAPDOOR
- JUNGLE_TRAPDOOR
- JUNGLE_TRAPDOOR
- ACACIA_TRAPDOOR
- ACACIA_TRAPDOOR
- DARK_OAK_TRAPDOOR
- DARK_OAK_TRAPDOOR
- MANGROVE_TRAPDOOR
- MANGROVE_TRAPDOOR
- CRIMSON_TRAPDOOR
- CRIMSON_TRAPDOOR
- WARPED_TRAPDOOR
- WARPED_TRAPDOOR
- OAK_FENCE_GATE
- SPRUCE_FENCE_GATE
- BIRCH_FENCE_GATE
- JUNGLE_FENCE_GATE
- ACACIA_FENCE_GATE
- DARK_OAK_FENCE_GATE
- MANGROVE_FENCE_GATE
- CRIMSON_FENCE_GATE
- WARPED_FENCE_GATE
- CHEST_MINECART
- FURNACE_MINECART
- HOPPER_MINECART
- OAK_CHEST_BOAT
- SPRUCE_CHEST_BOAT
- BIRCH_CHEST_BOAT
- JUNGLE_CHEST_BOAT
- ACACIA_CHEST_BOAT
- DARK_OAK_CHEST_BOAT
- MANGROVE_CHEST_BOAT
- LEATHER_CHESTPLATE
- CHAINMAIL_CHESTPLATE
- IRON_CHESTPLATE
- DIAMOND_CHESTPLATE
- GOLDEN_CHESTPLATE
- NETHERITE_CHESTPLATE
- BREWING_STAND
- LOOM
- COMPOSTER
- BARREL
- SMOKER
- BLAST_FURNACE
- BLAST_FURNACE
- CARTOGRAPHY_TABLE
- FLETCHING_TABLE
- GRINDSTONE
- SMITHING_TABLE
- STONECUTTER

View File

@@ -4,13 +4,8 @@ main: de.jatitv.commandguiv2.Spigot.Main
api-version: 1.13 api-version: 1.13
prefix: CommandGUI prefix: CommandGUI
authors: [ JaTiTV ] authors: [ JaTiTV ]
depend:
softdepend:
- T2CodeLib - T2CodeLib
- Vault
- PlaceholderAPI
- PlotSquaredGUI
- PlugManGUI
commands: commands:
commandgui: commandgui:
@@ -20,4 +15,4 @@ commands:
description: CommandGUI Help description: CommandGUI Help
aliases: [cguihelp, guihelp] aliases: [cguihelp, guihelp]
commandgui-item: commandgui-item:
aliases: [gui-item] aliases: [gui-item, useitem]

View File

@@ -27,6 +27,9 @@ Slots:
Sound: '' Sound: ''
Cost: Cost:
Enable: false Enable: false
EcoModule: VAULT
Item: DIRT;5
VotePoints: 0
Price: 0.0 Price: 0.0
Command: Command:
Enable: false Enable: false
@@ -72,3 +75,11 @@ Slots:
PluginReload: PluginReload:
Enable: false Enable: false
Command: '' Command: ''
FunctionVotePoints:
Enable: false
Mode: ADD
Amount: 0
FunctionItem:
Enable: false
Mode: REMOVE
Item: DIRT;5

View File

@@ -20,6 +20,9 @@ Slots:
Sound: '' Sound: ''
Cost: Cost:
Enable: false Enable: false
EcoModule: VAULT
Item: DIRT;5
VotePoints: 0
Price: 0.0 Price: 0.0
Command: Command:
Enable: false Enable: false
@@ -65,3 +68,11 @@ Slots:
PluginReload: PluginReload:
Enable: false Enable: false
Command: '' Command: ''
FunctionVotePoints:
Enable: false
Mode: ADD
Amount: 0
FunctionItem:
Enable: false
Mode: REMOVE
Item: DIRT;5

View File

@@ -0,0 +1,158 @@
#####################################################
## To add another Function just create a new file. ##
#####################################################
Slots:
Function:
Item:
# Here you can create an empty slot.
# Note: When this is enabled, no functions will work.
Empty: false
# Here you can set the number of items
Amount: 1
PlayerHead:
# Here you can set if the item should be a player head
Enable: false
Base64:
# Here you can specify whether a Base64 player header should be used
Enable: false
# Here you can set the Base64 Value.
# You can find the Base64 Value for example on https://minecraft-heads.com.
Base64Value: ''
# Here you can set whether the player head should be used by the player who has opened the GUI.
PlayerWhoHasOpenedTheGUI: false
# Here you can set a specific player from which the player head should be used
PlayerName: ''
# Here you can set a Minecraft material to be used. This is ignored when PlayerHead is used
Material: 'DIRT'
# Here you set the DisplayName of the item
Name: 'Item Title'
# Here you set the lore of the item
Lore:
- '&8-----------------'
- '&bLine 1'
- '&bLine 2'
- '&8-----------------'
CustomSound:
# Here you can set whether a specific sound or the default sound from the config.yml should be used.
Enable: false
# Here you can deactivate the sound for this item. CustomSound must be activated for this!
NoSound: false
# Here you set the custom sound
Sound: ''
Cost:
# Here you can specify whether the function should cost or not
Enable: false
# Here you set which economy mode should be used.
# Use 'VAULT' / 'MONEY' for money via vault.
# Use 'ITEM' to pay with items.
# Use 'VOTEPOINTS' to pay with vote points from VotingPlugin (https://spigotmc.org/resources/votingplugin.15358/).
EcoModule: VAULT
# Set the item and the quantity for the ITEM mode here. (ITEM;AMOUNT)
Item: DIRT;5
# Set here the VotePoints for the VOTEPOINTS mode.
VotePoints: 0
# Set the money here for the mode VAULT or MONEY
Price: 0.0
Command:
# Here you can enable or disable the Command function
# Placeholder: [player] = PlayerName
Enable: false
# Here you can specify if this command should be executed on the bugee
BungeeCommand: false
# Here you can set if the command should be executed from the console
# Example: You can also create a store with this command.
# /give [player] stone | So all commands can be executed even those for which the player has no permission.
CommandAsConsole: false
# Here you can set commands. Several commands are also possible.
# They are processed from top to bottom and executed one after the other!
Command:
- 'command 1'
- 'command 2'
ServerChange:
# Here you can enable or disable the function ServerChange
# To use this function the function BungeeCord must be activated in the conig.yml and the plugin must be installed on the proxy!
Enable: false
# # Here you can say which server the player should be moved to.
Server: ''
OpenGUI:
# Here you can enable or disable the OpenGUI feature
Enable: false
# Here you can set which GUI should be opened.
# Use the file name of the GUI without .yml
GUI: ''
Toggle:
# Here you can enable a feature that allows players to give or remove permissions to each other
# The commands for the permission plugin can be set in the config (default for LuckPerms)
Permission:
# Activate this function here
Enable: false
# Set the permission here
Permission: ''
UseItem:
# When this function is enabled, players can toggle the UseItem on and off.
# For this function 'UseItem.AllowToggle' must be activated in config.yml!
Enable: false
Message:
# Here you can enable or disable the Message function
Enable: false
# Here you can set the messages to be sent to the player
# Placeholder: [player] = PlayerName | [prefix] = PluginPrefix | [price] = price if function Cost is activated
Message:
- 'Message line 1'
- 'Message line 2'
SetConfig:
# Here you can enable or disable the SetConfig function
Enable: false
File:
# Here you define in which file something should be changed
# Example at this file: 'plugins/CommandGUI/GUIs/default.yml'.
Path: ''
Option:
# Here you set the option to be changed
# Example on the option of this example slots: 'Slots.Example.Slot'
Path: ''
# Here you set which format should be set
# String = text in one line
# Boolean = true / false
# Integer = numbers without comma
# Double = number with comma | Please use . as comma
# List = text with multiple lines (- 'hi')
Premat: String
Value:
# Here you can set which value should be set when you click with the left mouse button.
LeftClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
# Here you set which value should be set when clicking with the right mouse button
RightClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
PluginReload:
# Here you can set if the plugin to which a file was changed should be reloaded directly
Enable: false
# Here you set the reload command to be used
# The command is executed by the console! No / is needed!
Command: ''
FunctionVotePoints:
# With this function you can give or subtract VotePoints from VotingPlugin to a player.
Enable: false
# Use to add: ADD
# Use to subtract: REMOVE
Mode: ADD
# Set the number of vote points to be subtracted / added here
Amount: 0
FunctionItem:
# With this function you can give or remove items to a player
Enable: false
# Use to add: ADD
# Use to subtract: REMOVE
Mode: REMOVE
# Enter the item (material) and the number behind it. Separate them with ; (ITEM;AMOUNT)
Item: DIRT;5

View File

@@ -16,13 +16,13 @@ Slots:
Function: SupportDiscord Function: SupportDiscord
Permission: Permission:
Required: false Required: false
See: commandgui.gui.[guiname].slot.[slot].see See: commandgui.gui.[function].slot.[slot].see
Use: commandgui.gui.[guiname].slot.[slot].use Use: commandgui.gui.[function].slot.[slot].use
UseItem: UseItem:
Slot: 6 Slot: 6
Enable: true Enable: true
Function: UseItem Function: UseItem
Permission: Permission:
Required: false Required: false
See: commandgui.gui.[guiname].slot.[slot].see See: commandgui.gui.[function].slot.[slot].see
Use: commandgui.gui.[guiname].slot.[slot].use Use: commandgui.gui.[function].slot.[slot].use

View File

@@ -0,0 +1,51 @@
################################################
## To add another GUI just create a new file. ##
################################################
GUI:
# Enable or disable the GUI
Enable: true
# Set the lines of the GUI here (1-6)
Lines: 1
# Here you set the display name of the GUI
Name: '&5default &9GUI'
FillItem:
# Activate or deactivate the FillItem here
Enable: true
# Here you can set the FillItem
Item: BLACK_STAINED_GLASS_PANE
# Here you set the settings for the alias
Command:
# Here you can enable or disable the alias of the GUI. The alias is the file name without .yml
Alias: true
Permission:
# Set here if a permission is needed for the alias or not. | Permission: commandgui.command.<alias>
Required: true
# Here you set the functions and slots
Slots:
# Here is an example of a slot
# To add another slot just copy the block. IMPORTANT: The slot name must not be duplicated (Slots.<name>).
function1:
# Here you set which slot the item / function should be in
Slot: 4
# Here you can activate and deactivate the slot
Enable: true
# Here you specify which function this slot should perform
Function: function1
Permission:
# Here you can set if a permission is needed to use this function.
Required: false
# Placeholder: [function] which function is used | [slot] is the slot number | [slotname] is the name of the key (Slots.KEY)
See: commandgui.gui.[function].slot.[slot].see
Use: commandgui.gui.[function].slot.[slot].use
function2:
Slot: 6
Enable: true
Function: function2
Permission:
Required: false
See: commandgui.gui.[function].slot.[slot].see
Use: commandgui.gui.[function].slot.[slot].use

Binary file not shown.

View File

@@ -1,13 +1,13 @@
ConfigVersion: 5 ConfigVersion: 5
Plugin: Plugin:
UpdateCheckOnJoin: true
Debug: false Debug: false
HelpAlias: true HelpAlias: true
AdminSubCommand: admin
language: english language: english
Currency: $ Currency: $
DefaultGUI: default DefaultGUI: default
Storage: Storage:
Type: YML Type: SQLITE
MySQL: MySQL:
IP: localhost IP: localhost
Port: 3306 Port: 3306
@@ -54,30 +54,6 @@ UseItem:
OnOnlyFirstLogin: true OnOnlyFirstLogin: true
Bungee: Bungee:
OnServerChange: false OnServerChange: false
Advanced:
UseItem:
GameMode:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- CREATIVE
- Spectator
World:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- World1
- World2
Toggle: Toggle:
Items: Items:
OnOrYes: OnOrYes:
@@ -119,3 +95,133 @@ Sound:
PlayerNotFound: PlayerNotFound:
Enable: true Enable: true
Sound: BLOCK_NOTE_BLOCK_HARP Sound: BLOCK_NOTE_BLOCK_HARP
Advanced:
UseItem:
GameMode:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- CREATIVE
- Spectator
World:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- World1
- World2
ItemBlockBlacklist:
- CHEST
- CRAFTING_TABLE
- FURNACE
- OAK_FENCE
- SPRUCE_FENCE
- BIRCH_FENCE
- JUNGLE_FENCE
- ACACIA_FENCE
- DARK_OAK_FENCE
- MANGROVE_FENCE
- CRIMSON_FENCE
- WARPED_FENCE
- NETHER_BRICK_FENCE
- ENDER_CHEST
- BEACON
- ANVIL
- CHIPPED_ANVIL
- DAMAGED_ANVIL
- REPEATER
- COMPARATOR
- HOPPER
- DISPENSER
- DROPPER
- LEVER
- DAYLIGHT_DETECTOR
- TRAPPED_CHEST
- NOTE_BLOCK
- STONE_BUTTON
- POLISHED_BLACKSTONE_BUTTON
- OAK_BUTTON
- SPRUCE_BUTTON
- BIRCH_BUTTON
- JUNGLE_BUTTON
- ACACIA_BUTTON
- DARK_OAK_BUTTON
- MANGROVE_BUTTON
- CRIMSON_BUTTON
- WARPED_BUTTON
- IRON_DOOR
- OAK_DOOR
- SPRUCE_DOOR
- BIRCH_DOOR
- JUNGLE_DOOR
- ACACIA_DOOR
- DARK_OAK_DOOR
- MANGROVE_DOOR
- CRIMSON_DOOR
- WARPED_DOOR
- IRON_TRAPDOOR
- IRON_TRAPDOOR
- OAK_TRAPDOOR
- OAK_TRAPDOOR
- SPRUCE_TRAPDOOR
- SPRUCE_TRAPDOOR
- BIRCH_TRAPDOOR
- BIRCH_TRAPDOOR
- JUNGLE_TRAPDOOR
- JUNGLE_TRAPDOOR
- ACACIA_TRAPDOOR
- ACACIA_TRAPDOOR
- DARK_OAK_TRAPDOOR
- DARK_OAK_TRAPDOOR
- MANGROVE_TRAPDOOR
- MANGROVE_TRAPDOOR
- CRIMSON_TRAPDOOR
- CRIMSON_TRAPDOOR
- WARPED_TRAPDOOR
- WARPED_TRAPDOOR
- OAK_FENCE_GATE
- SPRUCE_FENCE_GATE
- BIRCH_FENCE_GATE
- JUNGLE_FENCE_GATE
- ACACIA_FENCE_GATE
- DARK_OAK_FENCE_GATE
- MANGROVE_FENCE_GATE
- CRIMSON_FENCE_GATE
- WARPED_FENCE_GATE
- CHEST_MINECART
- FURNACE_MINECART
- HOPPER_MINECART
- OAK_CHEST_BOAT
- SPRUCE_CHEST_BOAT
- BIRCH_CHEST_BOAT
- JUNGLE_CHEST_BOAT
- ACACIA_CHEST_BOAT
- DARK_OAK_CHEST_BOAT
- MANGROVE_CHEST_BOAT
- LEATHER_CHESTPLATE
- CHAINMAIL_CHESTPLATE
- IRON_CHESTPLATE
- DIAMOND_CHESTPLATE
- GOLDEN_CHESTPLATE
- NETHERITE_CHESTPLATE
- BREWING_STAND
- LOOM
- COMPOSTER
- BARREL
- SMOKER
- BLAST_FURNACE
- BLAST_FURNACE
- CARTOGRAPHY_TABLE
- FLETCHING_TABLE
- GRINDSTONE
- SMITHING_TABLE
- STONECUTTER

View File

@@ -0,0 +1,313 @@
#########################################
## Please do not change ConfigVersion! ##
#########################################
ConfigVersion: 5
Plugin:
# Here you can set the debug mode of the plugin.
# It is recommended not to activate this on productive systems. Only if it is really needed!
Debug: false
# Here you can set whether the Helpalias command (/commandguihelp) should be activated.
# If this is changed the server MUST be restarted to change this!
HelpAlias: true
# Here you set which subcommand should be for the admin functions.
# (/commandgui 'admin' reload)
AdminSubCommand: admin
# here you set the language to be used
language: english
# Here you set the character or word that will be used as currency
Currency: $
# Here you set which GUI should be opened at '/commandgui' / '/gui'.
DefaultGUI: default
Storage:
# Set here if MySQL, SQLITE or YML should be used as storage.
Type: SQLITE
# Enter here the access data to the database you want to use, if you use MySQL
MySQL:
IP: localhost
Port: 3306
Database: database
User: root
Password: password
SSL: false
BungeeCord:
# Set here if the plugin runs in a BungeeCord subserver.
# The plugin file must then be installed on the proxy (BungeeCord, Waterfall) and on the servers.
Enable: false
# Set here the server name of the server
ThisServer: server
UseItem:
# Set here if the UseItem is to be used in use
Enable: true
# Set here if players are allowed to enable or disable the UseItem with '/gui-item <on/off>'.
# Permission 'commandgui.useitem.toggle' is additionally required
AllowToggle: true
# Set here if players are allowed to change the slot in the inventory where the UseItem is located with '/gui-item <slot>'.
# Permission 'commandgui.useitem.toggle' is additionally required
AllowSetSlot: true
# Set here if the dropping of the UseItem should be blocked
BlockMoveAndDrop: true
# Set here which GUI should open the UseItem
OpenGUI: default
Permission:
# Set here if the permission 'commandgui.useitem' is required to use the UseItem
NeededToUse: true
# Set here if the UseItem should stay in the inventory with the '/clear' command
KeepAtCommandClear: true
InventorySlot:
# Set here on which slot the UseItem should be located by default
Slot: 1
# Set here if the slot should be forced even if another item is on this slot (also the set slot of the player).
# NOTE: The item that was on this slot before will be deleted.
SlotEnforce: false
# Set here if the UseItem should be placed on another free slot, if the selected slot (also the set slot of the player) is occupied.
FreeSlot: false
# Set here the item that should be used as UseItem
Item:
# Set here which material should be used as UseItem
Material: paper
PlayerHead:
# Set here if a PlayerHead should be used as UseItem
Enable: false
Base64:
# Set here if a Base64 PlayerHead should be used as UseItem
Enable: false
# Here you can set the Base64 Value.
# You can find the Base64 Value for example on https://minecraft-heads.com.
Base64Value: ''
# Here you can set whether the player head should be used as a UseItem by the player
PlayerWhoHasOpenedTheGUI: false
# Here you can set a player name whose head should be used as UseItem
Playername: ''
# Set the DisplayName of the UseItem here
Name: '&6GUI UseItem'
# Set the lore of the UseItem here
Lore:
- 'Lore line 1'
- 'Lore line 2'
Join:
# Set here if the UseItem should be given at every server join
GiveOnEveryJoin: true
# Set here if the UseItem should only be given to the server at the first join of the player.
GiveOnlyOnFirstJoin: false
Cursor:
ToGUIItem:
OnLogin:
# Here you define whether the UseItem should be selected when joining the server.
Enable: true
Spigot:
# Set here if the UseItem should only be selected at the first join
OnOnlyFirstLogin: true
Bungee:
# Set here if the UseItem should be selected even if you change the server of the bungee network.
# The option BungeeCord must be activated for this!
OnServerChange: false
Toggle:
# Set the items to be used with the Toggle function here
Items:
# Set here the item that should be used if you have the permission or the UseItem is active.
OnOrYes:
Item:
Base64:
# Set here if a Base64 head should be used
Enable: false
# Here you can set the Base64 Value.
# You can find the Base64 Value for example on https://minecraft-heads.com.
Base64Value: ''
# Set the material to be used here
Material: GREEN_WOOL
# Set here the item to be used if you have the permission or the UseItem is disabled
OffOrNo:
Item:
Base64:
# Set here if a Base64 head should be used
Enable: false
# Here you can set the Base64 Value.
# You can find the Base64 Value for example on https://minecraft-heads.com.
Base64Value: ''
# Set the material to be used here
Material: RED_WOOL
Permission:
# Set here the commands to be used for Toggle.Permission
Commands:
'True': luckperms user [player] permission set [perm] true
'False': luckperms user [player] permission set [perm] false
# Set the design of the placeholders here
Placeholder:
# Placeholder for true / enabled
'True': '&2true'
# Placeholder for false / disabled
'False': '&4false'
Sound:
# Here you can disable all sounds
Enable: true
# Set here At which action which sound should be played or none at all
OpenInventory:
Enable: true
Sound: BLOCK_CHEST_OPEN
Click:
Enable: true
Sound: BLOCK_NOTE_BLOCK_HAT
NoMoney:
Enable: true
Sound: BLOCK_NOTE_BLOCK_HARP
NoInventorySpace:
Enable: true
Sound: BLOCK_NOTE_BLOCK_HARP
Give:
Enable: true
Sound: ENTITY_PLAYER_LEVELUP
PlayerNotFound:
Enable: true
Sound: BLOCK_NOTE_BLOCK_HARP
Advanced:
UseItem:
GameMode:
Change:
# Set here if the UseItem should be reset when the GameMode is changed.
Enable: true
# Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second).
DelayInTicks: 1
Protection:
# Set here in which gamemode the UseItem may be used
Enable: false
# Set here if the UseItem should be removed if you are in a not allowed Gamemode
RemoveItemWhenItIsDisabled: false
# Set here if a 'blacklist' or 'whitelist' should be used
Mode: blacklist
# Set the GameMode list here
List:
- CREATIVE
- Spectator
World:
Change:
# This specifies whether the UseItem should be reset when the world is changed.
Enable: true
# Set the delay with which the UseItem should be reset (time in Minecraft ticks. 20 is one second).
DelayInTicks: 1
Protection:
# Set here in which world the UseItem may be used
Enable: false
# Here you specify whether the UseItem should be removed if you are in a world that is not permitted
RemoveItemWhenItIsDisabled: false
# Set here if a 'blacklist' or 'whitelist' should be used
Mode: blacklist
# Set the worlds here
List:
- World1
- World2
# Set here for which blocks the UseItem is blocked and the function of the block you are looking at should be used.
ItemBlockBlacklist:
- CHEST
- CRAFTING_TABLE
- FURNACE
- OAK_FENCE
- SPRUCE_FENCE
- BIRCH_FENCE
- JUNGLE_FENCE
- ACACIA_FENCE
- DARK_OAK_FENCE
- MANGROVE_FENCE
- CRIMSON_FENCE
- WARPED_FENCE
- NETHER_BRICK_FENCE
- ENDER_CHEST
- BEACON
- ANVIL
- CHIPPED_ANVIL
- DAMAGED_ANVIL
- REPEATER
- COMPARATOR
- HOPPER
- DISPENSER
- DROPPER
- LEVER
- DAYLIGHT_DETECTOR
- TRAPPED_CHEST
- NOTE_BLOCK
- STONE_BUTTON
- POLISHED_BLACKSTONE_BUTTON
- OAK_BUTTON
- SPRUCE_BUTTON
- BIRCH_BUTTON
- JUNGLE_BUTTON
- ACACIA_BUTTON
- DARK_OAK_BUTTON
- MANGROVE_BUTTON
- CRIMSON_BUTTON
- WARPED_BUTTON
- IRON_DOOR
- OAK_DOOR
- SPRUCE_DOOR
- BIRCH_DOOR
- JUNGLE_DOOR
- ACACIA_DOOR
- DARK_OAK_DOOR
- MANGROVE_DOOR
- CRIMSON_DOOR
- WARPED_DOOR
- IRON_TRAPDOOR
- IRON_TRAPDOOR
- OAK_TRAPDOOR
- OAK_TRAPDOOR
- SPRUCE_TRAPDOOR
- SPRUCE_TRAPDOOR
- BIRCH_TRAPDOOR
- BIRCH_TRAPDOOR
- JUNGLE_TRAPDOOR
- JUNGLE_TRAPDOOR
- ACACIA_TRAPDOOR
- ACACIA_TRAPDOOR
- DARK_OAK_TRAPDOOR
- DARK_OAK_TRAPDOOR
- MANGROVE_TRAPDOOR
- MANGROVE_TRAPDOOR
- CRIMSON_TRAPDOOR
- CRIMSON_TRAPDOOR
- WARPED_TRAPDOOR
- WARPED_TRAPDOOR
- OAK_FENCE_GATE
- SPRUCE_FENCE_GATE
- BIRCH_FENCE_GATE
- JUNGLE_FENCE_GATE
- ACACIA_FENCE_GATE
- DARK_OAK_FENCE_GATE
- MANGROVE_FENCE_GATE
- CRIMSON_FENCE_GATE
- WARPED_FENCE_GATE
- CHEST_MINECART
- FURNACE_MINECART
- HOPPER_MINECART
- OAK_CHEST_BOAT
- SPRUCE_CHEST_BOAT
- BIRCH_CHEST_BOAT
- JUNGLE_CHEST_BOAT
- ACACIA_CHEST_BOAT
- DARK_OAK_CHEST_BOAT
- MANGROVE_CHEST_BOAT
- LEATHER_CHESTPLATE
- CHAINMAIL_CHESTPLATE
- IRON_CHESTPLATE
- DIAMOND_CHESTPLATE
- GOLDEN_CHESTPLATE
- NETHERITE_CHESTPLATE
- BREWING_STAND
- LOOM
- COMPOSTER
- BARREL
- SMOKER
- BLAST_FURNACE
- BLAST_FURNACE
- CARTOGRAPHY_TABLE
- FLETCHING_TABLE
- GRINDSTONE
- SMITHING_TABLE
- STONECUTTER

View File

@@ -26,7 +26,11 @@ UseItem:
DisabledInWorld: '[prefix] &cThe UseItem is disabled in this World!' DisabledInWorld: '[prefix] &cThe UseItem is disabled in this World!'
Cost: Cost:
Buy_msg: '[prefix] &2You bought [itemname] &2for &6[price]&2.' Buy_msg: '[prefix] &2You bought [itemname] &2for &6[price]&2.'
No_money: '[prefix] &cYou don''t have enough money!' 'No':
Money: '[prefix] &cYou don''t have enough money!/*/&cYou need: &6[price]&c.'
Item: '[prefix] &cYou don''t have enough items of &6[item] &cin your inventory!/*/&cYou
need: &6[amount]&c.'
Vote: '[prefix] &cYou do not have enough vote points!/*/&cYou need: &6[amount]&c.'
NoInventorySpace: '[prefix] &cYou have no room in your inventory!' NoInventorySpace: '[prefix] &cYou have no room in your inventory!'
ServerChange: ServerChange:
onServerChange: '[prefix] &2You will be connected to the server &e[server]§2.' onServerChange: '[prefix] &2You will be connected to the server &e[server]§2.'
@@ -39,6 +43,15 @@ Give:
Player: Player:
PlayerNotFond: '[prefix] &cThe player &6[player] &cwas not found or is not online!' PlayerNotFond: '[prefix] &cThe player &6[player] &cwas not found or is not online!'
PlayerNoInventorySpace: '[prefix] &6[player] &chas no free space in his inventory!' PlayerNoInventorySpace: '[prefix] &6[player] &chas no free space in his inventory!'
FunctionItem:
Add: '[prefix] &2You have &6[amount] [item] &2placed in your inventory.'
Remove: '[prefix] &2You have been &6[amount] [item] &2removed.'
RemoveError: '[prefix] &cYou don''t have so many items!/*/&cYou need &6[amount]
[item]&c!'
FunctionVote:
Add: '[prefix] &2You were given &6[amount] &2Vote points.'
Remove: '[prefix] &2You have been removed &6[amount] &2Vote points.'
RemoveError: '[prefix] &cYou don''t have so many VotePoints!/*/&cYou need &6[amount]&c!'
Help: Help:
CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &eOpen the default GUI &7(&r[gui]&7)&e.' CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &eOpen the default GUI &7(&r[gui]&7)&e.'
Help: '&8''''&b/commandguihelp&8'''' &eOpen this help.' Help: '&8''''&b/commandguihelp&8'''' &eOpen this help.'
@@ -51,5 +64,23 @@ Help:
Reload: '&8''''&b/commandgui admin reload&8'''' &eReload the plugin.' Reload: '&8''''&b/commandgui admin reload&8'''' &eReload the plugin.'
UseItem_On: '&8''''&b/gui-item on&8'''' &eActivate the GUIItem for you.' UseItem_On: '&8''''&b/gui-item on&8'''' &eActivate the GUIItem for you.'
UseItem_Off: '&8''''&b/gui-item off&8'''' &eDisable the GUIItem for yourself.' UseItem_Off: '&8''''&b/gui-item off&8'''' &eDisable the GUIItem for yourself.'
UseItem_Slot: '&8''''&b/gui-item slot [slot]&8'''' &eSet the slot for GUIItem for UseItem_Slot: '&8''''&b/gui-item slot &7<slot>&8'''' &eSet the slot where you want
you.' to have the GUIItem.'
Player:
CGUI: '&b/commandgui &8| &b/cgui/*/&eOpen the default GUI &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui'
Help: '&b/commandguihelp/*/&eOpen this help./*/SUGGEST_COMMAND/*//commandguihelp'
Info: '&b/commandgui admin info/*/&eCall the info from &4Command&9GUI &e./*/SUGGEST_COMMAND/*//commandgui
admin info'
Open: '&b/commandgui [gui]/*/&eOpen the GUI: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui '
Give: '&b/commandgui admin give &7<player>/*/&eGive a player the GUI item./*/SUGGEST_COMMAND/*//commandgui
admin give '
CreateDefaultGUI: '&b/commandgui admin createdefaultgui/*/&eCreate a default GUI
&7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui'
Reload: '&b/commandgui admin reload/*/&eReload the plugin./*/SUGGEST_COMMAND/*//commandgui
admin reload'
UseItem_On: '&b/gui-item on/*/&eActivate the GUIItem for you./*/SUGGEST_COMMAND/*//gui-item
on'
UseItem_Off: '&b/gui-item off/*/&eDisable the GUIItem for yourself./*/SUGGEST_COMMAND/*//gui-item
off'
UseItem_Slot: '&b/gui-item slot &7<slot>/*/&eSet the slot where you want to have
the GUIItem./*/SUGGEST_COMMAND/*//gui-item slot '

View File

@@ -26,7 +26,12 @@ UseItem:
DisabledInWorld: '[prefix] &cDas UseItem ist in dieser Welt deaktiviert!' DisabledInWorld: '[prefix] &cDas UseItem ist in dieser Welt deaktiviert!'
Cost: Cost:
Buy_msg: '[prefix] &2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.' Buy_msg: '[prefix] &2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.'
No_money: '[prefix] &cDu hast nicht gen[ue]gend Geld!' 'No':
Money: '[prefix] &cDu hast nicht gen[ue]gend Geld!/*/&cDu ben[oe]tigst [price].'
Item: '[prefix] &cDu hast nicht gen[ue]gent Items von &6[item] &cim Inventar!/*/&cDu
ben[oe]tigst: &6[amount]&c.'
Vote: '[prefix] &cDu hast nicht gen[ue]gent Vote Punkte!/*/&cDu ben[oe]tigst:
&6[amount]&c.'
NoInventorySpace: '[prefix] &cDu hast keinen Platz in deinem Inventar!' NoInventorySpace: '[prefix] &cDu hast keinen Platz in deinem Inventar!'
ServerChange: ServerChange:
onServerChange: '[prefix] &2Du wirst auf den Server §e[server] §2verbunden.' onServerChange: '[prefix] &2Du wirst auf den Server §e[server] §2verbunden.'
@@ -41,6 +46,15 @@ Player:
nicht Online!' nicht Online!'
PlayerNoInventorySpace: '[prefix] &6[player] &chat keinen freien Platz in seinem PlayerNoInventorySpace: '[prefix] &6[player] &chat keinen freien Platz in seinem
Inventar!' Inventar!'
FunctionItem:
Add: '[prefix] &2Dir wurden &6[amount] [item] &2in dein Inventar gelegt.'
Remove: '[prefix] &2Dir wurden &6[amount] [item] &2entfernt.'
RemoveError: '[prefix] &cDu hast nicht so viele Items!/*/&cDu benötigets &6[amount]
[item]&c!'
FunctionVote:
Add: '[prefix] &2Dir wurden &6[amount] &2Vote Punkte gegeben.'
Remove: '[prefix] &2Dir wurden &6[amount] &2Vote Punkte entfernt.'
RemoveError: '[prefix] &cDu hast nicht so viele VotePunkte!/*/&cDu benötigets &6[amount]&c!'
Help: Help:
CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &e[OE]ffne die default GUI &7(&r[gui]&7)&e.' CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &e[OE]ffne die default GUI &7(&r[gui]&7)&e.'
Help: '&8''''&b/commandguihelp&8'''' &e[OE]ffne diese help.' Help: '&8''''&b/commandguihelp&8'''' &e[OE]ffne diese help.'
@@ -54,5 +68,23 @@ Help:
Reload: '&8''''&b/commandgui admin reload&8'''' &eLade das Plugin neu.' Reload: '&8''''&b/commandgui admin reload&8'''' &eLade das Plugin neu.'
UseItem_On: '&8''''&b/gui-item on&8'''' &eAktiviere f[ue]r dich das GUIItem.' UseItem_On: '&8''''&b/gui-item on&8'''' &eAktiviere f[ue]r dich das GUIItem.'
UseItem_Off: '&8''''&b/gui-item off&8'''' &eDeaktiviere f[ue]r dich das GUIItem.' UseItem_Off: '&8''''&b/gui-item off&8'''' &eDeaktiviere f[ue]r dich das GUIItem.'
UseItem_Slot: '&8''''&b/gui-item slot [slot]&8'''' &eSetze den Slot für GUIItem UseItem_Slot: '&8''''&b/gui-item slot &7<slot>&8'''' &eStelle den Slot ein, auf
für Sie einstellen.' den du das GUIItem haben möchtest.'
Player:
CGUI: '&b/commandgui &8| &b/cgui/*/&e[OE]ffne die default GUI &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui'
Help: '&b/commandguihelp/*/&e[OE]ffne diese help./*/SUGGEST_COMMAND/*//commandguihelp'
Info: '&b/commandgui admin info/*/&eRufe die Infos von &4Command&9GUI &eauf./*/SUGGEST_COMMAND/*//commandgui
admin info'
Open: '&b/commandgui [gui]/*/&e[OE]ffne die GUI: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui '
Give: '&b/commandgui admin give &7<player>/*/&eGebe einem Spieler das GUI-Item./*/SUGGEST_COMMAND/*//commandgui
admin give '
CreateDefaultGUI: '&b/commandgui admin createdefaultgui/*/&eLasse eine default
GUI erstellen &7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui'
Reload: '&b/commandgui admin reload/*/&eLade das Plugin neu./*/SUGGEST_COMMAND/*//commandgui
admin reload'
UseItem_On: '&b/gui-item on/*/&eAktiviere f[ue]r dich das GUIItem./*/SUGGEST_COMMAND/*//gui-item
on'
UseItem_Off: '&b/gui-item off/*/&eDeaktiviere f[ue]r dich das GUIItem./*/SUGGEST_COMMAND/*//gui-item
off'
UseItem_Slot: '&b/gui-item slot &7<slot>/*/&eStelle den Slot ein, auf den du das
GUIItem haben möchtest./*/SUGGEST_COMMAND/*//gui-item slot '

View File

@@ -25,7 +25,11 @@ UseItem:
DisabledInWorld: '[prefix] &cUseItem er deaktivert i denne verden!' DisabledInWorld: '[prefix] &cUseItem er deaktivert i denne verden!'
Cost: Cost:
Buy_msg: '[prefix] &2Du kjøpte [itemname] &2for &6[price]&2.' Buy_msg: '[prefix] &2Du kjøpte [itemname] &2for &6[price]&2.'
No_money: '[prefix] &cDu har ikke nok penger!' 'No':
Money: '[prefix] &cDu har ikke nok penger!/*/&cDu trenger &6[price]&c.'
Item: '[prefix] &cDu har ikke nok varer av &6[item] &ci inventaret ditt!/*/&cDu
trenger: &6[amount]&c.'
Vote: '[prefix] &cDu har ikke nok stemmepoeng!/*/&cDu trenger: &6[amount]&c.'
NoInventorySpace: '[prefix] &cDu har ikke nok plass i inventaret ditt!' NoInventorySpace: '[prefix] &cDu har ikke nok plass i inventaret ditt!'
ServerChange: ServerChange:
onServerChange: '[prefix] &2Du vil bli tilkoblet serveren &e[server]&2.' onServerChange: '[prefix] &2Du vil bli tilkoblet serveren &e[server]&2.'
@@ -39,6 +43,14 @@ Player:
PlayerNotFond: '[prefix] &cSpilleren &6[player] &cble ikke funnet eller er ikke PlayerNotFond: '[prefix] &cSpilleren &6[player] &cble ikke funnet eller er ikke
pålogget!' pålogget!'
PlayerNoInventorySpace: '[prefix] &6[player] &char ikke nok plass i inventaret sitt!' PlayerNoInventorySpace: '[prefix] &6[player] &char ikke nok plass i inventaret sitt!'
FunctionItem:
Add: '[prefix] &2Du har &6[amount] [item] &2plassert i beholdningen din.'
Remove: '[prefix] &2Du har blitt &6[amount] [item] &2fjernet.'
RemoveError: '[prefix] &cDu har ikke så mange varer!/*/&cDu trenger &6[amount] [item]&c!'
FunctionVote:
Add: '[prefix] &2Du fikk &6[amount] &2stemmepoeng.'
Remove: '[prefix] &2Du har blitt fjernet &6[amount] &2Stemmepoeng.'
RemoveError: '[prefix] &cDu har ikke så mange stemmepoeng!/*/&cDu trenger &6[amount]&c!'
Help: Help:
CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &eÅpne default GUIen &7(&r[gui]&7)&e.' CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &eÅpne default GUIen &7(&r[gui]&7)&e.'
Help: '&8''''&b/commandguihelp&8'''' &eSender denne hjelpe meldingen.' Help: '&8''''&b/commandguihelp&8'''' &eSender denne hjelpe meldingen.'
@@ -50,5 +62,23 @@ Help:
Reload: '&8''''&b/commandgui admin reload&8'''' &eLast inn pluginet på nytt.' Reload: '&8''''&b/commandgui admin reload&8'''' &eLast inn pluginet på nytt.'
UseItem_On: '&8''''&b/gui-item on&8'''' &eAktiverer en GUI gjenstand for deg.' UseItem_On: '&8''''&b/gui-item on&8'''' &eAktiverer en GUI gjenstand for deg.'
UseItem_Off: '&8''''&b/gui-item off&8'''' &eDeaktiverer en GUI gjenstand for deg.' UseItem_Off: '&8''''&b/gui-item off&8'''' &eDeaktiverer en GUI gjenstand for deg.'
UseItem_Slot: '&8''''&b/gui-item slot [slot]&8'''' &eSett sporet for GUIItem for UseItem_Slot: '&8''''&b/gui-item slot &7<slot>&8'''' &eSett sporet for GUIItem for
deg.' deg.'
Player:
CGUI: '&b/commandgui &8| &b/cgui/*/&eÅpne default GUIen &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui'
Help: '&b/commandguihelp/*/&eSender denne hjelpe meldingen./*/SUGGEST_COMMAND/*//commandguihelp'
Info: '&b/commandgui admin info/*/&eKall informasjon fra &4Command&9GUI&e./*/SUGGEST_COMMAND/*//commandgui
admin info'
Open: '&b/commandgui [gui]/*/&eÅpne GUIen: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui '
Give: '&b/commandgui admin give &7<player>/*/&eGi en spiller GUI gjenstanden./*/SUGGEST_COMMAND/*//commandgui
admin give '
CreateDefaultGUI: '&b/commandgui admin createdefaultgui/*/&eLag en normalverdi
GUI &7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui'
Reload: '&b/commandgui admin reload/*/&eLast inn pluginet på nytt./*/SUGGEST_COMMAND/*//commandgui
admin reload'
UseItem_On: '&b/gui-item on/*/&eAktiverer en GUI gjenstand for deg./*/SUGGEST_COMMAND/*//gui-item
on'
UseItem_Off: '&b/gui-item off/*/&eDeaktiverer en GUI gjenstand for deg./*/SUGGEST_COMMAND/*//gui-item
off'
UseItem_Slot: '&b/gui-item slot &7<slot>/*/&eSett sporet for GUIItem for deg./*/SUGGEST_COMMAND/*//gui-item
slot '