This commit is contained in:
JaTiTV 2022-01-01 03:40:54 +01:00
parent 35c277ba3b
commit b36fdc2d67
20 changed files with 96 additions and 92 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.5.16</version> <version>2.5.17</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>CommandGUI</name> <name>CommandGUI</name>
@ -81,7 +81,7 @@
<dependency> <dependency>
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>8</version> <version>9.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.t2code.minecraft.1_18.r1</groupId> <groupId>net.t2code.minecraft.1_18.r1</groupId>

View File

@ -1,10 +1,10 @@
package de.jatitv.commandguiv2.Bungee; package de.jatitv.commandguiv2.Bungee;
import de.jatitv.commandguiv2.Util;
import net.md_5.bungee.config.Configuration; import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider; import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration; import net.md_5.bungee.config.YamlConfiguration;
import net.t2code.lib.Bungee.Lib.messages.Bsend; import net.t2code.lib.Bungee.Lib.messages.Bsend;
import net.t2code.lib.Util;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -35,7 +35,7 @@ public class BConfig {
configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(BMain.plugin.getDataFolder(), "config.yml")); configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(BMain.plugin.getDataFolder(), "config.yml"));
BMySQL.Enable = configuration.getBoolean("MySQL.Enable"); BMySQL.Enable = configuration.getBoolean("MySQL.Enable");
} catch (IOException e) { } catch (IOException e) {
Bsend.console(Util.Prefix + " Please replace the config: MySQL.Enable: [false,true]"); Bsend.console(Util.getSpigot() + " Please replace the config: MySQL.Enable: [false,true]");
e.printStackTrace(); e.printStackTrace();
} }
try { try {

View File

@ -29,7 +29,7 @@ public final class BMain extends Plugin {
plugin = this; plugin = this;
autor = plugin.getDescription().getAuthor(); autor = plugin.getDescription().getAuthor();
version = plugin.getDescription().getVersion(); version = plugin.getDescription().getVersion();
if (pluginNotFound("T2CodeLib", 96388, Util.requiredT2CodeLibVersion)) return; if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
Bsend.console(prefix + "§4============================= §8[§4Command§9GUI§5BUNGEE§8] §4============================="); Bsend.console(prefix + "§4============================= §8[§4Command§9GUI§5BUNGEE§8] §4=============================");
Bsend.console(prefix + "§4 _____ §9_____ _ _ _____ §e ___ "); Bsend.console(prefix + "§4 _____ §9_____ _ _ _____ §e ___ ");
Bsend.console(prefix + "§4 / ____§9/ ____| | | |_ _|§e |__ \\ "); Bsend.console(prefix + "§4 / ____§9/ ____| | | |_ _|§e |__ \\ ");

View File

@ -7,11 +7,11 @@ import de.jatitv.commandguiv2.Spigot.Objekte.Object;
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI; import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.items.ItemVersion; import net.t2code.lib.Spigot.Lib.items.ItemVersion;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.replace.Replace; import net.t2code.lib.Spigot.Lib.replace.Replace;
import net.t2code.lib.Spigot.Lib.vault.Vault; import net.t2code.lib.Spigot.Lib.vault.Vault;
import net.t2code.lib.Util;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
@ -28,7 +28,7 @@ import java.io.IOException;
public class GUI_Listener implements Listener { public class GUI_Listener implements Listener {
private static String prefix = Util.Prefix; private static String prefix = Util.getPrefix();
public static String GUICode; public static String GUICode;
private static Plugin plugin = Main.plugin; private static Plugin plugin = Main.plugin;

View File

@ -5,6 +5,7 @@ package de.jatitv.commandguiv2.Spigot.Listener;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database; import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI; import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -22,7 +23,7 @@ public class PluginEvent implements Listener {
public void onJoinEvent(PlayerLoginEvent event) { public void onJoinEvent(PlayerLoginEvent event) {
Player player = event.getPlayer(); Player player = event.getPlayer();
Select_Database.nameCheck(player); Select_Database.nameCheck(player);
UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Main.spigot, Main.discord); UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord());
} }

View File

@ -32,10 +32,6 @@ public final class Main extends JavaPlugin {
public static String version; public static String version;
public static List<String> autor; public static List<String> autor;
public static Integer spigotID = Util.SpigotID;
public static Integer bstatsID = Util.BstatsID;
public static String spigot = Util.Spigot;
public static String discord = Util.Discord;
public static Main plugin; public static Main plugin;
public static List plugins; public static List plugins;
@ -57,12 +53,12 @@ public final class Main extends JavaPlugin {
plugin = this; plugin = this;
autor = plugin.getDescription().getAuthors(); autor = plugin.getDescription().getAuthors();
version = plugin.getDescription().getVersion(); version = plugin.getDescription().getVersion();
if (pluginNotFound("T2CodeLib", 96388, Util.requiredT2CodeLibVersion)) return; if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
if (PluginCheck.papi()) { if (PluginCheck.papi()) {
PaPi = true; PaPi = true;
} }
Load.onLoad(prefix, autor, version, spigot, spigotID, discord, bstatsID); Load.onLoad(prefix, autor, version, Util.getSpigot(), Util.getSpigotID(), Util.getDiscord(), Util.getBstatsID());
enable = true; enable = true;
} }
@ -113,6 +109,6 @@ public final class Main extends JavaPlugin {
@Override @Override
public void onDisable() { public void onDisable() {
// Plugin shutdown logic // Plugin shutdown logic
if (enable) T2CodeTemplate.onDisable(prefix, autor, version, spigot, discord); if (enable) T2CodeTemplate.onDisable(prefix, autor, version, Util.getSpigot(), Util.getDiscord());
} }
} }

View File

@ -18,7 +18,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
public class CmdExecuter_Admin implements CommandExecutor, TabCompleter { public class CmdExecuter_Admin implements CommandExecutor, TabCompleter {
private static String prefix = Util.Prefix; private static String prefix = Util.getPrefix();
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

View File

@ -1,11 +1,10 @@
package de.jatitv.commandguiv2.Spigot.cmdManagement; package de.jatitv.commandguiv2.Spigot.cmdManagement;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.Debug; import de.jatitv.commandguiv2.Spigot.system.Debug;
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate; import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Bungee.Lib.commands.BTab;
import net.t2code.lib.Spigot.Lib.commands.Tab; import net.t2code.lib.Spigot.Lib.commands.Tab;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -19,7 +18,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
public class CmdExecuter_GUI implements CommandExecutor, TabCompleter { public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
private static String prefix = Util.Prefix; private static String prefix = Util.getPrefix();
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

View File

@ -1,8 +1,7 @@
package de.jatitv.commandguiv2.Spigot.cmdManagement; package de.jatitv.commandguiv2.Spigot.cmdManagement;
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -16,7 +15,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter { public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
private static String prefix = Util.Prefix; private static String prefix = Util.getPrefix();
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

View File

@ -1,13 +1,12 @@
package de.jatitv.commandguiv2.Spigot.cmdManagement; package de.jatitv.commandguiv2.Spigot.cmdManagement;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
public class CmdExecuter_Help implements CommandExecutor { public class CmdExecuter_Help implements CommandExecutor {
private static String prefix = Util.Prefix; private static String prefix = Util.getPrefix();
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

View File

@ -7,15 +7,12 @@ import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI; import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
import de.jatitv.commandguiv2.Spigot.system.Give_UseItem; import de.jatitv.commandguiv2.Spigot.system.Give_UseItem;
import de.jatitv.commandguiv2.Spigot.system.config.config.ConfigCreate; import de.jatitv.commandguiv2.Spigot.system.config.config.ConfigCreate;
import de.jatitv.commandguiv2.Spigot.system.config.languages.LanguagesCreate;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.system.config.languages.LanguagesCreate;
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database; import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
import de.jatitv.commandguiv2.Util; import de.jatitv.commandguiv2.Util;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.TextComponent;
import net.t2code.lib.Spigot.Lib.items.ItemVersion; import net.t2code.lib.Spigot.Lib.items.ItemVersion;
import net.t2code.lib.Spigot.Lib.messages.TextBuilder;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI; import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -23,64 +20,56 @@ import org.bukkit.Material;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
public class Commands { public class Commands {
private static Plugin plugin = Main.plugin;
private static String prefix = Util.Prefix;
private static String autor = String.valueOf(Main.autor);
private static String version = Main.version;
private static String spigot = Util.Spigot;
private static String discord = Util.Discord;
public static void info(CommandSender sender) { public static void info(CommandSender sender) {
if (sender instanceof Player) { if (sender instanceof Player) {
Player player = (Player) sender; Player player = (Player) sender;
send.player(player, prefix + "§4======= §8[§4Command§9GUI§8] §4======="); send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
send.player(player, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", "")); send.player(player, Util.getPrefix() + " §2String.valueOf(Main.autor): §6" + String.valueOf(String.valueOf(Main.autor)).replace("[", "").replace("]", ""));
if (UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion.equalsIgnoreCase(version)) { if (UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion.equalsIgnoreCase(Main.version)) {
send.player(player, prefix + " §2Version: §6" + version); send.player(player, Util.getPrefix() + " §2Version: §6" + Main.version);
} else { } else {
UpdateAPI.sendUpdateMsg(prefix,spigot,discord,version,UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion,player); UpdateAPI.sendUpdateMsg(Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion, player);
} }
send.player(player, prefix + " §2Spigot: §6" + spigot); send.player(player, Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
send.player(player, prefix + " §2Discord: §6" + discord); send.player(player, Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
send.player(player, prefix + "§4======= §8[§4Command§9GUI§8] §4======="); send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
} else { } else {
send.sender(sender, prefix + "§4======= §8[§4Command§9GUI§8] §4======="); send.sender(sender, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
send.sender(sender, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", "")); send.sender(sender, Util.getPrefix() + " §2String.valueOf(Main.autor): §6" + String.valueOf(String.valueOf(Main.autor)).replace("[", "").replace("]", ""));
if (UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion.equalsIgnoreCase(version)) { if (UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion.equalsIgnoreCase(Main.version)) {
send.sender(sender,prefix + " §2Version: §6" + version); send.sender(sender, Util.getPrefix() + " §2Version: §6" + Main.version);
} else { } else {
UpdateAPI.sendUpdateMsg(prefix,spigot,discord,version,UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion); UpdateAPI.sendUpdateMsg(Util.getPrefix(), Util.getSpigot(), Util.getDiscord(), Main.version, UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion);
} }
send.sender(sender, prefix + " §2Spigot: §6" + spigot); send.sender(sender, Util.getPrefix() + " §2Spigot: §6" + Util.getSpigot());
send.sender(sender, prefix + " §2Discord: §6" + discord); send.sender(sender, Util.getPrefix() + " §2Discord: §6" + Util.getDiscord());
send.sender(sender, prefix + "§4======= §8[§4Command§9GUI§8] §4======="); send.sender(sender, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
} }
} }
public static void reload(CommandSender sender) { public static void reload(CommandSender sender) {
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadStart); if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadStart);
send.console(prefix + "§8-------------------------------"); send.console(Util.getPrefix() + "§8-------------------------------");
send.console(prefix + " §6Plugin reload..."); send.console(Util.getPrefix() + " §6Plugin reload...");
send.console(prefix + "§8-------------------------------"); send.console(Util.getPrefix() + "§8-------------------------------");
CmdExecuter_GUI.arg1.clear(); CmdExecuter_GUI.arg1.clear();
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info"); CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
ConfigCreate.configCreate(); ConfigCreate.configCreate();
SelectConfig.onSelect(); SelectConfig.onSelect();
plugin.reloadConfig(); Main.plugin.reloadConfig();
LanguagesCreate.langCreate(); LanguagesCreate.langCreate();
Obj_Select.onSelect(); Obj_Select.onSelect();
SelectMessages.onSelect(prefix); SelectMessages.onSelect(Util.getPrefix());
SelectConfig.sound(prefix); SelectConfig.sound(Util.getPrefix());
try { try {
AliasRegister.onRegister(); AliasRegister.onRegister();
} catch (Exception e) { } catch (Exception e) {
@ -92,9 +81,9 @@ public class Commands {
} }
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadEnd); if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadEnd);
send.console(prefix + "§8-------------------------------"); send.console(Util.getPrefix() + "§8-------------------------------");
send.console(prefix + " §2Plugin successfully reloaded."); send.console(Util.getPrefix() + " §2Plugin successfully reloaded.");
send.console(prefix + "§8-------------------------------"); send.console(Util.getPrefix() + "§8-------------------------------");
} }
public static void give(CommandSender sender, Player target) { public static void give(CommandSender sender, Player target) {
@ -137,7 +126,7 @@ public class Commands {
slot = Select_Database.selectSlot(player); slot = Select_Database.selectSlot(player);
} }
} }
send.debug(plugin,String.valueOf(slot)); send.debug(Main.plugin, String.valueOf(slot));
if (player.getInventory().getItem(slot - 1) == null) { if (player.getInventory().getItem(slot - 1) == null) {
Select_Database.setItemStatusTrue(player); Select_Database.setItemStatusTrue(player);
Give_UseItem.onGive(player); Give_UseItem.onGive(player);
@ -218,7 +207,7 @@ public class Commands {
Give_UseItem.onGive(player); Give_UseItem.onGive(player);
} }
send.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString())); send.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString()));
} else player.sendMessage(prefix + " §4Function disabled"); } else player.sendMessage(Util.getPrefix() + " §4Function disabled");
} }
public static void gui(Player player) { public static void gui(Player player) {
@ -235,6 +224,7 @@ public class Commands {
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.GUI_Name)); } else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.GUI_Name));
} }
} }
public static void gui(Player player, String arg) { public static void gui(Player player, String arg) {
if (Main.guiHashMap.containsKey(arg)) { if (Main.guiHashMap.containsKey(arg)) {
Object gui = Main.guiHashMap.get(arg); Object gui = Main.guiHashMap.get(arg);

View File

@ -10,7 +10,7 @@ import net.t2code.lib.Spigot.Lib.replace.Replace;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
public class Help { public class Help {
private static String prefix = Util.Prefix; private static String prefix = Util.getPrefix();
public static void sendHelp(CommandSender sender, String Prefix) { public static void sendHelp(CommandSender sender, String Prefix) {
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----"); send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
if (sender.hasPermission("commandgui.command")) { if (sender.hasPermission("commandgui.command")) {

View File

@ -18,7 +18,7 @@ public class AliasRegister {
File f = new File(Main.getPath() + "/GUIs/"); File f = new File(Main.getPath() + "/GUIs/");
File[] fileArray = f.listFiles(); File[] fileArray = f.listFiles();
if (Main.allAliases.toString().equals("[]")) { if (Main.allAliases.toString().equals("[]")) {
send.console(Util.Prefix + " §4No GUI files available"); send.console(Util.getSpigot() + " §4No GUI files available");
return; return;
} }
for (String alias : Main.allAliases) { for (String alias : Main.allAliases) {

View File

@ -29,7 +29,7 @@ import java.util.UUID;
public class OpenGUI { public class OpenGUI {
private static Plugin plugin = Main.plugin; private static Plugin plugin = Main.plugin;
private static String prefix = Util.Prefix; private static String prefix = Util.getPrefix();
public static void openGUI(Player player, Object gui, String guiString) { public static void openGUI(Player player, Object gui, String guiString) {
Long long_ = Long.valueOf(System.currentTimeMillis()); Long long_ = Long.valueOf(System.currentTimeMillis());

View File

@ -11,7 +11,6 @@ import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.lib.Spigot.Lib.replace.Replace; import net.t2code.lib.Spigot.Lib.replace.Replace;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
@ -21,7 +20,6 @@ import java.lang.reflect.Field;
import java.util.UUID; import java.util.UUID;
public class Give_UseItem { public class Give_UseItem {
private static String prefix = Util.Prefix;
public static void onGive(Player player) { public static void onGive(Player player) {
@ -58,8 +56,8 @@ public class Give_UseItem {
playerheadmeta.setDisplayName(SelectConfig.UseItem_Name); playerheadmeta.setDisplayName(SelectConfig.UseItem_Name);
if (SelectConfig.UseItem_Base64_Enable) { if (SelectConfig.UseItem_Base64_Enable) {
if (Main.PaPi) { if (Main.PaPi) {
playerheadmeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore)); playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
} else playerheadmeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore)); } else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore));
GameProfile profile = new GameProfile(UUID.randomUUID(), ""); GameProfile profile = new GameProfile(UUID.randomUUID(), "");
profile.getProperties().put("textures", new Property("textures", SelectConfig.UseItem_Base64value)); profile.getProperties().put("textures", new Property("textures", SelectConfig.UseItem_Base64value));
Field profileField = null; Field profileField = null;
@ -77,8 +75,8 @@ public class Give_UseItem {
} else p = SelectConfig.UseItem_PlayerName; } else p = SelectConfig.UseItem_PlayerName;
playerheadmeta.setOwner(p); playerheadmeta.setOwner(p);
if (Main.PaPi) { if (Main.PaPi) {
playerheadmeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore)); playerheadmeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
} else playerheadmeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore)); } else playerheadmeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore));
} }
item.setItemMeta(playerheadmeta); item.setItemMeta(playerheadmeta);
} }
@ -87,8 +85,8 @@ public class Give_UseItem {
ItemMeta itemMeta = item.getItemMeta(); ItemMeta itemMeta = item.getItemMeta();
itemMeta.setDisplayName(SelectConfig.UseItem_Name); itemMeta.setDisplayName(SelectConfig.UseItem_Name);
if (Main.PaPi) { if (Main.PaPi) {
itemMeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore)); itemMeta.setLore(Replace.replace(Util.getPrefix(), player, SelectConfig.UseItem_Lore));
} else itemMeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore)); } else itemMeta.setLore(Replace.replace(Util.getPrefix(), SelectConfig.UseItem_Lore));
item.setItemMeta(itemMeta); item.setItemMeta(itemMeta);
item.setAmount(1); item.setAmount(1);
} }

View File

@ -5,6 +5,7 @@ package de.jatitv.commandguiv2.Spigot.system;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig; import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Util;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -31,7 +32,7 @@ import java.util.zip.GZIPOutputStream;
public class Metrics { public class Metrics {
public static void Bstats() { public static void Bstats() {
int pluginId = Main.bstatsID; // <-- Replace with the id of your plugin! int pluginId = Util.getBstatsID(); // <-- Replace with the id of your plugin!
Metrics metrics = new Metrics(Main.plugin, pluginId); Metrics metrics = new Metrics(Main.plugin, pluginId);
metrics.addCustomChart(new Metrics.SimplePie("updatecheckonjoin", () -> String.valueOf(SelectConfig.UpdateCheckOnJoin))); metrics.addCustomChart(new Metrics.SimplePie("updatecheckonjoin", () -> String.valueOf(SelectConfig.UpdateCheckOnJoin)));
metrics.addCustomChart(new Metrics.SimplePie("storage_type_mysql", () -> SelectConfig.Storage)); metrics.addCustomChart(new Metrics.SimplePie("storage_type_mysql", () -> SelectConfig.Storage));

View File

@ -1,7 +1,6 @@
package de.jatitv.commandguiv2.Spigot.system.config.config; package de.jatitv.commandguiv2.Spigot.system.config.config;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config; import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
@ -15,8 +14,6 @@ import java.util.List;
public class ConfigCreate { public class ConfigCreate {
private static String prefix = Util.Prefix;
public static Integer ConfigVersion = 2; public static Integer ConfigVersion = 2;
private static Boolean UpdateCheckOnJoin = true; private static Boolean UpdateCheckOnJoin = true;

View File

@ -3,17 +3,17 @@ package de.jatitv.commandguiv2.Spigot.system.config.config;
import de.jatitv.commandguiv2.Spigot.Main; import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages; import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.database.MySQL; import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send; import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion; import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import net.t2code.lib.Spigot.Lib.replace.Replace; import net.t2code.lib.Spigot.Lib.replace.Replace;
import net.t2code.lib.Util;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
public class SelectConfig {private static String prefix = Util.Prefix; public class SelectConfig {
public static Boolean DisableUpdateChecker; public static Boolean DisableUpdateChecker;
public static Boolean UpdateCheckOnJoin; public static Boolean UpdateCheckOnJoin;
@ -129,7 +129,7 @@ public class SelectConfig {private static String prefix = Util.Prefix;
UseItem_Base64value = yamlConfiguration.getString("UseItem.Item.PlayerHead.Base64.Base64Value"); UseItem_Base64value = yamlConfiguration.getString("UseItem.Item.PlayerHead.Base64.Base64Value");
UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI"); UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName"); UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName");
UseItem_Name = Replace.replace(prefix,yamlConfiguration.getString("UseItem.Item.Name")); UseItem_Name = Replace.replace(Util.getPrefix(),yamlConfiguration.getString("UseItem.Item.Name"));
UseItem_Lore = yamlConfiguration.getList("UseItem.Item.Lore"); UseItem_Lore = yamlConfiguration.getList("UseItem.Item.Lore");
UseItem_GiveOnEveryJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnEveryJoin"); UseItem_GiveOnEveryJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnEveryJoin");
UseItem_GiveOnlyOnFirstJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnlyOnFirstJoin"); UseItem_GiveOnlyOnFirstJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnlyOnFirstJoin");

View File

@ -10,7 +10,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File; import java.io.File;
public class SelectMessages { public class SelectMessages {
private static String prefix = Util.Prefix;
public static String selectMSG; public static String selectMSG;
@ -129,6 +129,6 @@ public class SelectMessages {
} }
private static String select(String path, YamlConfiguration yamlConfiguration){ private static String select(String path, YamlConfiguration yamlConfiguration){
return Replace.replace(prefix,yamlConfiguration.getString(path)); return Replace.replace(Util.getPrefix(),yamlConfiguration.getString(path));
} }
} }

View File

@ -1,10 +1,34 @@
package de.jatitv.commandguiv2; package de.jatitv.commandguiv2;
public class Util { public class Util {
public static double requiredT2CodeLibVersion = 8; private static double requiredT2CodeLibVersion = 8;
public static String Prefix = "§8[§4C§9GUI§8]"; private static String Prefix = "§8[§4C§9GUI§8]";
public static Integer SpigotID = 90671; private static Integer SpigotID = 90671;
public static Integer BstatsID = 10840; private static Integer BstatsID = 10840;
public static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID; private static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID;
public static String Discord = "http://dc.t2code.net"; private static String Discord = "http://dc.t2code.net";
public static double getRequiredT2CodeLibVersion() {
return requiredT2CodeLibVersion;
}
public static String getPrefix() {
return Prefix;
}
public static Integer getSpigotID() {
return SpigotID;
}
public static Integer getBstatsID() {
return BstatsID;
}
public static String getSpigot() {
return Spigot;
}
public static String getDiscord() {
return Discord;
}
} }