code changes
T2CodeLib api to 16.7 Starting with only config class
This commit is contained in:
parent
613d1c16fa
commit
bcba2a49c5
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>CommandGUI_V2</artifactId>
|
||||
<version>2.8.19</version>
|
||||
<version>2.9_dev-1</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>T2C-CommandGUI</name>
|
||||
@ -24,8 +24,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
@ -76,7 +76,8 @@
|
||||
<dependency>
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>16.4</version>
|
||||
<version>16.7</version>
|
||||
<classifier>dev-23</classifier>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -149,6 +150,12 @@
|
||||
<version>1.7.22</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
@ -1,14 +1,15 @@
|
||||
package net.t2code.commandguiv2.Spigot;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.t2code.commandguiv2.Spigot.objects.functions.Function;
|
||||
import net.t2code.commandguiv2.Spigot.system.Load;
|
||||
import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
|
||||
import net.t2code.commandguiv2.Spigot.database.MySQL;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginCheck;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.plugins.T2C_PluginCheck;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -19,7 +20,7 @@ import java.util.logging.Level;
|
||||
|
||||
public final class Main extends JavaPlugin {
|
||||
|
||||
public static ArrayList<String> bungeejoinplayers = new ArrayList<>();
|
||||
public static ArrayList<String> proxyJoinPlayers = new ArrayList<>();
|
||||
|
||||
public static File getPath() {
|
||||
return plugin.getDataFolder();
|
||||
@ -32,6 +33,7 @@ public final class Main extends JavaPlugin {
|
||||
|
||||
public static List<String> autor;
|
||||
|
||||
@Getter
|
||||
private static Main plugin;
|
||||
|
||||
public static Boolean PaPi = false;
|
||||
@ -51,25 +53,25 @@ public final class Main extends JavaPlugin {
|
||||
autor = this.getDescription().getAuthors();
|
||||
version = this.getDescription().getVersion();
|
||||
if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
|
||||
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12() || T2CmcVersion.isMc1_13() ||
|
||||
T2CmcVersion.isMc1_14() || T2CmcVersion.isMc1_15() || T2CmcVersion.isNms1_16_R1()) {
|
||||
if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12() || T2C_McVersion.isMc1_13() ||
|
||||
T2C_McVersion.isMc1_14() || T2C_McVersion.isMc1_15() || T2C_McVersion.isNms1_16_R1()) {
|
||||
legacy = true;
|
||||
}
|
||||
|
||||
if (T2CpluginCheck.pluginCheck("CommandGUI")) {
|
||||
T2Csend.error( plugin, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2Csend.error( plugin,"");
|
||||
T2Csend.error( plugin,"An older version of the plugin T2C-CommandGUI was found!");
|
||||
T2Csend.error( plugin,"This plugin is now called T2C-CommandGUI and no longer CommandGUI!");
|
||||
T2Csend.error( plugin,"Please remove the older version (CommandGUI)!");
|
||||
T2Csend.error( plugin,this.getName() + " version: " + this.getDescription().getVersion() + " could not be loaded!");
|
||||
T2Csend.error( plugin,"");
|
||||
T2Csend.error( plugin,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
if (T2C_PluginCheck.pluginCheck("CommandGUI")) {
|
||||
T2C_Send.error( plugin, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.error( plugin,"");
|
||||
T2C_Send.error( plugin,"An older version of the plugin T2C-CommandGUI was found!");
|
||||
T2C_Send.error( plugin,"This plugin is now called T2C-CommandGUI and no longer CommandGUI!");
|
||||
T2C_Send.error( plugin,"Please remove the older version (CommandGUI)!");
|
||||
T2C_Send.error( plugin,this.getName() + " version: " + this.getDescription().getVersion() + " could not be loaded!");
|
||||
T2C_Send.error( plugin,"");
|
||||
T2C_Send.error( plugin,"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
||||
return;
|
||||
}
|
||||
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
if (T2CpluginCheck.papi()) {
|
||||
if (T2C_PluginCheck.papi()) {
|
||||
PaPi = true;
|
||||
}
|
||||
Load.onLoad(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getSpigotID(), Util.getDiscord(), Util.getBstatsID());
|
||||
@ -77,24 +79,24 @@ public final class Main extends JavaPlugin {
|
||||
}
|
||||
|
||||
public static void addonLoad() {
|
||||
if (T2CpluginCheck.plotSquaredGUI()) {
|
||||
if (T2C_PluginCheck.plotSquaredGUI()) {
|
||||
PlotSquaredGUI = true;
|
||||
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
|
||||
addonEnable(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI")));
|
||||
}
|
||||
|
||||
if (T2CpluginCheck.luckyBox()) {
|
||||
if (T2C_PluginCheck.luckyBox()) {
|
||||
LuckyBox = true;
|
||||
addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox"));
|
||||
addonEnable(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox")));
|
||||
}
|
||||
|
||||
if (T2CpluginCheck.plugManGUI()) {
|
||||
if (T2C_PluginCheck.plugManGUI()) {
|
||||
PlugManGUI = true;
|
||||
addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI"));
|
||||
addonEnable(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin("PlugManGUI")));
|
||||
}
|
||||
}
|
||||
|
||||
public static void addonEnable(Plugin plugin) {
|
||||
T2Csend.console(Util.getPrefix() + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!");
|
||||
T2C_Send.console(Util.getPrefix() + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!");
|
||||
}
|
||||
|
||||
public static Boolean pluginNotFound(String pl, Integer spigotID, String ver) {
|
||||
@ -105,7 +107,7 @@ public final class Main extends JavaPlugin {
|
||||
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
||||
return true;
|
||||
} else {
|
||||
String plVer = Bukkit.getPluginManager().getPlugin(pl).getDescription().getVersion();
|
||||
String plVer = Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(pl)).getDescription().getVersion();
|
||||
if (ver.contains("_")) {
|
||||
if (!plVer.equals(ver)) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||
@ -131,17 +133,14 @@ public final class Main extends JavaPlugin {
|
||||
}
|
||||
|
||||
public static void sendTryCatch(Class c, StackTraceElement line) {
|
||||
T2Csend.error(plugin,c.getName() + " Line: " + line.getLineNumber());
|
||||
T2C_Send.error(plugin,c.getName() + " Line: " + line.getLineNumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
if (enable) T2Ctemplate.onDisable(Util.getPrefix(), autor, version, Util.getSpigot(), Util.getDiscord());
|
||||
if (enable) T2C_Template.onDisable(Util.getPrefix(), plugin);
|
||||
MySQL.close();
|
||||
}
|
||||
|
||||
public static Main getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
|
||||
import net.t2code.commandguiv2.Spigot.config.gui.CreateGUI;
|
||||
import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.commands.T2Ctab;
|
||||
import net.t2code.t2codelib.SPIGOT.api.commands.T2C_Tab;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@ -107,9 +107,9 @@ public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
|
||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
T2Ctab.tab(list, sender, 0, args, arg1);
|
||||
T2Ctab.tab(list, sender, 0, SelectConfig.getAdminSubCommand(), 1, args, arg2);
|
||||
T2Ctab.tab(list, sender, 1, "give", 2, args, "commandgui.giveitem.other", true);
|
||||
T2C_Tab.tab(list, sender, 0, args, arg1);
|
||||
T2C_Tab.tab(list, sender, 0, SelectConfig.getAdminSubCommand(), 1, args, arg2);
|
||||
T2C_Tab.tab(list, sender, 1, "give", 2, args, "commandgui.giveitem.other", true);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@ package net.t2code.commandguiv2.Spigot.cmdManagement;
|
||||
import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
|
||||
import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -24,7 +24,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
||||
if (args.length == 0) {
|
||||
if (SelectConfig.getUseItem_AllowToggle()) {
|
||||
Help.sendGUIItemHelp(sender);
|
||||
} else T2Csend.sender(sender, "§4UseItem toggle is disabled!");// todo
|
||||
} else T2C_Send.sender(sender, "§4UseItem toggle is disabled!");// todo
|
||||
} else {
|
||||
if (args.length == 1 || args.length == 2) {
|
||||
if (sender instanceof Player) {
|
||||
@ -41,17 +41,17 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
||||
try {
|
||||
Commands.onSetSlot(player, Integer.valueOf(args[1]));
|
||||
} catch (Exception e5) {
|
||||
T2Csend.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
T2C_Send.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
}
|
||||
|
||||
} else T2Csend.player(player, "§4Use: §7/gui-item slot [slot]");
|
||||
} else T2C_Send.player(player, "§4Use: §7/gui-item slot [slot]");
|
||||
|
||||
break;
|
||||
default:
|
||||
Help.sendHelp(player, prefix);
|
||||
|
||||
}
|
||||
} else T2Csend.sender(sender, "§4UseItem toggle is disabled!");// todo
|
||||
} else T2C_Send.sender(sender, "§4UseItem toggle is disabled!");// todo
|
||||
} else sender.sendMessage(SelectMessages.OnlyForPlayer);
|
||||
}
|
||||
}
|
||||
|
@ -15,8 +15,8 @@ import net.t2code.commandguiv2.Spigot.database.SelectDatabase;
|
||||
import net.t2code.commandguiv2.Spigot.sound.Sound;
|
||||
import net.t2code.commandguiv2.Spigot.enums.SoundEnum;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -26,7 +26,7 @@ import java.util.Objects;
|
||||
|
||||
public class Commands {
|
||||
public static void info(CommandSender sender) {
|
||||
T2Ctemplate.sendInfo(sender, Main.getPlugin(), Util.getSpigotID(), Util.getDiscord(), Util.getInfoText());
|
||||
T2C_Template.sendInfo(sender, Main.getPlugin(), Util.getSpigotID(), Util.getDiscord(), Util.getInfoText());
|
||||
}
|
||||
|
||||
public static void reload(CommandSender sender) {
|
||||
@ -34,9 +34,9 @@ public class Commands {
|
||||
@Override
|
||||
public void run() {
|
||||
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadStart);
|
||||
T2Csend.console(Util.getPrefix() + "§8-------------------------------");
|
||||
T2Csend.console(Util.getPrefix() + " §6Plugin reload...");
|
||||
T2Csend.console(Util.getPrefix() + "§8-------------------------------");
|
||||
T2C_Send.console(Util.getPrefix() + "§8-------------------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §6Plugin reload...");
|
||||
T2C_Send.console(Util.getPrefix() + "§8-------------------------------");
|
||||
SelectConfig.onSelect();
|
||||
Main.getPlugin().reloadConfig();
|
||||
|
||||
@ -44,8 +44,8 @@ public class Commands {
|
||||
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) T2Csend.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
|
||||
T2Csend.warning(Main.getPlugin(), "You have changed the storage medium! To apply this change, you must restart the server!");
|
||||
if (sender instanceof Player) T2C_Send.sender(sender, "You have changed the storage medium! To apply this change, you must restart the server!");
|
||||
T2C_Send.warning(Main.getPlugin(), "You have changed the storage medium! To apply this change, you must restart the server!");
|
||||
}
|
||||
|
||||
LanguagesCreate.langCreate();
|
||||
@ -71,9 +71,9 @@ public class Commands {
|
||||
}
|
||||
|
||||
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadEnd);
|
||||
T2Csend.console(Util.getPrefix() + "§8-------------------------------");
|
||||
T2Csend.console(Util.getPrefix() + " §2Plugin successfully reloaded.");
|
||||
T2Csend.console(Util.getPrefix() + "§8-------------------------------");
|
||||
T2C_Send.console(Util.getPrefix() + "§8-------------------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §2Plugin successfully reloaded.");
|
||||
T2C_Send.console(Util.getPrefix() + "§8-------------------------------");
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -81,8 +81,8 @@ public class Commands {
|
||||
public static void give(CommandSender sender, Player target) {
|
||||
if (Bukkit.getPlayer(target.getName()) != null) {
|
||||
UseItem.giveUseItem(target);
|
||||
T2Csend.sender(sender, SelectMessages.Give_Sender.replace("[player]", target.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
|
||||
T2Csend.player(target, SelectMessages.Give_Receiver.replace("[sender]", sender.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
|
||||
T2C_Send.sender(sender, SelectMessages.Give_Sender.replace("[player]", target.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
|
||||
T2C_Send.player(target, SelectMessages.Give_Receiver.replace("[sender]", sender.getName()).replace("[item]", SelectConfig.getUseItem_Name()));
|
||||
Sound.play(target, SoundEnum.Give);
|
||||
} else {
|
||||
sender.sendMessage(SelectMessages.PlayerNotFond.replace("[player]", target.getName()));
|
||||
@ -98,7 +98,7 @@ public class Commands {
|
||||
} else {
|
||||
slot = Events.useItemSlotHashMap.get(player.getName());
|
||||
}
|
||||
T2Csend.debug(Main.getPlugin(), String.valueOf(slot));
|
||||
T2C_Debug.debug(Main.getPlugin(), String.valueOf(slot));
|
||||
if (player.getInventory().getItem(slot - 1) == null) {
|
||||
SelectDatabase.setItemStatusTrue(player);
|
||||
UseItem.giveUseItem(player);
|
||||
@ -113,9 +113,9 @@ public class Commands {
|
||||
if (empty) {
|
||||
SelectDatabase.setItemStatusTrue(player);
|
||||
UseItem.addUseItem(player);
|
||||
T2Csend.player(player, SelectMessages.ItemON);
|
||||
T2C_Send.player(player, SelectMessages.ItemON);
|
||||
} else {
|
||||
T2Csend.player(player, SelectMessages.NoInventorySpace);
|
||||
T2C_Send.player(player, SelectMessages.NoInventorySpace);
|
||||
Sound.play(player, SoundEnum.NoInventorySpace);
|
||||
}
|
||||
}
|
||||
@ -124,33 +124,33 @@ public class Commands {
|
||||
public static void itemOff(Player player) {
|
||||
SelectDatabase.setItemStatusFalse(player);
|
||||
UseItem.removeItem(player);
|
||||
T2Csend.player(player, SelectMessages.ItemOFF);
|
||||
T2C_Send.player(player, SelectMessages.ItemOFF);
|
||||
}
|
||||
|
||||
public static void onSetSlot(Player player, Integer setSlot) {
|
||||
if (!SelectConfig.getUseItem_AllowSetSlot()) {
|
||||
T2Csend.player(player, Util.getPrefix() + " §4Function disabled");
|
||||
T2C_Send.player(player, Util.getPrefix() + " §4Function disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
if (setSlot < 1) {
|
||||
T2Csend.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
T2C_Send.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
return;
|
||||
}
|
||||
if (setSlot > 9) {
|
||||
T2Csend.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
T2C_Send.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Events.useItemHashMap.get(player.getName())) {
|
||||
if (Objects.equals(Events.useItemSlotHashMap.get(player.getName()), setSlot)) {
|
||||
T2Csend.player(player, SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
|
||||
T2C_Send.player(player, SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (SelectConfig.getUseItem_InventorySlotEnforce() || player.getInventory().getItem(setSlot - 1) != null) {
|
||||
T2Csend.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString()));
|
||||
T2C_Send.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString()));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public class Commands {
|
||||
UseItem.giveUseItem(player);
|
||||
}
|
||||
|
||||
T2Csend.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString()));
|
||||
T2C_Send.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString()));
|
||||
}
|
||||
|
||||
public static void gui(Player player) {
|
||||
@ -171,9 +171,9 @@ public class Commands {
|
||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) {
|
||||
OpenGUI.openGUI(player, SelectConfig.getDefaultGUI(), true);
|
||||
} else T2Csend.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
||||
} else T2C_Send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
||||
.replace("[perm]", "commandgui.command"));
|
||||
} else T2Csend.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||
} else T2C_Send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,9 +183,9 @@ public class Commands {
|
||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + gui.key) || player.hasPermission("commandgui.bypass")) {
|
||||
OpenGUI.openGUI(player, arg, true);
|
||||
} else T2Csend.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + gui.key)
|
||||
} else T2C_Send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + gui.key)
|
||||
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
|
||||
} else T2Csend.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
|
||||
} else T2Csend.player(player, SelectMessages.guiNotFound);
|
||||
} else T2C_Send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
|
||||
} else T2C_Send.player(player, SelectMessages.guiNotFound);
|
||||
}
|
||||
}
|
||||
|
@ -5,8 +5,8 @@ import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
|
||||
import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -16,7 +16,7 @@ public class Help {
|
||||
public static void sendHelp(CommandSender sender, String Prefix) {
|
||||
Gui gui = Main.guiHashMap.get(SelectConfig.getDefaultGUI());
|
||||
|
||||
T2Csend.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
||||
T2C_Send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
||||
cgui(sender, gui);
|
||||
open(sender);
|
||||
help(sender);
|
||||
@ -25,7 +25,7 @@ public class Help {
|
||||
give(sender);
|
||||
createDefaultGUI(sender);
|
||||
reload(sender);
|
||||
T2Csend.sender(sender, Prefix + " §8-------------------------");
|
||||
T2C_Send.sender(sender, Prefix + " §8-------------------------");
|
||||
}
|
||||
|
||||
|
||||
@ -33,8 +33,8 @@ public class Help {
|
||||
if (!sender.hasPermission("commandgui.command")) return;
|
||||
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCgui.replace("[gui]", T2Creplace.replace(prefix, gui.guiName)));
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpCgui.replace("[gui]", T2Creplace.replace(prefix, gui.guiName)));
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCgui.replace("[gui]", T2C_Replace.replace(prefix, gui.guiName)));
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpCgui.replace("[gui]", T2C_Replace.replace(prefix, gui.guiName)));
|
||||
}
|
||||
|
||||
private static void open(CommandSender sender) {
|
||||
@ -43,9 +43,9 @@ public class Help {
|
||||
for (String alias : Main.allAliases) {
|
||||
if (Main.guiHashMap.get(alias).guiEnable || sender.hasPermission("commandgui.bypass")) {
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpOpen.replace("[gui]", alias).replace("[guiname]", T2Creplace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpOpen.replace("[gui]", alias).replace("[guiname]", T2C_Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
|
||||
} else
|
||||
T2Csend.sender(sender, prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", T2Creplace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
|
||||
T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", T2C_Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -54,59 +54,59 @@ public class Help {
|
||||
if (!sender.hasPermission("commandgui.command")) return;
|
||||
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpHelp);
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpHelp);
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpHelp);
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpHelp);
|
||||
}
|
||||
|
||||
private static void info(CommandSender sender) {
|
||||
if (!sender.hasPermission("commandgui.command.info")) return;
|
||||
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpInfo);
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpInfo);
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpInfo);
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpInfo);
|
||||
}
|
||||
|
||||
private static void give(CommandSender sender) {
|
||||
if (!sender.hasPermission("commandgui.admin")) return;
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpGive);
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpGive);
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpGive);
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpGive);
|
||||
}
|
||||
|
||||
private static void createDefaultGUI(CommandSender sender) {
|
||||
if (!sender.hasPermission("commandgui.admin")) return;
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||
}
|
||||
|
||||
private static void reload(CommandSender sender) {
|
||||
if (!sender.hasPermission("commandgui.admin")) return;
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpReload);
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.HelpReload);
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpReload);
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.HelpReload);
|
||||
}
|
||||
|
||||
|
||||
public static void gUIItemHelp(CommandSender sender) {
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_on);
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_on);
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_on);
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_on);
|
||||
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_off);
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_off);
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_off);
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_off);
|
||||
|
||||
if (sender instanceof Player) {
|
||||
T2Csend.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_Slot);
|
||||
} else T2Csend.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
||||
T2C_Send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_Slot);
|
||||
} else T2C_Send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
||||
}
|
||||
|
||||
public static void sendGUIItemHelp(CommandSender sender) {
|
||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
||||
T2Csend.sender(sender, prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
|
||||
T2C_Send.sender(sender, prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
|
||||
gUIItemHelp(sender);
|
||||
T2Csend.sender(sender, prefix + " §8------------------------------");
|
||||
T2C_Send.sender(sender, prefix + " §8------------------------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,8 @@ package net.t2code.commandguiv2.Spigot.cmdManagement.register;
|
||||
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
@ -13,9 +14,9 @@ import java.lang.reflect.Field;
|
||||
public class AliasRegister {
|
||||
public static void onRegister() {
|
||||
Plugin plugin = Main.getPlugin();
|
||||
T2Csend.debug(plugin, Bukkit.getServer().getClass().getPackage().getName());
|
||||
T2C_Debug.debug(plugin, Bukkit.getServer().getClass().getPackage().getName());
|
||||
if (Main.allAliases.toString().equals("[]")) {
|
||||
T2Csend.console(Util.getPrefix() + " §4No GUI files available");
|
||||
T2C_Send.console(Util.getPrefix() + " §4No GUI files available");
|
||||
return;
|
||||
}
|
||||
for (String alias : Main.allAliases) {
|
||||
@ -25,7 +26,7 @@ public class AliasRegister {
|
||||
final Field bukkitCommandMap = Bukkit.getServer().getClass().getDeclaredField("commandMap");
|
||||
bukkitCommandMap.setAccessible(true);
|
||||
CommandMap commandMap = (CommandMap) bukkitCommandMap.get(Bukkit.getServer());
|
||||
commandMap.register(alias, new RegisterCommand(alias));
|
||||
commandMap.register(Main.getPlugin().getName(), new RegisterCommand(alias));
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -5,13 +5,14 @@ import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
|
||||
import net.t2code.commandguiv2.Spigot.gui.OpenGUI;
|
||||
import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class RegisterCommand extends Command {
|
||||
private String alias;
|
||||
private final String alias;
|
||||
|
||||
public RegisterCommand(String alias) {
|
||||
super(alias);
|
||||
@ -19,7 +20,7 @@ public class RegisterCommand extends Command {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel, String[] args) {
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
@ -27,9 +28,9 @@ public class RegisterCommand extends Command {
|
||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + alias) || player.hasPermission("commandgui.bypass")) {
|
||||
OpenGUI.openGUI(player, alias, true);
|
||||
} else T2Csend.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + alias)
|
||||
} else T2C_Send.player(player, SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + alias)
|
||||
.replace("[perm]", "commandgui.command." + alias));
|
||||
} else T2Csend.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||
} else T2C_Send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
||||
return true;
|
||||
}
|
||||
|
@ -1,33 +1,93 @@
|
||||
package net.t2code.commandguiv2.Spigot.config.config;
|
||||
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.yaml.T2C_ConfigWriter;
|
||||
import net.t2code.t2codelib.SPIGOT.api.yaml.T2Cconfig;
|
||||
import net.t2code.t2codelib.util.T2C_ConfigItem;
|
||||
import net.t2code.t2codelib.util.T2C_LanguageEnum;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class ConfigCreate {
|
||||
|
||||
public static enum VALUES implements T2C_ConfigItem {
|
||||
subAliasTab("", null, true,
|
||||
new HashMap<>() {{
|
||||
put(T2C_LanguageEnum.german, List.of());
|
||||
put(T2C_LanguageEnum.english, List.of()); }}),
|
||||
;
|
||||
|
||||
private final String path;
|
||||
private Object value;
|
||||
private final boolean forceSet;
|
||||
private final HashMap<T2C_LanguageEnum, List<String>> comments;
|
||||
|
||||
VALUES(String path, Object value, boolean forceSet, HashMap<T2C_LanguageEnum, List<String>> comments) {
|
||||
this.path = path;
|
||||
this.value = value;
|
||||
this.forceSet = forceSet;
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getForceSet() {
|
||||
return forceSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<T2C_LanguageEnum, List<String>> getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLanguagePath() {
|
||||
return language.path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Object newValue) {
|
||||
value = newValue;
|
||||
}
|
||||
}
|
||||
|
||||
public static void set(boolean isReload) {
|
||||
T2C_ConfigWriter.createConfig(Util.getPrefix(),new File(Main.getPath(), "config.yml"), VALUES.values(),isReload, Util.getConfigLogo());
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void configCreate() {
|
||||
long long_ = System.currentTimeMillis();
|
||||
if (new File(Main.getPath(), "config.yml").exists()) {
|
||||
if (Main.getPlugin().getConfig().getBoolean("Plugin.Debug")) T2Csend.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||||
} else T2Csend.console(Util.getPrefix() + " §4config.yml are created...");
|
||||
if (Main.getPlugin().getConfig().getBoolean("Plugin.Debug")) T2C_Send.console(Util.getPrefix() + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||||
} else T2C_Send.console(Util.getPrefix() + " §4config.yml are created...");
|
||||
|
||||
File config = new File(Main.getPath(), "config.yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
if (!config.exists()) T2Cconfig.set("ConfigVersion", Util.getConfigVersion(), yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Plugin.Debug", false, yamlConfiguration);
|
||||
T2Cconfig.set("Plugin.updateCheck.onJoin", true, yamlConfiguration);
|
||||
T2Cconfig.set("Plugin.updateCheck.seePreReleaseUpdates", true, yamlConfiguration);
|
||||
@ -39,7 +99,7 @@ public class ConfigCreate {
|
||||
T2Cconfig.set("Plugin.DefaultGUI", "default", yamlConfiguration);
|
||||
T2Cconfig.set("Plugin.Prefix", "&8[&4C&9GUI&8]", yamlConfiguration);
|
||||
|
||||
if (Main.legacy){
|
||||
if (Main.legacy) {
|
||||
T2Cconfig.set("Storage.Type", "YML", yamlConfiguration);
|
||||
} else T2Cconfig.set("Storage.Type", "SQLITE", yamlConfiguration);
|
||||
T2Cconfig.set("Storage.MySQL.IP", "localhost", yamlConfiguration);
|
||||
@ -62,7 +122,7 @@ public class ConfigCreate {
|
||||
T2Cconfig.set("UseItem.InventorySlot.FreeSlot", false, yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("UseItem.Item.Material", "paper", yamlConfiguration);
|
||||
if (!(T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12())) {
|
||||
if (!(T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12())) {
|
||||
T2Cconfig.set("UseItem.Item.PlayerHead.Enable", false, yamlConfiguration);
|
||||
T2Cconfig.set("UseItem.Item.PlayerHead.Base64.Enable", false, yamlConfiguration);
|
||||
T2Cconfig.set("UseItem.Item.PlayerHead.Base64.Base64Value", "", yamlConfiguration);
|
||||
@ -96,13 +156,13 @@ public class ConfigCreate {
|
||||
T2Cconfig.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
|
||||
if (Main.legacy) {
|
||||
T2Cconfig.set("Toggle.Items.OnOrYes.Item.Material", "WOOL,5", yamlConfiguration);
|
||||
} else T2Cconfig.set("Toggle.Items.OnOrYes.Item.Material", T2CitemVersion.getGreenWool().getType().toString(), yamlConfiguration);
|
||||
} else T2Cconfig.set("Toggle.Items.OnOrYes.Item.Material", T2C_ItemVersion.getGreenWool().getType().toString(), yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Toggle.Items.OffOrNo.Item.Base64.Enable", false, yamlConfiguration);
|
||||
T2Cconfig.set("Toggle.Items.OffOrNo.Item.Base64.Base64Value", "", yamlConfiguration);
|
||||
if (Main.legacy) {
|
||||
T2Cconfig.set("Toggle.Items.OffOrNo.Item.Material", "WOOL,14", yamlConfiguration);
|
||||
} else T2Cconfig.set("Toggle.Items.OffOrNo.Item.Material", T2CitemVersion.getRedWool().getType().toString(), yamlConfiguration);
|
||||
} else T2Cconfig.set("Toggle.Items.OffOrNo.Item.Material", T2C_ItemVersion.getRedWool().getType().toString(), yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Toggle.Permission.Commands.True", "luckperms user [player] permission set [perm] true", yamlConfiguration);
|
||||
T2Cconfig.set("Toggle.Permission.Commands.False", "luckperms user [player] permission set [perm] false", yamlConfiguration);
|
||||
@ -113,40 +173,40 @@ public class ConfigCreate {
|
||||
T2Cconfig.set("Sound.Enable", true, yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Sound.OpenInventory.Enable", true, yamlConfiguration);
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
T2Cconfig.set("Sound.OpenInventory.Sound", "CHEST_OPEN", yamlConfiguration);
|
||||
} else T2Cconfig.set("Sound.OpenInventory.Sound", "BLOCK_CHEST_OPEN", yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Sound.Click.Enable", true, yamlConfiguration);
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
T2Cconfig.set("Sound.Click.Sound", "NOTE_STICKS", yamlConfiguration);
|
||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
T2Cconfig.set("Sound.Click.Sound", "BLOCK_NOTE_HAT", yamlConfiguration);
|
||||
} else T2Cconfig.set("Sound.Click.Sound", "BLOCK_NOTE_BLOCK_HAT", yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Sound.NoMoney.Enable", true, yamlConfiguration);
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
T2Cconfig.set("Sound.NoMoney.Sound", "NOTE_PIANO", yamlConfiguration);
|
||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
T2Cconfig.set("Sound.NoMoney.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
|
||||
} else T2Cconfig.set("Sound.NoMoney.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Sound.NoInventorySpace.Enable", true, yamlConfiguration);
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
T2Cconfig.set("Sound.NoInventorySpace.Sound", "NOTE_PIANO", yamlConfiguration);
|
||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
T2Cconfig.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
|
||||
} else T2Cconfig.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Sound.Give.Enable", true, yamlConfiguration);
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
T2Cconfig.set("Sound.Give.Sound", "LEVEL_UP", yamlConfiguration);
|
||||
} else T2Cconfig.set("Sound.Give.Sound", "ENTITY_PLAYER_LEVELUP", yamlConfiguration);
|
||||
|
||||
T2Cconfig.set("Sound.PlayerNotFound.Enable", true, yamlConfiguration);
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
T2Cconfig.set("Sound.PlayerNotFound.Sound", "NOTE_PIANO", yamlConfiguration);
|
||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
T2Cconfig.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
|
||||
} else T2Cconfig.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
|
||||
|
||||
@ -184,6 +244,65 @@ public class ConfigCreate {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
T2Csend.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
T2C_Send.console(Util.getPrefix() + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
}
|
||||
|
||||
|
||||
public static void sound(String Prefix) {
|
||||
String soundOpenInventory;
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundOpenInventory = "CHEST_OPEN";
|
||||
} else {
|
||||
soundOpenInventory = "BLOCK_CHEST_OPEN";
|
||||
}
|
||||
|
||||
String soundClick;
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundClick = "NOTE_STICKS";
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
soundClick = "BLOCK_NOTE_HAT";
|
||||
} else {
|
||||
soundClick = "BLOCK_NOTE_BLOCK_HAT";
|
||||
}
|
||||
|
||||
String soundNoMoney;
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundNoMoney = "NOTE_PIANO";
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
soundNoMoney = "BLOCK_NOTE_HARP";
|
||||
} else {
|
||||
soundNoMoney = "BLOCK_NOTE_BLOCK_HARP";
|
||||
}
|
||||
|
||||
String soundNoInventorySpace;
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundNoInventorySpace = "NOTE_PIANO";
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
soundNoInventorySpace = "BLOCK_NOTE_BASS";
|
||||
} else {
|
||||
soundNoInventorySpace = "BLOCK_NOTE_BLOCK_GUITAR";
|
||||
}
|
||||
|
||||
String soundGive;
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundGive = "LEVEL_UP";
|
||||
} else {
|
||||
soundGive = "ENTITY_PLAYER_LEVELUP";
|
||||
}
|
||||
|
||||
String soundPlayerNotFound;
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundPlayerNotFound = "NOTE_PIANO";
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
soundPlayerNotFound = "BLOCK_NOTE_HARP";
|
||||
} else {
|
||||
soundPlayerNotFound = "BLOCK_NOTE_BLOCK_HARP";
|
||||
}
|
||||
}
|
||||
private static String Sound_OpenInventory;
|
||||
private static String Sound_Click;
|
||||
private static String Sound_NoMoney;
|
||||
private static String Sound_NoInventorySpace;
|
||||
private static String soundGive;
|
||||
private static String soundPlayerNotFound;
|
||||
}
|
||||
|
@ -5,9 +5,9 @@ import net.t2code.commandguiv2.Spigot.config.configConverter.ConfigConverter;
|
||||
import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2Cdebug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@ -23,11 +23,11 @@ public class SelectConfig {
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
if (yamlConfiguration.getInt("ConfigVersion") < Util.getConfigVersion() && new File(Main.getPath(), "config.yml").exists()) {
|
||||
T2Csend.console(Util.getPrefix() + " §4----------------------");
|
||||
T2Csend.console(Util.getPrefix() + " ");
|
||||
T2Csend.console(Util.getPrefix() + " §6New features have been added to CommandGUI. The Config is adapted!");
|
||||
T2Csend.console(Util.getPrefix() + " ");
|
||||
T2Csend.console(Util.getPrefix() + " §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " ");
|
||||
T2C_Send.console(Util.getPrefix() + " §6New features have been added to CommandGUI. The Config is adapted!");
|
||||
T2C_Send.console(Util.getPrefix() + " ");
|
||||
T2C_Send.console(Util.getPrefix() + " §4----------------------");
|
||||
if (yamlConfiguration.getInt("ConfigVersion") < 5) {
|
||||
ConfigConverter.convert();
|
||||
}
|
||||
@ -48,7 +48,7 @@ public class SelectConfig {
|
||||
language = yamlConfiguration.getString("Plugin.language");
|
||||
Currency = yamlConfiguration.getString("Plugin.Currency");
|
||||
DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI");
|
||||
prefix = T2Creplace.replace("", Objects.requireNonNull(yamlConfiguration.getString("Plugin.Prefix")));
|
||||
prefix = T2C_Replace.replace("", Objects.requireNonNull(yamlConfiguration.getString("Plugin.Prefix")));
|
||||
|
||||
storage = yamlConfiguration.getString("Storage.Type").toUpperCase();
|
||||
|
||||
@ -76,7 +76,7 @@ public class SelectConfig {
|
||||
UseItem_Base64value = yamlConfiguration.getString("UseItem.Item.PlayerHead.Base64.Base64Value");
|
||||
UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
|
||||
UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName");
|
||||
UseItem_Name = T2Creplace.replace(Util.getPrefix(), yamlConfiguration.getString("UseItem.Item.Name"));
|
||||
UseItem_Name = T2C_Replace.replace(Util.getPrefix(), yamlConfiguration.getString("UseItem.Item.Name"));
|
||||
UseItem_Lore = yamlConfiguration.getStringList("UseItem.Item.Lore");
|
||||
UseItem_GiveOnEveryJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnEveryJoin");
|
||||
UseItem_GiveOnlyOnFirstJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnlyOnFirstJoin");
|
||||
@ -142,50 +142,50 @@ public class SelectConfig {
|
||||
|
||||
public static void sound(String Prefix) {
|
||||
String soundOpenInventory;
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundOpenInventory = "CHEST_OPEN";
|
||||
} else {
|
||||
soundOpenInventory = "BLOCK_CHEST_OPEN";
|
||||
}
|
||||
|
||||
String soundClick;
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundClick = "NOTE_STICKS";
|
||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
soundClick = "BLOCK_NOTE_HAT";
|
||||
} else {
|
||||
soundClick = "BLOCK_NOTE_BLOCK_HAT";
|
||||
}
|
||||
|
||||
String soundNoMoney;
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundNoMoney = "NOTE_PIANO";
|
||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
soundNoMoney = "BLOCK_NOTE_HARP";
|
||||
} else {
|
||||
soundNoMoney = "BLOCK_NOTE_BLOCK_HARP";
|
||||
}
|
||||
|
||||
String soundNoInventorySpace;
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundNoInventorySpace = "NOTE_PIANO";
|
||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
soundNoInventorySpace = "BLOCK_NOTE_BASS";
|
||||
} else {
|
||||
soundNoInventorySpace = "BLOCK_NOTE_BLOCK_GUITAR";
|
||||
}
|
||||
|
||||
String soundGive;
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundGive = "LEVEL_UP";
|
||||
} else {
|
||||
soundGive = "ENTITY_PLAYER_LEVELUP";
|
||||
}
|
||||
|
||||
String soundPlayerNotFound;
|
||||
if (T2CmcVersion.isMc1_8()) {
|
||||
if (T2C_McVersion.isMc1_8()) {
|
||||
soundPlayerNotFound = "NOTE_PIANO";
|
||||
} else if (T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
} else if (T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
soundPlayerNotFound = "BLOCK_NOTE_HARP";
|
||||
} else {
|
||||
soundPlayerNotFound = "BLOCK_NOTE_BLOCK_HARP";
|
||||
@ -197,7 +197,7 @@ public class SelectConfig {
|
||||
Sound_OpenInventory = sound_OpenInventory;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
T2Csend.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
|
||||
T2C_Send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
|
||||
.replace("[sound]", "§8OpenInventory: §6" + Sound_OpenInventory_input) + "§4\n§4\n§4\n");
|
||||
Sound_OpenInventory = Sound.valueOf(soundOpenInventory);
|
||||
}
|
||||
@ -208,7 +208,7 @@ public class SelectConfig {
|
||||
Sound_Click = sound_Click;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
T2Csend.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
T2C_Send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8Click: §6" + Sound_Click_input) + "§4\n§4\n§4\n");
|
||||
Sound_Click = Sound.valueOf(soundClick);
|
||||
}
|
||||
@ -219,7 +219,7 @@ public class SelectConfig {
|
||||
Sound_Click = sound_NoMoney;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
T2Csend.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
T2C_Send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8NoMoney: §6" + Sound_NoMoney_input) + "§4\n§4\n§4\n");
|
||||
Sound_NoMoney = Sound.valueOf(soundNoMoney);
|
||||
}
|
||||
@ -231,7 +231,7 @@ public class SelectConfig {
|
||||
Sound_NoInventorySpace = sound_NoInventorySpace;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
T2Csend.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
T2C_Send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8NoInventorySpace: §6" + Sound_NoInventorySpace_input) + "§4\n§4\n§4\n");
|
||||
Sound_NoInventorySpace = Sound.valueOf(soundNoInventorySpace);
|
||||
}
|
||||
@ -242,7 +242,7 @@ public class SelectConfig {
|
||||
Sound_Give = sound_Give;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
T2Csend.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
T2C_Send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8Give: §6" + Sound_Give_input) + "§4\n§4\n§4\n");
|
||||
Sound_Give = Sound.valueOf(soundGive);
|
||||
}
|
||||
@ -253,7 +253,7 @@ public class SelectConfig {
|
||||
Sound_PlayerNotFound = sound_PlayerNotFound;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
T2Csend.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
T2C_Send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8PlayerNotFound: §6" + Sound_PlayerNotFound_input) + "§4\n§4\n§4\n");
|
||||
Sound_PlayerNotFound = Sound.valueOf(soundPlayerNotFound);
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ import net.t2code.commandguiv2.Spigot.config.functions.CreateFunctions;
|
||||
import net.t2code.commandguiv2.Spigot.enums.FunctionItemEnum;
|
||||
import net.t2code.commandguiv2.Spigot.enums.FunctionVoteEnum;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@ -38,19 +38,19 @@ public class ConfigConverter {
|
||||
File newF = new File("plugins/T2C-CommandGUI");
|
||||
|
||||
if (oldF.renameTo(newF)) {
|
||||
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2Csend.error(Main.getPlugin(), "");
|
||||
T2Csend.warning(Main.getPlugin(), "File renamed successfully");
|
||||
T2Csend.warning(Main.getPlugin(), "The plugin folder has been renamed from 'CommandGUI' to 'T2C-CommandGUI");
|
||||
T2Csend.error(Main.getPlugin(), "");
|
||||
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.error(Main.getPlugin(), "");
|
||||
T2C_Send.warning(Main.getPlugin(), "File renamed successfully");
|
||||
T2C_Send.warning(Main.getPlugin(), "The plugin folder has been renamed from 'CommandGUI' to 'T2C-CommandGUI");
|
||||
T2C_Send.error(Main.getPlugin(), "");
|
||||
T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
} else {
|
||||
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2Csend.error(Main.getPlugin(), "");
|
||||
T2Csend.error(Main.getPlugin(), "Failed to rename file");
|
||||
T2Csend.error(Main.getPlugin(), "An error occurred while renaming the plugin folder from 'CommandGUI' to 'T2C-CommandGUI'! Please report on our Discord: " + Util.getDiscord());
|
||||
T2Csend.error(Main.getPlugin(), "");
|
||||
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.error(Main.getPlugin(), "");
|
||||
T2C_Send.error(Main.getPlugin(), "Failed to rename file");
|
||||
T2C_Send.error(Main.getPlugin(), "An error occurred while renaming the plugin folder from 'CommandGUI' to 'T2C-CommandGUI'! Please report on our Discord: " + Util.getDiscord());
|
||||
T2C_Send.error(Main.getPlugin(), "");
|
||||
T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -65,23 +65,23 @@ public class ConfigConverter {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2Csend.error(Main.getPlugin(), "");
|
||||
T2Csend.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.Enable' was added to the function " + config.getName() + "!");
|
||||
T2Csend.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.CustomNoPermMessage' was added to the function " + config.getName() + "!");
|
||||
T2Csend.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Enable' was added to the function " + config.getName() + "!");
|
||||
T2Csend.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Lore' was added to the function " + config.getName() + "!");
|
||||
T2Csend.error(Main.getPlugin(), "");
|
||||
T2Csend.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.error(Main.getPlugin(), "");
|
||||
T2C_Send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.Enable' was added to the function " + config.getName() + "!");
|
||||
T2C_Send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Message.CustomNoPermMessage' was added to the function " + config.getName() + "!");
|
||||
T2C_Send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Enable' was added to the function " + config.getName() + "!");
|
||||
T2C_Send.warning(Main.getPlugin(), "'Slots.Function.NoPermission.Item.Lore.Lore' was added to the function " + config.getName() + "!");
|
||||
T2C_Send.error(Main.getPlugin(), "");
|
||||
T2C_Send.error(Main.getPlugin(), "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
}
|
||||
|
||||
public static void convert() {
|
||||
renameFolder();
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4Config conversion to the new config structure starts!");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4Config conversion to the new config structure starts!");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
File f = new File(Main.getPath() + "/OldConfig/GUIs/Version4");
|
||||
File[] fileArray = f.listFiles();
|
||||
|
||||
@ -99,7 +99,7 @@ public class ConfigConverter {
|
||||
String name = yamlConfigurationOld.getString("GUI.Name");
|
||||
Boolean fillItemEnable = yamlConfigurationOld.getBoolean("GUI.FillItem.Enable");
|
||||
String fillItem;
|
||||
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
fillItem = yamlConfigurationOld.getString("GUI.FillItem.GlassPaneColor");
|
||||
} else fillItem = yamlConfigurationOld.getString("GUI.FillItem.Item");
|
||||
|
||||
@ -179,11 +179,11 @@ public class ConfigConverter {
|
||||
}
|
||||
}
|
||||
}
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4The conversion to the new config structure is completed!");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4The conversion to the new config structure is completed!");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
}
|
||||
|
||||
private static void renameFolder() {
|
||||
@ -202,7 +202,7 @@ public class ConfigConverter {
|
||||
set("GUI.Lines", lines, yamlConfiguration);
|
||||
set("GUI.Name", name, yamlConfiguration);
|
||||
set("GUI.FillItem.Enable", fillItemEnable, yamlConfiguration);
|
||||
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
set("GUI.FillItem.GlassPaneColor", fillItem, yamlConfiguration);
|
||||
} else set("GUI.FillItem.Item", fillItem, yamlConfiguration);
|
||||
|
||||
@ -238,11 +238,11 @@ public class ConfigConverter {
|
||||
}
|
||||
|
||||
public static void convert7() {
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4Config conversion to the new config structure starts!");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4Config conversion to the new config structure starts!");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
|
||||
File f = new File(Main.getPath() + "/Functions/");
|
||||
File[] fileArray = f.listFiles();
|
||||
@ -262,10 +262,10 @@ public class ConfigConverter {
|
||||
}
|
||||
}
|
||||
}
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4The conversion to the new config structure is completed!");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2Csend.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4The conversion to the new config structure is completed!");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7]");
|
||||
T2C_Send.console(Util.getPrefix() + " §7[§5ConfigConvert§7] §4----------------------");
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.enums.FunctionItemEnum;
|
||||
import net.t2code.commandguiv2.Spigot.enums.FunctionVoteEnum;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.system.T2CodeLibMain;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
@ -64,7 +64,7 @@ public class CreateFunctions {
|
||||
i++;
|
||||
}
|
||||
|
||||
T2Csend.console(Util.getPrefix() + " §4Function GUI file (Functions/" + config.getName() + ") is loaded...");
|
||||
T2C_Send.console(Util.getPrefix() + " §4Function GUI file (Functions/" + config.getName() + ") is loaded...");
|
||||
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
@ -139,7 +139,7 @@ public class CreateFunctions {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
T2Csend.console(Util.getPrefix() + " §2Function file (Functions/" + config.getName() + ") was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
T2C_Send.console(Util.getPrefix() + " §2Function file (Functions/" + config.getName() + ") was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,8 +2,8 @@ package net.t2code.commandguiv2.Spigot.config.gui;
|
||||
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
@ -13,7 +13,7 @@ import java.io.IOException;
|
||||
public class CreateGUI {
|
||||
public static void configCreate() {
|
||||
long long_ = System.currentTimeMillis();
|
||||
T2Csend.console(Util.getPrefix() + " §4Default GUI file (GUIs/default.yml) is loaded...");
|
||||
T2C_Send.console(Util.getPrefix() + " §4Default GUI file (GUIs/default.yml) is loaded...");
|
||||
File config = new File(Main.getPath(), "GUIs/default.yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
@ -21,7 +21,7 @@ public class CreateGUI {
|
||||
set("GUI.Lines", 1, yamlConfiguration);
|
||||
set("GUI.Name", "&5default &9GUI", yamlConfiguration);
|
||||
set("GUI.FillItem.Enable", true, yamlConfiguration);
|
||||
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
set("GUI.FillItem.GlassPaneColor", 15, yamlConfiguration);
|
||||
} else set("GUI.FillItem.Item", "BLACK_STAINED_GLASS_PANE", yamlConfiguration);
|
||||
|
||||
@ -48,7 +48,7 @@ public class CreateGUI {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
T2Csend.console(Util.getPrefix() + " §2Default GUI file (GUIs/default.yml) was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
T2C_Send.console(Util.getPrefix() + " §2Default GUI file (GUIs/default.yml) was loaded." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
}
|
||||
|
||||
private static void set(String path, String value, YamlConfiguration config) {
|
||||
|
@ -2,7 +2,7 @@ package net.t2code.commandguiv2.Spigot.config.languages;
|
||||
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@ -13,7 +13,7 @@ public class LanguagesCreate {
|
||||
private static Plugin plugin = Main.getPlugin();
|
||||
|
||||
public static void langCreate() {
|
||||
T2Csend.debug(plugin, "§4Language files are created / updated...");
|
||||
T2C_Debug.debug(plugin, "§4Language files are created / updated...");
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
|
||||
/**
|
||||
@ -96,7 +96,7 @@ public class LanguagesCreate {
|
||||
try {
|
||||
yamlConfigurationEN.save(messagesEN);
|
||||
} catch (IOException e) {
|
||||
T2Csend.warning(plugin, e.getMessage());
|
||||
T2C_Send.warning(plugin, e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ public class LanguagesCreate {
|
||||
try {
|
||||
yamlConfigurationDE.save(messagesDE);
|
||||
} catch (IOException e) {
|
||||
T2Csend.warning(plugin, e.getMessage());
|
||||
T2C_Send.warning(plugin, e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -267,11 +267,11 @@ public class LanguagesCreate {
|
||||
try {
|
||||
yamlConfigurationNO.save(messagesNO);
|
||||
} catch (IOException e) {
|
||||
T2Csend.warning(plugin, e.getMessage());
|
||||
T2C_Send.warning(plugin, e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
T2Csend.console(Util.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
T2C_Send.console(Util.getPrefix() + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
}
|
||||
|
||||
private static void set(String path, String value, YamlConfiguration config) {
|
||||
|
@ -3,8 +3,8 @@ package net.t2code.commandguiv2.Spigot.config.languages;
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
@ -82,19 +82,19 @@ public class SelectMessages {
|
||||
public static String PlayerGUIItemHelp_Slot;
|
||||
|
||||
public static void onSelect(String Prefix) {
|
||||
T2Csend.debug(Main.getPlugin(), "§4Select language...");
|
||||
T2C_Debug.debug(Main.getPlugin(), "§4Select language...");
|
||||
long long_ = System.currentTimeMillis();
|
||||
|
||||
File msg;
|
||||
|
||||
msg = new File(Main.getPath(), "languages/" + SelectConfig.getLanguage() + "_messages.yml");
|
||||
if (!msg.isFile()) {
|
||||
T2Csend.console(Prefix);
|
||||
T2Csend.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2Csend.console(Prefix + " §4The selected §c" + SelectConfig.getLanguage() + " §4language file was not found.");
|
||||
T2Csend.console(Prefix + " §6The default language §eEnglish §6is used!");
|
||||
T2Csend.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2Csend.console(Prefix);
|
||||
T2C_Send.console(Prefix);
|
||||
T2C_Send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.console(Prefix + " §4The selected §c" + SelectConfig.getLanguage() + " §4language file was not found.");
|
||||
T2C_Send.console(Prefix + " §6The default language §eEnglish §6is used!");
|
||||
T2C_Send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Send.console(Prefix);
|
||||
msg = new File(Main.getPath(), "languages/" + "english_messages.yml");
|
||||
selectMSG = "english";
|
||||
} else selectMSG = SelectConfig.getLanguage();
|
||||
@ -170,10 +170,10 @@ public class SelectMessages {
|
||||
PlayerGUIItemHelp_Slot = select("Help.Player.UseItem_Slot", yamlConfiguration_msg);
|
||||
|
||||
|
||||
T2Csend.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
T2C_Send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
}
|
||||
|
||||
private static String select(String path, YamlConfiguration yamlConfiguration) {
|
||||
return T2Creplace.replace(SelectConfig.getPrefix(), Objects.requireNonNull(yamlConfiguration.getString(path)));
|
||||
return T2C_Replace.replace(SelectConfig.getPrefix(), Objects.requireNonNull(yamlConfiguration.getString(path)));
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import com.zaxxer.hikari.HikariDataSource;
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
|
||||
import java.sql.*;
|
||||
import java.time.ZoneId;
|
||||
@ -22,7 +22,7 @@ public class MySQL {
|
||||
long long_ = System.currentTimeMillis();
|
||||
Calendar now = Calendar.getInstance();
|
||||
ZoneId timeZone = now.getTimeZone().toZoneId();
|
||||
T2Csend.debug(Main.getPlugin(), "Server TimeZone is : " + timeZone);
|
||||
T2C_Debug.debug(Main.getPlugin(), "Server TimeZone is : " + timeZone);
|
||||
try {
|
||||
config.setJdbcUrl("jdbc:mysql://" + SelectConfig.getMysqlIp() + ":" + SelectConfig.getMysqlPort() + "/" + SelectConfig.getMysqlDatabase()
|
||||
+ "?useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&autoReconnect=true&serverTimezone=" + timeZone
|
||||
@ -33,23 +33,23 @@ public class MySQL {
|
||||
config.addDataSourceProperty("prepStmtCacheSize", "250");
|
||||
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
|
||||
ds = new HikariDataSource(config);
|
||||
T2Csend.console(Util.getPrefix() + " §2MYSQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
T2C_Send.console(Util.getPrefix() + " §2MYSQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
} catch (Exception ex) {
|
||||
T2Csend.console(Util.getPrefix() + " §4MYSQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
T2Csend.error(Main.getPlugin(), ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
|
||||
T2C_Send.console(Util.getPrefix() + " §4MYSQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||
T2C_Send.error(Main.getPlugin(), ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
|
||||
}
|
||||
|
||||
if (SelectConfig.getDebug() || Main.version.toLowerCase().contains("dev") || Main.version.toLowerCase().contains("beta") || Main.version.toLowerCase().contains("snapshot")) {
|
||||
try {
|
||||
T2Csend.error(Main.getPlugin(), "MySQL DEBUG:");
|
||||
T2C_Send.error(Main.getPlugin(), "MySQL DEBUG:");
|
||||
Connection con = ds.getConnection();
|
||||
DatabaseMetaData dbmd = con.getMetaData();
|
||||
T2Csend.debugmsg(Main.getPlugin(), "§6Metadata of the database:");
|
||||
T2Csend.debugmsg(Main.getPlugin(), "§6DB: §e" + dbmd.getDatabaseProductName());
|
||||
T2Csend.debugmsg(Main.getPlugin(), "§6Version: §e" + dbmd.getDatabaseProductVersion());
|
||||
T2Csend.debugmsg(Main.getPlugin(), "§6Driver: §e" + dbmd.getDriverName());
|
||||
T2Csend.debugmsg(Main.getPlugin(), "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
||||
T2Csend.debugmsg(Main.getPlugin(), "§6Driver Version: §e" + dbmd.getDriverVersion());
|
||||
T2C_Debug.debugmsg(Main.getPlugin(), "§6Metadata of the database:");
|
||||
T2C_Debug.debugmsg(Main.getPlugin(), "§6DB: §e" + dbmd.getDatabaseProductName());
|
||||
T2C_Debug.debugmsg(Main.getPlugin(), "§6Version: §e" + dbmd.getDatabaseProductVersion());
|
||||
T2C_Debug.debugmsg(Main.getPlugin(), "§6Driver: §e" + dbmd.getDriverName());
|
||||
T2C_Debug.debugmsg(Main.getPlugin(), "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
||||
T2C_Debug.debugmsg(Main.getPlugin(), "§6Driver Version: §e" + dbmd.getDriverVersion());
|
||||
con.close();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e);
|
||||
@ -65,7 +65,7 @@ public class MySQL {
|
||||
if (ds == null) {
|
||||
return;
|
||||
}
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
Connection con = ds.getConnection();
|
||||
Statement stmt = con.createStatement();
|
||||
stmt.execute(query);
|
||||
@ -75,7 +75,7 @@ public class MySQL {
|
||||
|
||||
|
||||
public static HashMap<String, ArrayList<String>> selectAll(String query) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
HashMap<String, ArrayList<String>> Result = new HashMap<>();
|
||||
try (Connection con = ds.getConnection()) {
|
||||
Statement stmt = con.createStatement();
|
||||
@ -97,7 +97,7 @@ public class MySQL {
|
||||
}
|
||||
|
||||
public static String select(String query) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
String Ausgabe = "";
|
||||
try (Connection con = ds.getConnection()) {
|
||||
Statement stmt = con.createStatement();
|
||||
@ -114,7 +114,7 @@ public class MySQL {
|
||||
}
|
||||
|
||||
public static int count(String query) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
int count = 0;
|
||||
try (Connection con = ds.getConnection()) {
|
||||
Statement stmt = con.createStatement();
|
||||
@ -131,7 +131,7 @@ public class MySQL {
|
||||
}
|
||||
|
||||
public static ArrayList<String> selectRow(String query) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
ArrayList<String> Result = new ArrayList<>();
|
||||
try (Connection con = ds.getConnection()) {
|
||||
Statement stmt = con.createStatement();
|
||||
|
@ -2,7 +2,7 @@ package net.t2code.commandguiv2.Spigot.database;
|
||||
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import java.io.File;
|
||||
@ -28,7 +28,7 @@ public class SQLITE {
|
||||
|
||||
public static void query(String query) {
|
||||
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
try {
|
||||
Statement stmt = con.createStatement();
|
||||
stmt.execute(query);
|
||||
@ -42,7 +42,7 @@ public class SQLITE {
|
||||
try {
|
||||
Statement stmt = con.createStatement();
|
||||
for (String query : queryList) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
stmt.addBatch(query);
|
||||
}
|
||||
stmt.executeBatch();
|
||||
@ -54,7 +54,7 @@ public class SQLITE {
|
||||
|
||||
|
||||
public static HashMap<String, ArrayList<String>> selectAll(String query) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
HashMap<String, ArrayList<String>> Result = new HashMap<>();
|
||||
try {
|
||||
Statement stmt = con.createStatement();
|
||||
@ -76,7 +76,7 @@ public class SQLITE {
|
||||
}
|
||||
|
||||
public static String select(String query) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
String Ausgabe = "";
|
||||
try {
|
||||
Statement stmt = con.createStatement();
|
||||
@ -93,7 +93,7 @@ public class SQLITE {
|
||||
}
|
||||
|
||||
public static int count(String query) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
int count = 0;
|
||||
try {
|
||||
Statement stmt = con.createStatement();
|
||||
@ -110,7 +110,7 @@ public class SQLITE {
|
||||
}
|
||||
|
||||
public static ArrayList<String> selectRow(String query) {
|
||||
T2Csend.debug(Main.getPlugin(), query);
|
||||
T2C_Debug.debug(Main.getPlugin(), query);
|
||||
ArrayList<String> Result = new ArrayList<>();
|
||||
try {
|
||||
Statement stmt = con.createStatement();
|
||||
|
@ -2,7 +2,7 @@ package net.t2code.commandguiv2.Spigot.database;
|
||||
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.objects.Obj_Select;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
@ -58,11 +58,11 @@ public class YML {
|
||||
|
||||
|
||||
public static Integer selectSlot(Player player) {
|
||||
T2Csend.debug(plugin, "yml-1");
|
||||
T2C_Debug.debug(plugin, "yml-1");
|
||||
if (!yamlConfigurationStorage.contains(String.valueOf(player.getUniqueId()))) return null;
|
||||
if (yamlConfigurationStorage.getString(player.getUniqueId() + ".Slot") == null) return null;
|
||||
T2Csend.debug(plugin, "yml-2");
|
||||
T2Csend.debug(plugin, String.valueOf(yamlConfigurationStorage.getInt(player.getUniqueId() + ".Slot")));
|
||||
T2C_Debug.debug(plugin, "yml-2");
|
||||
T2C_Debug.debug(plugin, String.valueOf(yamlConfigurationStorage.getInt(player.getUniqueId() + ".Slot")));
|
||||
return yamlConfigurationStorage.getInt(player.getUniqueId() + ".Slot");
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,11 @@ import net.t2code.commandguiv2.Spigot.system.Placeholder;
|
||||
import net.t2code.commandguiv2.Spigot.sound.Sound;
|
||||
import net.t2code.commandguiv2.Spigot.enums.SoundEnum;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.eco.T2Ceco;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||
import net.t2code.t2codelib.SPIGOT.api.eco.T2C_Eco;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.T2C_LibConfig;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
@ -46,8 +46,8 @@ public class GUIListener implements Listener {
|
||||
if (e.getInventory() == null) return;
|
||||
if (e.getCurrentItem() == null) return;
|
||||
for (Gui gui : Main.guiHashMap.values()) {
|
||||
if (player.getOpenInventory().getTitle().equals(T2Creplace.replace(prefix, GUICode + gui.guiName))
|
||||
|| (Main.PaPi && player.getOpenInventory().getTitle().equals(T2Creplace.replace(prefix, player, GUICode + gui.guiName)))) {
|
||||
if (player.getOpenInventory().getTitle().equals(T2C_Replace.replace(prefix, GUICode + gui.guiName))
|
||||
|| (Main.PaPi && player.getOpenInventory().getTitle().equals(T2C_Replace.replace(prefix, player, GUICode + gui.guiName)))) {
|
||||
e.setCancelled(true);
|
||||
if (player.getOpenInventory().getTopInventory() != e.getClickedInventory()) {
|
||||
continue;
|
||||
@ -67,16 +67,16 @@ public class GUIListener implements Listener {
|
||||
if (slot.permission && !player.hasPermission(slot.permissionToUse)) {
|
||||
if (function.noPermMessageEnable) {
|
||||
if (function.customNoPermMessage == null || function.customNoPermMessage.equals("")) {
|
||||
T2Csend.player(player, SelectMessages.NoPermissionForItem.replace("[item]", T2Creplace.replace(prefix, function.name))
|
||||
T2C_Send.player(player, SelectMessages.NoPermissionForItem.replace("[item]", T2C_Replace.replace(prefix, function.name))
|
||||
.replace("[perm]", slot.permissionToUse));
|
||||
} else T2Csend.player(player, function.customNoPermMessage.replace("[item]", T2Creplace.replace(prefix, function.name))
|
||||
} else T2C_Send.player(player, function.customNoPermMessage.replace("[item]", T2C_Replace.replace(prefix, function.name))
|
||||
.replace("[perm]", slot.permissionToUse));
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (e.getCurrentItem().getType() == T2CitemVersion.getHead() || e.getCurrentItem().getType() == T2CitemVersion.getGreenWool().getType() ||
|
||||
e.getCurrentItem().getType() == T2CitemVersion.getRedWool().getType() ||
|
||||
if (e.getCurrentItem().getType() == T2C_ItemVersion.getHead() || e.getCurrentItem().getType() == T2C_ItemVersion.getGreenWool().getType() ||
|
||||
e.getCurrentItem().getType() == T2C_ItemVersion.getRedWool().getType() ||
|
||||
e.getCurrentItem().getType() == Material.valueOf(function.item.toUpperCase().replace(".", "_"))) {
|
||||
if (!slot.enable) return;
|
||||
if (function.cost_Enable) {
|
||||
@ -121,13 +121,13 @@ public class GUIListener implements Listener {
|
||||
@Override
|
||||
public void run() {
|
||||
if (slot.command_BungeeCommand) {
|
||||
if (SelectLibConfig.getBungee()) {
|
||||
if ((boolean) T2C_LibConfig.VALUES.proxy.getValue()) {
|
||||
for (String cmd : slot.command) {
|
||||
Bungee_Sender_Reciver.sendToBungee(player, cmd.replace("[player]", player.getName()), slot.commandAsConsole);
|
||||
}
|
||||
} else {
|
||||
T2Csend.console(prefix + " §4To use bungee commands, enable the Bungee option in the config.");
|
||||
T2Csend.player(player, prefix + " §4To use bungee commands, enable the Bungee option in the config.");
|
||||
T2C_Send.console(prefix + " §4To use bungee commands, enable the Bungee option in the config.");
|
||||
T2C_Send.player(player, prefix + " §4To use bungee commands, enable the Bungee option in the config.");
|
||||
}
|
||||
} else {
|
||||
for (String cmd : slot.command) {
|
||||
@ -159,12 +159,12 @@ public class GUIListener implements Listener {
|
||||
for (String msg : slot.message) {
|
||||
if (Main.PaPi) {
|
||||
if (slot.cost_Enable) {
|
||||
T2Csend.player(player, T2Creplace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
|
||||
} else T2Csend.player(player, T2Creplace.replace(prefix, player, Placeholder.replace(msg, player)));
|
||||
T2C_Send.player(player, T2C_Replace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
|
||||
} else T2C_Send.player(player, T2C_Replace.replace(prefix, player, Placeholder.replace(msg, player)));
|
||||
} else {
|
||||
if (slot.cost_Enable) {
|
||||
T2Csend.player(player, T2Creplace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
|
||||
} else T2Csend.player(player, T2Creplace.replace(prefix, Placeholder.replace(msg, player)));
|
||||
T2C_Send.player(player, T2C_Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.getCurrency()));
|
||||
} else T2C_Send.player(player, T2C_Replace.replace(prefix, Placeholder.replace(msg, player)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -176,7 +176,7 @@ public class GUIListener implements Listener {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
T2Csend.player(player, SelectMessages.onServerChange.replace("[server]", slot.serverChangeServer));
|
||||
T2C_Send.player(player, SelectMessages.onServerChange.replace("[server]", slot.serverChangeServer));
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -207,7 +207,7 @@ public class GUIListener implements Listener {
|
||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueLeft);
|
||||
break;
|
||||
default:
|
||||
T2Csend.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||
T2C_Send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||
|
||||
break;
|
||||
}
|
||||
@ -230,7 +230,7 @@ public class GUIListener implements Listener {
|
||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueRight);
|
||||
break;
|
||||
default:
|
||||
T2Csend.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||
T2C_Send.player(player, "§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||
|
||||
break;
|
||||
}
|
||||
@ -274,7 +274,7 @@ public class GUIListener implements Listener {
|
||||
|
||||
private static void toggleUseItem(Player player, Gui gui) {
|
||||
if (!SelectConfig.getUseItem_AllowToggle()) {
|
||||
T2Csend.sender(player, "§4UseItem toggle is disabled!");
|
||||
T2C_Send.sender(player, "§4UseItem toggle is disabled!");
|
||||
return;
|
||||
}
|
||||
if (Events.useItemHashMap.get(player.getName())) {
|
||||
@ -295,13 +295,13 @@ public class GUIListener implements Listener {
|
||||
player.closeInventory();
|
||||
switch (function.functionVotePointsMode) {
|
||||
case ADD:
|
||||
T2Ceco.votePointsAdd(prefix, player, function.functionVotePointsAmount);
|
||||
T2Csend.player(player, SelectMessages.functionVoteAdd.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||
T2C_Eco.votePointsAdd(prefix, player, function.functionVotePointsAmount);
|
||||
T2C_Send.player(player, SelectMessages.functionVoteAdd.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||
break;
|
||||
case REMOVE:
|
||||
if (T2Ceco.votePointsRemove(prefix, player, function.functionVotePointsAmount)) {
|
||||
T2Csend.player(player, SelectMessages.functionVoteRemove.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||
} else T2Csend.player(player, SelectMessages.functionVoteRemoveError.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||
if (T2C_Eco.votePointsRemove(prefix, player, function.functionVotePointsAmount)) {
|
||||
T2C_Send.player(player, SelectMessages.functionVoteRemove.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||
} else T2C_Send.player(player, SelectMessages.functionVoteRemoveError.replace("[amount]", function.functionVotePointsAmount.toString()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -311,14 +311,14 @@ public class GUIListener implements Listener {
|
||||
player.closeInventory();
|
||||
switch (function.functionItemMode) {
|
||||
case ADD:
|
||||
T2Ceco.itemAdd(player, new ItemStack(Material.valueOf(item[0])), Integer.parseInt(item[1]));
|
||||
T2Csend.player(player, SelectMessages.functionItemAdd.replace("[amount]", item[1]).replace("[item]", item[0]));
|
||||
T2C_Eco.itemAdd(player, new ItemStack(Material.valueOf(item[0])), Integer.parseInt(item[1]));
|
||||
T2C_Send.player(player, SelectMessages.functionItemAdd.replace("[amount]", item[1]).replace("[item]", item[0]));
|
||||
break;
|
||||
case REMOVE:
|
||||
if (T2Ceco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
|
||||
T2Csend.player(player, SelectMessages.functionItemRemove.replace("[amount]", item[1]).replace("[item]", item[0]));
|
||||
if (T2C_Eco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
|
||||
T2C_Send.player(player, SelectMessages.functionItemRemove.replace("[amount]", item[1]).replace("[item]", item[0]));
|
||||
|
||||
} else T2Csend.player(player, SelectMessages.functionItemRemoveError.replace("[amount]", item[1]));
|
||||
} else T2C_Send.player(player, SelectMessages.functionItemRemoveError.replace("[amount]", item[1]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -327,24 +327,24 @@ public class GUIListener implements Listener {
|
||||
switch (function.ecoModule) {
|
||||
case ITEM:
|
||||
String[] item = function.ecoItem.split(";");
|
||||
if (!T2Ceco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
|
||||
if (!T2C_Eco.itemRemove(player, item[0], Integer.parseInt(item[1]))) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
T2Csend.player(player, SelectMessages.noMoneyItem.replace("[item]", item[0]).replace("[amount]", item[1]));
|
||||
T2C_Send.player(player, SelectMessages.noMoneyItem.replace("[item]", item[0]).replace("[amount]", item[1]));
|
||||
Sound.play(player, SoundEnum.NoMoney);
|
||||
} else {
|
||||
T2Csend.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2Creplace.replace(prefix, function.name))
|
||||
T2C_Send.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2C_Replace.replace(prefix, function.name))
|
||||
.replace("[price]", item[1] + " " + item[0]));
|
||||
execute(function, slot, player, e, gui);
|
||||
}
|
||||
break;
|
||||
case VOTEPOINTS:
|
||||
if (T2Ceco.votePointsRemove(prefix, player, function.votePoints)) {
|
||||
T2Csend.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2Creplace.replace(prefix, function.name))
|
||||
if (T2C_Eco.votePointsRemove(prefix, player, function.votePoints)) {
|
||||
T2C_Send.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2C_Replace.replace(prefix, function.name))
|
||||
.replace("[price]", function.votePoints + " VotePoints"));
|
||||
execute(function, slot, player, e, gui);
|
||||
} else {
|
||||
@ -354,14 +354,14 @@ public class GUIListener implements Listener {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
T2Csend.player(player, SelectMessages.noMoneyVote.replace("[amount]", function.votePoints.toString()));
|
||||
T2C_Send.player(player, SelectMessages.noMoneyVote.replace("[amount]", function.votePoints.toString()));
|
||||
Sound.play(player, SoundEnum.NoMoney);
|
||||
}
|
||||
break;
|
||||
case VAULT:
|
||||
case MONEY:
|
||||
if (T2Ceco.moneyRemove(prefix, player, function.price)) {
|
||||
T2Csend.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2Creplace.replace(prefix, function.name))
|
||||
if (T2C_Eco.moneyRemove(prefix, player, function.price)) {
|
||||
T2C_Send.player(player, SelectMessages.Buy_msg.replace("[itemname]", T2C_Replace.replace(prefix, function.name))
|
||||
.replace("[price]", function.price + " " + SelectConfig.getCurrency()));
|
||||
execute(function, slot, player, e, gui);
|
||||
} else {
|
||||
@ -371,7 +371,7 @@ public class GUIListener implements Listener {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
T2Csend.player(player, T2Creplace.replacePrice(prefix, SelectMessages.noMoney, String.valueOf(function.price)));
|
||||
T2C_Send.player(player, T2C_Replace.replacePrice(prefix, SelectMessages.noMoney, String.valueOf(function.price)));
|
||||
Sound.play(player, SoundEnum.NoMoney);
|
||||
}
|
||||
break;
|
||||
|
@ -1,7 +1,5 @@
|
||||
package net.t2code.commandguiv2.Spigot.gui;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
|
||||
import net.t2code.commandguiv2.Spigot.objects.functions.Function;
|
||||
@ -9,24 +7,16 @@ import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
|
||||
import net.t2code.commandguiv2.Spigot.objects.slots.Slot;
|
||||
import net.t2code.commandguiv2.Spigot.system.Placeholder;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemBuilder;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import org.bukkit.Bukkit;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemBuilder;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.profile.PlayerProfile;
|
||||
import org.bukkit.profile.PlayerTextures;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.UUID;
|
||||
|
||||
public class GuiBuilder {
|
||||
|
||||
@ -72,21 +62,21 @@ public class GuiBuilder {
|
||||
private static void setDisplayNameAndLore(ItemMeta itemMeta, Player player, Slot slot) {
|
||||
Function function = Main.functionHashMap.get(slot.function);
|
||||
if (Main.PaPi) {
|
||||
itemMeta.setDisplayName(T2Creplace.replace(prefix, player, Placeholder.replace(function.name, player)));
|
||||
itemMeta.setDisplayName(T2C_Replace.replace(prefix, player, Placeholder.replace(function.name, player)));
|
||||
if (slot.permission && !player.hasPermission(slot.permissionToUse) && function.noPermLoreEnable) {
|
||||
itemMeta.setLore(T2Creplace.replacePrice(prefix, player, Placeholder.replace(function.noPermLore, player), function.price + " " + SelectConfig.getCurrency()));
|
||||
} else itemMeta.setLore(T2Creplace.replacePrice(prefix, player, Placeholder.replace(function.lore, player), function.price + " " + SelectConfig.getCurrency()));
|
||||
itemMeta.setLore(T2C_Replace.replacePrice(prefix, player, Placeholder.replace(function.noPermLore, player), function.price + " " + SelectConfig.getCurrency()));
|
||||
} else itemMeta.setLore(T2C_Replace.replacePrice(prefix, player, Placeholder.replace(function.lore, player), function.price + " " + SelectConfig.getCurrency()));
|
||||
} else {
|
||||
itemMeta.setDisplayName(T2Creplace.replace(prefix, Placeholder.replace(function.name, player)));
|
||||
itemMeta.setDisplayName(T2C_Replace.replace(prefix, Placeholder.replace(function.name, player)));
|
||||
if (slot.permission && !player.hasPermission(slot.permissionToUse) && function.noPermLoreEnable) {
|
||||
itemMeta.setLore(T2Creplace.replacePrice(prefix, Placeholder.replace(function.noPermLore, player), function.price + " " + SelectConfig.getCurrency()));
|
||||
} else itemMeta.setLore(T2Creplace.replacePrice(prefix, Placeholder.replace(function.lore, player), function.price + " " + SelectConfig.getCurrency()));
|
||||
itemMeta.setLore(T2C_Replace.replacePrice(prefix, Placeholder.replace(function.noPermLore, player), function.price + " " + SelectConfig.getCurrency()));
|
||||
} else itemMeta.setLore(T2C_Replace.replacePrice(prefix, Placeholder.replace(function.lore, player), function.price + " " + SelectConfig.getCurrency()));
|
||||
}
|
||||
}
|
||||
|
||||
protected static void base64(String base64Value, Slot slot, Player player, Inventory inventory) {
|
||||
Function function = Main.functionHashMap.get(slot.function);
|
||||
ItemStack item = T2CitemBuilder.base64(base64Value);
|
||||
ItemStack item = T2C_ItemBuilder.base64(base64Value);
|
||||
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
||||
setDisplayNameAndLore(itemMeta, player, slot);
|
||||
item.setItemMeta(itemMeta);
|
||||
@ -107,7 +97,7 @@ public class GuiBuilder {
|
||||
|
||||
protected static void playerHead(Slot slot, Player player, Inventory inventory, String skullName) {
|
||||
Function function = Main.functionHashMap.get(slot.function);
|
||||
ItemStack item = T2CitemVersion.getHeadIS();
|
||||
ItemStack item = T2C_ItemVersion.getHeadIS();
|
||||
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
||||
setDisplayNameAndLore(itemMeta, player, slot);
|
||||
itemMeta.setOwner(skullName);
|
||||
@ -122,7 +112,7 @@ public class GuiBuilder {
|
||||
|
||||
public static void fillItem(Inventory inventory, Gui gui) {
|
||||
ItemStack glass;
|
||||
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
glass = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, Short.parseShort(gui.guiFillItemItem));
|
||||
} else glass = new ItemStack(Material.valueOf(gui.guiFillItemItem.toUpperCase().replace(".", "_")));
|
||||
ItemMeta itemMetaglass = glass.getItemMeta();
|
||||
|
@ -13,9 +13,10 @@ import net.t2code.commandguiv2.Spigot.enums.SoundEnum;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import io.github.solyze.plugmangui.inventories.PluginListGUI;
|
||||
import net.t2code.luckyBox.api.LuckyBoxAPI;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -47,7 +48,7 @@ public class OpenGUI {
|
||||
player.openInventory((new PluginListGUI(54, 1)).getInventory());
|
||||
} else {
|
||||
if (player.hasPermission(Permissions.admin)) {
|
||||
T2Csend.player(player, prefix + " §4PlugManGUI could not be found! §9Please download it here: " +
|
||||
T2C_Send.player(player, prefix + " §4PlugManGUI could not be found! §9Please download it here: " +
|
||||
"§6https://spigotmc.org/resources/plugmangui.87599/");
|
||||
}
|
||||
}
|
||||
@ -57,21 +58,21 @@ public class OpenGUI {
|
||||
LuckyBoxAPI.openShop(player);
|
||||
} else {
|
||||
if (player.hasPermission(Permissions.admin)) {
|
||||
T2Csend.player(player, prefix + " §4T2C-LuckyBox could not be found! §9Please download it here: " +
|
||||
T2C_Send.player(player, prefix + " §4T2C-LuckyBox could not be found! §9Please download it here: " +
|
||||
"§6https://www.spigotmc.org/resources/luckybox.98154/");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (T2CmcVersion.isMc1_13()) {
|
||||
if (T2C_McVersion.isMc1_13()) {
|
||||
GUIListener.GUICode = "";
|
||||
} else GUIListener.GUICode = "§6§8§9§r";
|
||||
if (gui.guiEnable || player.hasPermission(Permissions.updatemsg)) {
|
||||
Inventory inventory;
|
||||
if (Main.PaPi) {
|
||||
inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (T2Creplace.replace(prefix, player, GUIListener.GUICode + gui.guiName)));
|
||||
} else inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (T2Creplace.replace(prefix, GUIListener.GUICode + gui.guiName)));
|
||||
inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (T2C_Replace.replace(prefix, player, GUIListener.GUICode + gui.guiName)));
|
||||
} else inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.guiLines, (T2C_Replace.replace(prefix, GUIListener.GUICode + gui.guiName)));
|
||||
|
||||
if (gui.guiFillItemEnable) {
|
||||
GuiBuilder.fillItem(inventory, gui);
|
||||
@ -80,7 +81,7 @@ public class OpenGUI {
|
||||
try {
|
||||
Function function = Main.functionHashMap.get(slot.function);
|
||||
if (function == null) {
|
||||
T2Csend.error(Main.getPlugin(), "The Function " + slot.function + " in the GUI " + gui.key + " does not exist!");
|
||||
T2C_Send.error(Main.getPlugin(), "The Function " + slot.function + " in the GUI " + gui.key + " does not exist!");
|
||||
continue;
|
||||
}
|
||||
if (slot.permission && !player.hasPermission(slot.permissionToSee)) continue;
|
||||
@ -131,8 +132,8 @@ public class OpenGUI {
|
||||
Sound.play(player, SoundEnum.OpenInventory);
|
||||
}
|
||||
player.openInventory(inventory);
|
||||
T2Csend.debug(plugin, "§6" + player.getName() + " §5Open §6" + T2Creplace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
} else T2Csend.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", T2Creplace.replace(prefix, gui.guiName)));
|
||||
T2C_Debug.debug(plugin, "§6" + player.getName() + " §5Open §6" + T2C_Replace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
} else T2C_Send.player(player, SelectMessages.GUIIsDisabled.replace("[gui]", T2C_Replace.replace(prefix, gui.guiName)));
|
||||
}
|
||||
|
||||
private static void toggleOn(Function function, Slot slot, Player player, Inventory inventory) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package net.t2code.commandguiv2.Spigot.listener;
|
||||
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -42,21 +42,21 @@ public class Bungee_Sender_Reciver implements PluginMessageListener {
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
||||
T2Csend.debug(Main.getPlugin(),"stream: "+stream.toString());
|
||||
T2C_Debug.debug(Main.getPlugin(),"stream: "+stream.toString());
|
||||
try {
|
||||
String subChannel = stream.readUTF();
|
||||
String input = stream.readUTF();
|
||||
T2Csend.debug(Main.getPlugin(),"subChannel: " +subChannel);
|
||||
T2Csend.debug(Main.getPlugin(),"input: " +input);
|
||||
T2C_Debug.debug(Main.getPlugin(),"subChannel: " +subChannel);
|
||||
T2C_Debug.debug(Main.getPlugin(),"input: " +input);
|
||||
switch (subChannel) {
|
||||
case "join":
|
||||
Main.bungeejoinplayers.add(input);
|
||||
Main.proxyJoinPlayers.add(input);
|
||||
break;
|
||||
case "left":
|
||||
Main.bungeejoinplayers.remove(input);
|
||||
Main.proxyJoinPlayers.remove(input);
|
||||
break;
|
||||
case "clear":
|
||||
Main.bungeejoinplayers.clear();
|
||||
Main.proxyJoinPlayers.clear();
|
||||
break;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -10,8 +10,8 @@ import net.t2code.commandguiv2.Spigot.objects.slots.Slot;
|
||||
import net.t2code.commandguiv2.Spigot.enums.EcoEnum;
|
||||
import net.t2code.commandguiv2.Spigot.enums.FunctionItemEnum;
|
||||
import net.t2code.commandguiv2.Spigot.enums.FunctionVoteEnum;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
@ -52,7 +52,7 @@ public class Obj_Select {
|
||||
String guiName = yamlConfiguration_gui.getString("GUI.Name");
|
||||
Boolean guiFillItemEnable = yamlConfiguration_gui.getBoolean("GUI.FillItem.Enable");
|
||||
String guiFillItemItem;
|
||||
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
guiFillItemItem = yamlConfiguration_gui.getString("GUI.FillItem.GlassPaneColor");
|
||||
} else guiFillItemItem = yamlConfiguration_gui.getString("GUI.FillItem.Item");
|
||||
|
||||
@ -66,7 +66,7 @@ public class Obj_Select {
|
||||
String function = yamlConfiguration_gui.getString("Slots." + slotKey + ".Function");
|
||||
Function functionCheck = Main.functionHashMap.get(function);
|
||||
if (functionCheck == null) {
|
||||
T2Csend.error(Main.getPlugin(), "The Function " + function + " in the GUI " + key + " does not exist!");
|
||||
T2C_Send.error(Main.getPlugin(), "The Function " + function + " in the GUI " + key + " does not exist!");
|
||||
}
|
||||
Boolean permRequired = yamlConfiguration_gui.getBoolean("Slots." + slotKey + ".Permission.Required");
|
||||
String permSee = yamlConfiguration_gui.getString("Slots." + slotKey + ".Permission.See");
|
||||
@ -134,7 +134,7 @@ public class Obj_Select {
|
||||
try {
|
||||
ecoModule = EcoEnum.valueOf(yamlConfiguration.getString("Slots.Function.Cost.EcoModule").toUpperCase());
|
||||
} catch (Exception ex) {
|
||||
T2Csend.error(Main.getPlugin(), "The EcoModule " + yamlConfiguration.getString("Slots.Function.Cost.EcoModule").toUpperCase() + " in the function file "
|
||||
T2C_Send.error(Main.getPlugin(), "The EcoModule " + yamlConfiguration.getString("Slots.Function.Cost.EcoModule").toUpperCase() + " in the function file "
|
||||
+ config.getName() + " does not exist. Please use one of the supported modules. (VAULT, ITEM, VOTEPOINTS)");
|
||||
}
|
||||
} else ecoModule = EcoEnum.VAULT;
|
||||
@ -184,7 +184,7 @@ public class Obj_Select {
|
||||
try {
|
||||
functionVotePointsMode = FunctionVoteEnum.valueOf(yamlConfiguration.getString("Slots.Function.FunctionVotePoints.Mode").toUpperCase());
|
||||
} catch (Exception ex) {
|
||||
T2Csend.error(Main.getPlugin(), "The VotePoints Mode " + yamlConfiguration.getString("Slots.Function.FunctionVotePoints.Mode").toUpperCase() + " in the function file "
|
||||
T2C_Send.error(Main.getPlugin(), "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)");
|
||||
}
|
||||
}
|
||||
@ -196,7 +196,7 @@ public class Obj_Select {
|
||||
try {
|
||||
functionItemMode = FunctionItemEnum.valueOf(yamlConfiguration.getString("Slots.Function.FunctionItem.Mode").toUpperCase());
|
||||
} catch (Exception ex) {
|
||||
T2Csend.error(Main.getPlugin(), "The Item Mode " + yamlConfiguration.getString("Slots.Function.FunctionItem.Mode").toUpperCase() + " in the function file "
|
||||
T2C_Send.error(Main.getPlugin(), "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)");
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import net.t2code.commandguiv2.Spigot.objects.guis.Gui;
|
||||
import net.t2code.commandguiv2.Spigot.objects.slots.Slot;
|
||||
import net.t2code.commandguiv2.Spigot.enums.SoundEnum;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Sound {
|
||||
@ -36,7 +36,7 @@ public class Sound {
|
||||
try {
|
||||
player.playSound(player.getLocation(), org.bukkit.Sound.valueOf(function.customSound_Sound.toUpperCase().replace(".", "_")), 3, 1);
|
||||
} catch (Exception e1) {
|
||||
T2Csend.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
|
||||
T2C_Send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
|
||||
.replace("[sound]", "§6GUI: §e" + gui.key + " §6Function: §e" + function.key + "§r §6Slot: §e" + (slot.slot + 1) + " §6CustomSound: §9" + function.customSound_Sound));
|
||||
player.playSound(player.getLocation(), SelectConfig.getSound_Click(), 3, 1);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package net.t2code.commandguiv2.Spigot.system;
|
||||
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@ -13,14 +13,14 @@ public class Debug {
|
||||
private static final Plugin plugin = Main.getPlugin();
|
||||
|
||||
public static void debugmsg() {
|
||||
T2Csend.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2Csend.debug(plugin, "§3Bukkit Version: §e" + Bukkit.getBukkitVersion());
|
||||
T2Csend.debug(plugin, "§3NMS Version: §e" + Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit.", ""));
|
||||
T2Csend.debug(plugin, "§3Version: §e" + Bukkit.getVersion());
|
||||
T2Csend.debug(plugin, "§3Java: §e" + System.getProperty("java.version"));
|
||||
T2Csend.debug(plugin, "§3Worlds: §e" + String.valueOf(Bukkit.getServer().getWorlds()));
|
||||
T2Csend.debug(plugin, String.valueOf(Arrays.asList(Main.getPlugin().getServer().getPluginManager().getPlugins())));
|
||||
T2Csend.debug(plugin, "§5----------------------------------");
|
||||
T2C_Debug.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Debug.debug(plugin, "§3Bukkit Version: §e" + Bukkit.getBukkitVersion());
|
||||
T2C_Debug.debug(plugin, "§3NMS Version: §e" + Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit.", ""));
|
||||
T2C_Debug.debug(plugin, "§3Version: §e" + Bukkit.getVersion());
|
||||
T2C_Debug.debug(plugin, "§3Java: §e" + System.getProperty("java.version"));
|
||||
T2C_Debug.debug(plugin, "§3Worlds: §e" + String.valueOf(Bukkit.getServer().getWorlds()));
|
||||
T2C_Debug.debug(plugin, String.valueOf(Arrays.asList(Main.getPlugin().getServer().getPluginManager().getPlugins())));
|
||||
T2C_Debug.debug(plugin, "§5----------------------------------");
|
||||
if (new File(Main.getPath(), "config.yml").exists()) {
|
||||
File f = new File(String.valueOf(Main.getPath()));
|
||||
File f2 = new File(String.valueOf(Main.getPath() + "/GUIs/"));
|
||||
@ -30,22 +30,22 @@ public class Debug {
|
||||
File[] fileArray3 = f3.listFiles();
|
||||
if (fileArray != null) {
|
||||
for (File config : fileArray) {
|
||||
T2Csend.debug(plugin, String.valueOf(config).replace("plugins/CommandGUI/", ""));
|
||||
T2C_Debug.debug(plugin, String.valueOf(config).replace("plugins/CommandGUI/", ""));
|
||||
}
|
||||
}
|
||||
if (fileArray2 != null) {
|
||||
for (File config2 : fileArray2) {
|
||||
T2Csend.debug(plugin, String.valueOf(config2).replace("plugins/CommandGUI/", ""));
|
||||
T2C_Debug.debug(plugin, String.valueOf(config2).replace("plugins/CommandGUI/", ""));
|
||||
}
|
||||
} else T2Csend.debug(plugin, "No GUI files available");
|
||||
} else T2C_Debug.debug(plugin, "No GUI files available");
|
||||
|
||||
if (fileArray3 != null) {
|
||||
for (File config3 : fileArray3) {
|
||||
T2Csend.debug(plugin, String.valueOf(config3).replace("plugins/CommandGUI/", ""));
|
||||
T2C_Debug.debug(plugin, String.valueOf(config3).replace("plugins/CommandGUI/", ""));
|
||||
}
|
||||
} else T2Csend.debug(plugin, "No language files available");
|
||||
} else T2C_Debug.debug(plugin, "No language files available");
|
||||
|
||||
}
|
||||
T2Csend.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
T2C_Debug.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,13 @@ import net.t2code.commandguiv2.Spigot.database.SQLITE;
|
||||
import net.t2code.commandguiv2.Spigot.database.SelectDatabase;
|
||||
import net.t2code.commandguiv2.Spigot.enums.StorageEnum;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Ctemplate;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.plugins.T2CpluginCheck;
|
||||
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Template;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.plugins.T2C_PluginCheck;
|
||||
import net.t2code.t2codelib.SPIGOT.api.update.T2C_UpdateAPI;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.T2C_LibConfig;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@ -41,14 +42,14 @@ public class Load {
|
||||
|
||||
public static void onLoad(String prefix, List<String> autor, String version, String spigot, int spigotID, String discord, int bstatsID) {
|
||||
|
||||
long long_ = T2Ctemplate.onLoadHeader(prefix, autor, version, spigot, discord);
|
||||
long long_ = T2C_Template.onLoadHeader(prefix, autor, version, spigot, discord);
|
||||
try {
|
||||
Debug.debugmsg();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
T2Csend.console(prefix + " §8-------------------------------");
|
||||
T2C_Send.console(prefix + " §8-------------------------------");
|
||||
try {
|
||||
ConfigConverter.renameMainFolder();
|
||||
} catch (Exception e) {
|
||||
@ -97,18 +98,18 @@ public class Load {
|
||||
|
||||
SelectConfig.setConfigVersion();
|
||||
|
||||
if (SelectLibConfig.getBungee()) {
|
||||
if ((boolean)T2C_LibConfig.VALUES.proxy.getValue()) {
|
||||
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin, "t2c:bcmd")) {
|
||||
T2Csend.debug(plugin, "registerOutgoingPluginChannel §et2c:bcmd");
|
||||
T2C_Debug.debug(plugin, "registerOutgoingPluginChannel §et2c:bcmd");
|
||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin, "t2c:bcmd");
|
||||
}
|
||||
if (!Bukkit.getMessenger().isIncomingChannelRegistered(plugin, "t2c:cguiopl")) {
|
||||
T2Csend.debug(plugin, "registerIncomingPluginChannel §et2c:cguiopl");
|
||||
T2C_Debug.debug(plugin, "registerIncomingPluginChannel §et2c:cguiopl");
|
||||
Bukkit.getMessenger().registerIncomingPluginChannel(plugin, "t2c:cguiopl", new Bungee_Sender_Reciver());
|
||||
}
|
||||
}
|
||||
|
||||
if (T2CpluginCheck.papi()) {
|
||||
if (T2C_PluginCheck.papi()) {
|
||||
new Papi().register();
|
||||
}
|
||||
|
||||
@ -139,14 +140,14 @@ public class Load {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
T2Csend.console(prefix + " §8-------------------------------");
|
||||
T2C_Send.console(prefix + " §8-------------------------------");
|
||||
loadStorage(prefix);
|
||||
T2Csend.console(prefix + " §8-------------------------------");
|
||||
T2C_Send.console(prefix + " §8-------------------------------");
|
||||
|
||||
if (Main.PaPi) {
|
||||
T2Csend.console(prefix + " §2PlaceholderAPI successfully connected!");
|
||||
T2C_Send.console(prefix + " §2PlaceholderAPI successfully connected!");
|
||||
} else {
|
||||
T2Csend.console(prefix + " §4PlaceholderAPI could not be connected / found!");
|
||||
T2C_Send.console(prefix + " §4PlaceholderAPI could not be connected / found!");
|
||||
}
|
||||
|
||||
try {
|
||||
@ -157,12 +158,12 @@ public class Load {
|
||||
|
||||
if (SelectConfig.getHelpAlias()) {
|
||||
Main.getPlugin().getCommand("commandguihelp").setExecutor(new CmdExecuter_Help());
|
||||
T2Csend.debug(plugin, "CommandRegister: commandguihelp");
|
||||
T2C_Debug.debug(plugin, "CommandRegister: commandguihelp");
|
||||
}
|
||||
Main.getPlugin().getCommand("commandgui").setExecutor(new CmdExecuter_GUI());
|
||||
T2Csend.debug(plugin, "CommandRegister: commandgui");
|
||||
T2C_Debug.debug(plugin, "CommandRegister: commandgui");
|
||||
Main.getPlugin().getCommand("commandgui-item").setExecutor(new CmdExecuter_GUIItem());
|
||||
T2Csend.debug(plugin, "CommandRegister: commandgui-item");
|
||||
T2C_Debug.debug(plugin, "CommandRegister: commandgui-item");
|
||||
|
||||
try {
|
||||
AliasRegister.onRegister();
|
||||
@ -175,29 +176,29 @@ public class Load {
|
||||
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new Events(), Main.getPlugin());
|
||||
|
||||
if (!T2CmcVersion.isMc1_8() && !T2CmcVersion.isMc1_9()) {
|
||||
if (!T2C_McVersion.isMc1_8() && !T2C_McVersion.isMc1_9()) {
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new EventsFrom110(), plugin);
|
||||
}
|
||||
|
||||
T2CupdateAPI.onUpdateCheck(plugin, prefix, Util.getGit(),spigotID,discord
|
||||
T2C_UpdateAPI.onUpdateCheck(plugin, prefix, Util.getGit(),spigotID,discord
|
||||
,SelectConfig.getUpdateCheckOnJoin(),SelectConfig.getUpdateCheckSeePreReleaseUpdates(),SelectConfig.getUpdateCheckTimeInterval());
|
||||
Metrics.Bstats();
|
||||
Main.addonLoad();
|
||||
T2Ctemplate.onLoadFooter(prefix, long_);
|
||||
T2C_Template.onLoadFooter(prefix, long_);
|
||||
}
|
||||
|
||||
private static void loadStorage(String prefix) {
|
||||
try {
|
||||
SelectDatabase.setStorage(StorageEnum.valueOf(SelectConfig.getStorage()));
|
||||
} catch (Exception ignored) {
|
||||
T2Csend.error(plugin, "The storage medium " + SelectConfig.getStorage() + " is not supported!");
|
||||
T2Csend.error(plugin, "Storage medium " + StorageEnum.SQLITE + " is used.");
|
||||
T2C_Send.error(plugin, "The storage medium " + SelectConfig.getStorage() + " is not supported!");
|
||||
T2C_Send.error(plugin, "Storage medium " + StorageEnum.SQLITE + " is used.");
|
||||
SelectDatabase.setStorage(StorageEnum.SQLITE);
|
||||
}
|
||||
|
||||
switch (SelectDatabase.getStorage()) {
|
||||
case MYSQL:
|
||||
T2Csend.console(prefix + " §2Storage medium §6" + SelectDatabase.getStorage() + " §2is used.");
|
||||
T2C_Send.console(prefix + " §2Storage medium §6" + SelectDatabase.getStorage() + " §2is used.");
|
||||
MySQL.main();
|
||||
try {
|
||||
MySQL.query("CREATE TABLE IF NOT EXISTS `gui-item` (" +
|
||||
@ -220,11 +221,11 @@ public class Load {
|
||||
}
|
||||
break;
|
||||
case YML:
|
||||
T2Csend.console(prefix + " §2Storage medium §6" + SelectDatabase.getStorage() + " §2is used.");
|
||||
T2C_Send.console(prefix + " §2Storage medium §6" + SelectDatabase.getStorage() + " §2is used.");
|
||||
break;
|
||||
default:
|
||||
case SQLITE:
|
||||
T2Csend.console(prefix + " §2Storage medium §6" + SelectDatabase.getStorage() + " §2is used.");
|
||||
T2C_Send.console(prefix + " §2Storage medium §6" + SelectDatabase.getStorage() + " §2is used.");
|
||||
try {
|
||||
SQLITE.main();
|
||||
SQLITE.query("CREATE TABLE IF NOT EXISTS `gui-item` (" +
|
||||
|
@ -7,8 +7,8 @@ import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||
import net.t2code.commandguiv2.Spigot.gui.OpenGUI;
|
||||
import net.t2code.commandguiv2.Spigot.database.SelectDatabase;
|
||||
import net.t2code.commandguiv2.api.CGuiAPI;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -44,14 +44,14 @@ public class Events implements Listener {
|
||||
} else useItemSlotHashMap.put(e.getPlayer().getName(), i);
|
||||
|
||||
if (CGuiAPI.JoinDisable) {
|
||||
T2Csend.debug(Main.getPlugin(), "JoinDisable");
|
||||
T2C_Debug.debug(Main.getPlugin(), "JoinDisable");
|
||||
return;
|
||||
}
|
||||
if (e.getPlayer().hasPermission("commandgui.get.guiitem.at.login")) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
T2Csend.debug(Main.getPlugin(), "itemChange: " + e.getPlayer().getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "itemChange: " + e.getPlayer().getName());
|
||||
ItemChange.itemChange(e.getPlayer(), true);
|
||||
}
|
||||
}.runTaskLater(Main.getPlugin(), 20L * 1);
|
||||
@ -149,7 +149,7 @@ public class Events implements Listener {
|
||||
|
||||
if (SelectConfig.getUseItem_Enable()) {
|
||||
if (SelectConfig.getUseItem_PlayerHead_Enable()) {
|
||||
if (e.getItem() != null && p.getItemInHand().getType() == T2CitemVersion.getHead()) {
|
||||
if (e.getItem() != null && p.getItemInHand().getType() == T2C_ItemVersion.getHead()) {
|
||||
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||
openGUI(e, p);
|
||||
}
|
||||
@ -181,12 +181,12 @@ public class Events implements Listener {
|
||||
if (SelectConfig.getUseItemGameModeProtection()) {
|
||||
if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
|
||||
e.setCancelled(true);
|
||||
T2Csend.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||
T2C_Send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||
return;
|
||||
}
|
||||
if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
|
||||
e.setCancelled(true);
|
||||
T2Csend.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||
T2C_Send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -194,12 +194,12 @@ public class Events implements Listener {
|
||||
if (SelectConfig.getUseItemWorldProtection()) {
|
||||
if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
|
||||
e.setCancelled(true);
|
||||
T2Csend.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||
T2C_Send.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||
return;
|
||||
}
|
||||
if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
|
||||
e.setCancelled(true);
|
||||
T2Csend.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||
T2C_Send.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -207,7 +207,7 @@ public class Events implements Listener {
|
||||
if (!SelectConfig.getUseItem_Permission() || player.hasPermission("commandgui.useitem")) {
|
||||
OpenGUI.openGUI(player, SelectConfig.getUseItem_OpenGUI(), true);
|
||||
} else {
|
||||
T2Csend.player(player,SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
||||
T2C_Send.player(player,SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
||||
.replace("[gui]", SelectConfig.getUseItem_OpenGUI()));
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ package net.t2code.commandguiv2.Spigot.useItem;
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
|
||||
import net.t2code.t2codelib.BUNGEE.system.config.T2CBlibConfig;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
@ -39,11 +39,11 @@ public class ItemChange {
|
||||
}
|
||||
}
|
||||
}
|
||||
T2Csend.debug(Main.getPlugin(), "GiveOnlyOnFirstJoin: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "GiveOnlyOnFirstJoin: " + player.getName());
|
||||
return;
|
||||
}
|
||||
if (!SelectConfig.getUseItem_GiveOnEveryJoin()) {
|
||||
T2Csend.debug(Main.getPlugin(), "!GiveOnEveryJoin: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "!GiveOnEveryJoin: " + player.getName());
|
||||
return;
|
||||
}
|
||||
new BukkitRunnable() {
|
||||
@ -53,7 +53,7 @@ public class ItemChange {
|
||||
if (pln == null) return;
|
||||
if (!SelectConfig.getUseItem_AllowToggle() || pln) {
|
||||
if (SelectConfig.getUseItem_InventorySlotEnforce() || player.getInventory().getItem(slot - 1) == null) {
|
||||
T2Csend.debug(Main.getPlugin(), "Give: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "Give: " + player.getName());
|
||||
UseItem.giveUseItem(player);
|
||||
if (setCursor) {
|
||||
setCursor(player, slot);
|
||||
@ -76,38 +76,38 @@ public class ItemChange {
|
||||
}
|
||||
|
||||
private static void setCursor(Player player, int slot) {
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 1 Player: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 1 Player: " + player.getName());
|
||||
|
||||
if (!SelectConfig.getCursor_ToGUIItem_OnLogin()) {
|
||||
return;
|
||||
}
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 2 Player: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 2 Player: " + player.getName());
|
||||
if (SelectConfig.getCursor_ToGUIItem_OnlyOnFirstLogin()) {
|
||||
if (!player.hasPlayedBefore()) {
|
||||
player.getInventory().setHeldItemSlot(slot - 1);
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 3 Player: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 3 Player: " + player.getName());
|
||||
}
|
||||
return;
|
||||
}
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 4 Player: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 4 Player: " + player.getName());
|
||||
if (!SelectLibConfig.getBungee()) {
|
||||
player.getInventory().setHeldItemSlot(slot - 1);
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 5 Player: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 5 Player: " + player.getName());
|
||||
return;
|
||||
}
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 6 Player: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 6 Player: " + player.getName());
|
||||
if (SelectConfig.getUseItem_ServerChange()) {
|
||||
player.getInventory().setHeldItemSlot(slot - 1);
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 7 Player: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 7 Player: " + player.getName());
|
||||
return;
|
||||
}
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 8 Player: " + player.getName());
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor bungeejoinplayers: " + Main.bungeejoinplayers);
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor Player: " + player.getName());
|
||||
if (Main.bungeejoinplayers.contains(player.getName())) {
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 8 Player: " + player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor bungeejoinplayers: " + Main.proxyJoinPlayers);
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor Player: " + player.getName());
|
||||
if (Main.proxyJoinPlayers.contains(player.getName())) {
|
||||
player.getInventory().setHeldItemSlot(slot - 1);
|
||||
T2Csend.debug(Main.getPlugin(), "setCursor 9 Player: " + player.getName());
|
||||
Main.bungeejoinplayers.remove(player.getName());
|
||||
T2C_Debug.debug(Main.getPlugin(), "setCursor 9 Player: " + player.getName());
|
||||
Main.proxyJoinPlayers.remove(player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,25 +1,21 @@
|
||||
package net.t2code.commandguiv2.Spigot.useItem;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import net.t2code.commandguiv2.Spigot.Main;
|
||||
import net.t2code.commandguiv2.Spigot.config.config.SelectConfig;
|
||||
import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemBuilder;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2CitemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Creplace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2CmcVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemBuilder;
|
||||
import net.t2code.t2codelib.SPIGOT.api.items.T2C_ItemVersion;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Replace;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.SPIGOT.api.minecraftVersion.T2C_McVersion;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.UUID;
|
||||
|
||||
public class UseItem {
|
||||
public static void giveUseItem(Player player) {
|
||||
Integer slot;
|
||||
@ -32,7 +28,7 @@ public class UseItem {
|
||||
if (SelectConfig.getUseItem_InventorySlot_FreeSlot()) {
|
||||
player.getInventory().addItem(itemStack(player));
|
||||
} else {
|
||||
T2Csend.debug(Main.getPlugin(), "setUseItem: " + player.getName() + " Slot: " + Integer.parseInt(String.valueOf(slot - 1)));
|
||||
T2C_Debug.debug(Main.getPlugin(), "setUseItem: " + player.getName() + " Slot: " + Integer.parseInt(String.valueOf(slot - 1)));
|
||||
player.getInventory().setItem(slot - 1, itemStack(player));
|
||||
}
|
||||
}
|
||||
@ -47,18 +43,18 @@ public class UseItem {
|
||||
private static ItemStack itemStack(Player player) {
|
||||
ItemStack item = null;
|
||||
if (SelectConfig.getUseItem_PlayerHead_Enable()) {
|
||||
if (T2CmcVersion.isMc1_8() || T2CmcVersion.isMc1_9() || T2CmcVersion.isMc1_10() || T2CmcVersion.isMc1_11() || T2CmcVersion.isMc1_12()) {
|
||||
T2Csend.player(player, Util.getPrefix() + "§c Playerheads for UseItem are only available from version §61.13§c!");
|
||||
T2Csend.error(Main.getPlugin(), "Playerheads for UseItem are only available from version 1.13!");
|
||||
if (T2C_McVersion.isMc1_8() || T2C_McVersion.isMc1_9() || T2C_McVersion.isMc1_10() || T2C_McVersion.isMc1_11() || T2C_McVersion.isMc1_12()) {
|
||||
T2C_Send.player(player, Util.getPrefix() + "§c Playerheads for UseItem are only available from version §61.13§c!");
|
||||
T2C_Send.error(Main.getPlugin(), "Playerheads for UseItem are only available from version 1.13!");
|
||||
} else {
|
||||
|
||||
SkullMeta playerheadmeta = null;
|
||||
|
||||
if (SelectConfig.getUseItem_Base64_Enable()) {
|
||||
item = T2CitemBuilder.base64(SelectConfig.getUseItem_Base64value());
|
||||
item = T2C_ItemBuilder.base64(SelectConfig.getUseItem_Base64value());
|
||||
playerheadmeta = (SkullMeta) item.getItemMeta();
|
||||
} else {
|
||||
item = T2CitemVersion.getHeadIS();
|
||||
item = T2C_ItemVersion.getHeadIS();
|
||||
playerheadmeta = (SkullMeta) item.getItemMeta();
|
||||
String p;
|
||||
if (SelectConfig.getUseItem_PlayerWhoHasOpenedTheGUI()) {
|
||||
@ -67,8 +63,8 @@ public class UseItem {
|
||||
playerheadmeta.setOwner(p);
|
||||
}
|
||||
if (Main.PaPi) {
|
||||
playerheadmeta.setLore(T2Creplace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
|
||||
} else playerheadmeta.setLore(T2Creplace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
|
||||
playerheadmeta.setLore(T2C_Replace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
|
||||
} else playerheadmeta.setLore(T2C_Replace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
|
||||
playerheadmeta.setDisplayName(SelectConfig.getUseItem_Name());
|
||||
item.setItemMeta(playerheadmeta);
|
||||
}
|
||||
@ -77,8 +73,8 @@ public class UseItem {
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
itemMeta.setDisplayName(SelectConfig.getUseItem_Name());
|
||||
if (Main.PaPi) {
|
||||
itemMeta.setLore(T2Creplace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
|
||||
} else itemMeta.setLore(T2Creplace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
|
||||
itemMeta.setLore(T2C_Replace.replace(Util.getPrefix(), player, SelectConfig.getUseItem_Lore()));
|
||||
} else itemMeta.setLore(T2C_Replace.replace(Util.getPrefix(), SelectConfig.getUseItem_Lore()));
|
||||
item.setItemMeta(itemMeta);
|
||||
item.setAmount(1);
|
||||
}
|
||||
@ -89,13 +85,13 @@ public class UseItem {
|
||||
if (SelectConfig.getUseItemGameModeProtection()) {
|
||||
if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
|
||||
if (interact) {
|
||||
T2Csend.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||
T2C_Send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||
} else if (!SelectConfig.getUseItemGameModeRemoveItemWhenItIsDisabled()) removeItem(player);
|
||||
return true;
|
||||
}
|
||||
if (SelectConfig.getUseItemGameModeMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemGameModeList().contains(player.getGameMode().toString())) {
|
||||
if (interact) {
|
||||
T2Csend.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||
T2C_Send.player(player, SelectMessages.UseItemDisabledInGameMode);
|
||||
} else if (!SelectConfig.getUseItemGameModeRemoveItemWhenItIsDisabled()) removeItem(player);
|
||||
return true;
|
||||
}
|
||||
@ -103,13 +99,13 @@ public class UseItem {
|
||||
if (SelectConfig.getUseItemWorldProtection()) {
|
||||
if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("blacklist") && SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
|
||||
if (interact) {
|
||||
T2Csend.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||
T2C_Send.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||
} else if (!SelectConfig.getUseItemWorldRemoveItemWhenItIsDisabled()) removeItem(player);
|
||||
return true;
|
||||
}
|
||||
if (SelectConfig.getUseItemWorldMode().equalsIgnoreCase("whitelist") && !SelectConfig.getUseItemWorldList().contains(player.getWorld().getName())) {
|
||||
if (interact) {
|
||||
T2Csend.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||
T2C_Send.player(player, SelectMessages.UseItemDisabledInWorld);
|
||||
} else if (!SelectConfig.getUseItemWorldRemoveItemWhenItIsDisabled()) removeItem(player);
|
||||
return true;
|
||||
}
|
||||
@ -118,11 +114,11 @@ public class UseItem {
|
||||
}
|
||||
|
||||
public static void removeItem(Player player) {
|
||||
T2Csend.debug(Main.getPlugin(), "World disabled: " + player.getName() + " " + player.getWorld().toString());
|
||||
T2C_Debug.debug(Main.getPlugin(), "World disabled: " + player.getName() + " " + player.getWorld().toString());
|
||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||
ItemStack itm = player.getInventory().getItem(iam);
|
||||
if (itm != null) {
|
||||
if (itm.getType() == Material.valueOf(SelectConfig.getUseItem_Material()) || itm.getType() == T2CitemVersion.getHead()) {
|
||||
if (itm.getType() == Material.valueOf(SelectConfig.getUseItem_Material()) || itm.getType() == T2C_ItemVersion.getHead()) {
|
||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name())) {
|
||||
player.getInventory().remove(itm);
|
||||
player.updateInventory();
|
||||
|
@ -1,40 +1,40 @@
|
||||
package net.t2code.commandguiv2;
|
||||
|
||||
import lombok.Getter;
|
||||
import net.t2code.t2codelib.util.T2C_Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Util {
|
||||
|
||||
public static String getInfoText() {
|
||||
return "";
|
||||
}
|
||||
@Getter
|
||||
private static final String infoText = "";
|
||||
|
||||
public static String getRequiredT2CodeLibVersion() {
|
||||
return "16.2";
|
||||
}
|
||||
@Getter
|
||||
private static final String requiredT2CodeLibVersion = "16.7";
|
||||
|
||||
public static String getPrefix() {
|
||||
return "§8[§4C§9GUI§8]";
|
||||
}
|
||||
@Getter
|
||||
private static final String prefix = "§8[§4C§9GUI§8]";
|
||||
|
||||
public static Integer getSpigotID() {
|
||||
return 90671;
|
||||
}
|
||||
@Getter
|
||||
private static final Integer spigotID = 90671;
|
||||
|
||||
public static String getGit() {
|
||||
return "JaTiTV/T2C-CommandGUI";
|
||||
}
|
||||
@Getter
|
||||
private static final String git = "JaTiTV/T2C-CommandGUI";
|
||||
|
||||
public static Integer getBstatsID() {
|
||||
return 10840;
|
||||
}
|
||||
@Getter
|
||||
private static final Integer bstatsID = 10840;
|
||||
|
||||
public static String getSpigot() {
|
||||
return "https://www.spigotmc.org/resources/" + getSpigotID();
|
||||
}
|
||||
@Getter
|
||||
private static final String spigot = "https://www.spigotmc.org/resources/" + getSpigotID();
|
||||
|
||||
public static String getDiscord() {
|
||||
return net.t2code.t2codelib.Util.getDiscord();
|
||||
}
|
||||
@Getter
|
||||
private static final String discord = T2C_Util.getDiscord();
|
||||
|
||||
public static Integer getConfigVersion() {
|
||||
return 7;
|
||||
public static String[] getConfigLogo() {
|
||||
ArrayList<String> arrayList = new ArrayList<>(T2C_Util.getConfigT2CodeLogo());
|
||||
arrayList.addAll(Arrays.asList("", "# Spigot: " + spigot));
|
||||
return arrayList.toArray(new String[0]);
|
||||
}
|
||||
}
|
||||
|
@ -11,10 +11,14 @@ import net.t2code.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||
import net.t2code.commandguiv2.Spigot.system.Permissions;
|
||||
import net.t2code.commandguiv2.Spigot.database.SelectDatabase;
|
||||
import net.t2code.commandguiv2.Util;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.SPIGOT.api.debug.T2C_Debug;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class CGuiAPI {
|
||||
public static Boolean JoinDisable = false;
|
||||
@ -26,32 +30,32 @@ public class CGuiAPI {
|
||||
ItemChange.itemChange(player, setCursor);
|
||||
}
|
||||
|
||||
public static boolean hasUseItemInMainHand(Player player) {
|
||||
public static boolean hasUseItemInMainHand(@NotNull Player player) {
|
||||
ItemStack item = player.getInventory().getItemInMainHand();
|
||||
return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||
return item.hasItemMeta() && Objects.requireNonNull(item.getItemMeta()).hasDisplayName()
|
||||
&& item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name());
|
||||
}
|
||||
|
||||
public static boolean hasUseItemInOffHand(Player player) {
|
||||
public static boolean hasUseItemInOffHand(@NotNull Player player) {
|
||||
ItemStack item = player.getInventory().getItemInOffHand();
|
||||
return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||
return item.hasItemMeta() && Objects.requireNonNull(item.getItemMeta()).hasDisplayName()
|
||||
&& item.getItemMeta().getDisplayName().equals(SelectConfig.getUseItem_Name());
|
||||
}
|
||||
|
||||
public static void disableItemGiveOnJoin(Boolean disableItemGiveOnJoin) {
|
||||
T2Csend.debug(Main.getPlugin(), "CGuiAPI: " + disableItemGiveOnJoin);
|
||||
T2C_Debug.debug(Main.getPlugin(), "CGuiAPI: " + disableItemGiveOnJoin);
|
||||
JoinDisable = disableItemGiveOnJoin;
|
||||
}
|
||||
|
||||
public static Boolean selectPlayerItemEnable(Player player) {
|
||||
public static Boolean selectPlayerItemEnable(@NotNull Player player) {
|
||||
return Events.useItemHashMap.get(player.getName());
|
||||
}
|
||||
|
||||
public static Integer selectPlayerItemSlot(Player player) {
|
||||
public static Integer selectPlayerItemSlot(@NotNull Player player) {
|
||||
return Events.useItemSlotHashMap.get(player.getName());
|
||||
}
|
||||
|
||||
public static void setPlayerItemEnable(Player player, Boolean value) {
|
||||
public static void setPlayerItemEnable(Player player, @NotNull Boolean value) {
|
||||
if (value) {
|
||||
SelectDatabase.setItemStatusTrue(player);
|
||||
} else SelectDatabase.setItemStatusFalse(player);
|
||||
@ -73,14 +77,14 @@ public class CGuiAPI {
|
||||
Help.sendHelp(sender, Util.getPrefix());
|
||||
}
|
||||
|
||||
public static void sendPluginInfo(CommandSender sender) {
|
||||
public static void sendPluginInfo(@NotNull CommandSender sender) {
|
||||
if (sender.hasPermission(Permissions.info)) {
|
||||
Commands.info(sender);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandgui admin").replace("[perm]", Permissions.info));
|
||||
}
|
||||
|
||||
public static void createDefaultGUI(CommandSender sender) {
|
||||
public static void createDefaultGUI(@NotNull CommandSender sender) {
|
||||
if (sender.hasPermission(Permissions.admin)) {
|
||||
CreateGUI.configCreate();
|
||||
sender.sendMessage(SelectMessages.DefaultGUIcreate.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||
@ -88,7 +92,7 @@ public class CGuiAPI {
|
||||
.replace("[cmd]", "/commandgui admin").replace("[perm]", Permissions.admin));
|
||||
}
|
||||
|
||||
public static void reload(CommandSender sender) {
|
||||
public static void reload(@NotNull CommandSender sender) {
|
||||
if (sender.hasPermission(Permissions.admin)) {
|
||||
Commands.reload(sender);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
|
Loading…
Reference in New Issue
Block a user