Merge pull request '2.7.5' (#10) from 2.7.5 into main
Reviewed-on: JaTiTV/CommandGUI#10
This commit is contained in:
commit
5674b54593
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>CommandGUI_V2</artifactId>
|
<artifactId>CommandGUI_V2</artifactId>
|
||||||
<version>2.7.4</version>
|
<version>2.7.5</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CommandGUI</name>
|
<name>CommandGUI</name>
|
||||||
@ -85,7 +85,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>11.8</version>
|
<version>11.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
|
@ -61,7 +61,7 @@ public class GUIListener implements Listener {
|
|||||||
if (e.getSlot() != slot.slot) return;
|
if (e.getSlot() != slot.slot) return;
|
||||||
if (slot.permission && !player.hasPermission(slot.permissionToSee)) return;
|
if (slot.permission && !player.hasPermission(slot.permissionToSee)) return;
|
||||||
if (slot.permission && !player.hasPermission(slot.permissionToUse)) {
|
if (slot.permission && !player.hasPermission(slot.permissionToUse)) {
|
||||||
player.sendMessage(SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, function.name))
|
send.player(player,SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, function.name))
|
||||||
.replace("[perm]", slot.permissionToUse));
|
.replace("[perm]", slot.permissionToUse));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -79,11 +79,11 @@ public class GUIListener implements Listener {
|
|||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
}
|
}
|
||||||
}.runTaskLater(plugin, 1L);
|
}.runTaskLater(plugin, 1L);
|
||||||
player.sendMessage(SelectMessages.No_money);
|
send.player(player,SelectMessages.No_money);
|
||||||
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable)
|
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable)
|
||||||
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
|
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
|
send.player(player,SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, function.name))
|
||||||
.replace("[price]", function.price + " " + SelectConfig.Currency));
|
.replace("[price]", function.price + " " + SelectConfig.Currency));
|
||||||
execute(function, slot, player, e, gui);
|
execute(function, slot, player, e, gui);
|
||||||
}
|
}
|
||||||
@ -155,12 +155,12 @@ public class GUIListener implements Listener {
|
|||||||
for (String msg : slot.message) {
|
for (String msg : slot.message) {
|
||||||
if (Main.PaPi) {
|
if (Main.PaPi) {
|
||||||
if (slot.cost_Enable) {
|
if (slot.cost_Enable) {
|
||||||
player.sendMessage(Replace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
send.player(player, Replace.replacePrice(prefix, player, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
||||||
} else player.sendMessage(Replace.replace(prefix, player, Placeholder.replace(msg, player)));
|
} else send.player(player, Replace.replace(prefix, player, Placeholder.replace(msg, player)));
|
||||||
} else {
|
} else {
|
||||||
if (slot.cost_Enable) {
|
if (slot.cost_Enable) {
|
||||||
player.sendMessage(Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
send.player(player, Replace.replacePrice(prefix, Placeholder.replace(msg, player), slot.price + " " + SelectConfig.Currency));
|
||||||
} else player.sendMessage(Replace.replace(prefix, Placeholder.replace(msg, player)));
|
} else send.player(player, Replace.replace(prefix, Placeholder.replace(msg, player)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ public class GUIListener implements Listener {
|
|||||||
} else if (slot.configOptionPremat.equals("List")) {
|
} else if (slot.configOptionPremat.equals("List")) {
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueLeft);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueLeft);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
send.player(player,"§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e.getClick() == ClickType.RIGHT) {
|
if (e.getClick() == ClickType.RIGHT) {
|
||||||
@ -212,7 +212,7 @@ public class GUIListener implements Listener {
|
|||||||
} else if (slot.configOptionPremat.equals("List")) {
|
} else if (slot.configOptionPremat.equals("List")) {
|
||||||
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueRight);
|
yamlConfiguration.set(slot.configOptionPath.replace("/", "."), slot.configListValueRight);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
send.player(player,"§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -207,7 +207,7 @@ public class Events implements Listener {
|
|||||||
if (!SelectConfig.UseItem_Permission || player.hasPermission("commandgui.useitem")) {
|
if (!SelectConfig.UseItem_Permission || player.hasPermission("commandgui.useitem")) {
|
||||||
OpenGUI.openGUI(player, SelectConfig.UseItem_OpenGUI, true);
|
OpenGUI.openGUI(player, SelectConfig.UseItem_OpenGUI, true);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
send.player(player,SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
||||||
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
|
import de.jatitv.commandguiv2.Spigot.config.gui.CreateGUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
@ -17,7 +16,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CmdExecuter_GUITab implements CommandExecutor, TabCompleter {
|
public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
|
||||||
private static String prefix = Util.getPrefix();
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
@Override
|
@Override
|
@ -23,7 +23,7 @@ public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
|||||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
if (SelectConfig.UseItem_AllowToggle) {
|
if (SelectConfig.UseItem_AllowToggle) {
|
||||||
Help.sendGUIItemHelp(sender, prefix);
|
Help.sendGUIItemHelp(sender);
|
||||||
} else send.sender(sender, "§4UseItem toggle is disabled!");// todo
|
} else send.sender(sender, "§4UseItem toggle is disabled!");// todo
|
||||||
} else {
|
} else {
|
||||||
if (args.length == 1 || args.length == 2) {
|
if (args.length == 1 || args.length == 2) {
|
||||||
|
@ -7,21 +7,17 @@ import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
|||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
||||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.UseItem;
|
import de.jatitv.commandguiv2.Spigot.system.UseItem;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
|
|
||||||
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
|
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.Permissions;
|
import de.jatitv.commandguiv2.Spigot.system.Permissions;
|
||||||
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
import de.jatitv.commandguiv2.Spigot.system.database.SelectDatabase;
|
||||||
import de.jatitv.commandguiv2.Util;
|
import de.jatitv.commandguiv2.Util;
|
||||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
|
||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@ -63,8 +59,8 @@ public class Commands {
|
|||||||
send.console(Util.getPrefix() + " §6Plugin reload...");
|
send.console(Util.getPrefix() + " §6Plugin reload...");
|
||||||
send.console(Util.getPrefix() + "§8-------------------------------");
|
send.console(Util.getPrefix() + "§8-------------------------------");
|
||||||
|
|
||||||
CmdExecuter_GUITab.arg1.clear();
|
CmdExecuter_GUI.arg1.clear();
|
||||||
CmdExecuter_GUITab.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
||||||
|
|
||||||
SelectConfig.onSelect();
|
SelectConfig.onSelect();
|
||||||
Main.plugin.reloadConfig();
|
Main.plugin.reloadConfig();
|
||||||
@ -143,7 +139,7 @@ public class Commands {
|
|||||||
UseItem.addUseItem(player);
|
UseItem.addUseItem(player);
|
||||||
send.player(player, SelectMessages.ItemON);
|
send.player(player, SelectMessages.ItemON);
|
||||||
} else {
|
} else {
|
||||||
player.sendMessage(SelectMessages.NoInventorySpace);
|
send.player(player,SelectMessages.NoInventorySpace);
|
||||||
if (SelectConfig.Sound_NoInventorySpace_Enable && SelectConfig.Sound_Enable) {
|
if (SelectConfig.Sound_NoInventorySpace_Enable && SelectConfig.Sound_Enable) {
|
||||||
player.playSound(player.getLocation(), SelectConfig.Sound_NoInventorySpace, 3, 1);
|
player.playSound(player.getLocation(), SelectConfig.Sound_NoInventorySpace, 3, 1);
|
||||||
}
|
}
|
||||||
@ -158,7 +154,7 @@ public class Commands {
|
|||||||
|
|
||||||
public static void onSetSlot(Player player, Integer setSlot) {
|
public static void onSetSlot(Player player, Integer setSlot) {
|
||||||
if (!SelectConfig.UseItem_AllowSetSlot) {
|
if (!SelectConfig.UseItem_AllowSetSlot) {
|
||||||
player.sendMessage(Util.getPrefix() + " §4Function disabled");
|
send.player(player,Util.getPrefix() + " §4Function disabled");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,7 +169,7 @@ public class Commands {
|
|||||||
|
|
||||||
if (Events.useItemHashMap.get(player.getName())) {
|
if (Events.useItemHashMap.get(player.getName())) {
|
||||||
if (Objects.equals(Events.useItemSlotHashMap.get(player.getName()), setSlot)) {
|
if (Objects.equals(Events.useItemSlotHashMap.get(player.getName()), setSlot)) {
|
||||||
player.sendMessage(SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
|
send.player(player,SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -200,9 +196,9 @@ public class Commands {
|
|||||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) {
|
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) {
|
||||||
OpenGUI.openGUI(player, SelectConfig.DefaultGUI, true);
|
OpenGUI.openGUI(player, SelectConfig.DefaultGUI, true);
|
||||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
} else send.player(player,SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
||||||
.replace("[perm]", "commandgui.command"));
|
.replace("[perm]", "commandgui.command"));
|
||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
} else send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,9 +208,9 @@ public class Commands {
|
|||||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + gui.key) || player.hasPermission("commandgui.bypass")) {
|
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + gui.key) || player.hasPermission("commandgui.bypass")) {
|
||||||
OpenGUI.openGUI(player, arg, true);
|
OpenGUI.openGUI(player, arg, true);
|
||||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + gui.key)
|
} else send.player(player,SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + gui.key)
|
||||||
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
|
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
|
||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
|
} else send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.key));
|
||||||
} else player.sendMessage(SelectMessages.GUInotFound);
|
} else send.player(player,SelectMessages.GUInotFound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,43 +8,104 @@ import de.jatitv.commandguiv2.Util;
|
|||||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class Help {
|
public class Help {
|
||||||
private static String prefix = Util.getPrefix();
|
private static String prefix = Util.getPrefix();
|
||||||
|
|
||||||
public static void sendHelp(CommandSender sender, String Prefix) {
|
public static void sendHelp(CommandSender sender, String Prefix) {
|
||||||
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
|
||||||
if (sender.hasPermission("commandgui.command")) {
|
|
||||||
Gui gui = Main.guiHashMap.get(SelectConfig.DefaultGUI);
|
Gui gui = Main.guiHashMap.get(SelectConfig.DefaultGUI);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpCgui.replace("[gui]", Replace.replace(prefix,gui.guiName)));
|
|
||||||
for (String alias : Main.allAliases) {
|
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
||||||
if (Main.guiHashMap.get(alias).guiEnable || sender.hasPermission("commandgui.bypass")) {
|
cgui(sender, gui);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix,Main.guiHashMap.get(alias).guiName)));
|
open(sender);
|
||||||
}
|
help(sender);
|
||||||
}
|
gUIItemHelp(sender);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpHelp);
|
info(sender);
|
||||||
}
|
give(sender);
|
||||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
createDefaultGUI(sender);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_on);
|
reload(sender);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_off);
|
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
|
||||||
}
|
|
||||||
if (sender.hasPermission("commandgui.command.info")) {
|
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpInfo);
|
|
||||||
}
|
|
||||||
if (sender.hasPermission("commandgui.admin")) {
|
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath()+ "\\GUIs\\default.yml"));
|
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.HelpReload);
|
|
||||||
}
|
|
||||||
send.sender(sender, Prefix + " §8-------------------------");
|
send.sender(sender, Prefix + " §8-------------------------");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendGUIItemHelp(CommandSender sender, String Prefix) {
|
|
||||||
|
private static void cgui(CommandSender sender, Gui gui) {
|
||||||
|
if (!sender.hasPermission("commandgui.command")) return;
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCgui.replace("[gui]", Replace.replace(prefix, gui.guiName)));
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpCgui.replace("[gui]", Replace.replace(prefix, gui.guiName)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void open(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.command")) return;
|
||||||
|
|
||||||
|
for (String alias : Main.allAliases) {
|
||||||
|
if (Main.guiHashMap.get(alias).guiEnable || sender.hasPermission("commandgui.bypass")) {
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
|
||||||
|
} else
|
||||||
|
send.sender(sender, prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix, Main.guiHashMap.get(alias).guiName)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void help(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.command")) return;
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpHelp);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpHelp);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void info(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.command.info")) return;
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpInfo);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void give(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.admin")) return;
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpGive);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpGive);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void createDefaultGUI(CommandSender sender) {
|
||||||
|
if (!sender.hasPermission("commandgui.admin")) return;
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpCreateDefaultGUI.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||||
|
} else 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) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerHelpReload);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.HelpReload);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void gUIItemHelp(CommandSender sender) {
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_on);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_on);
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_off);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_off);
|
||||||
|
|
||||||
|
if (sender instanceof Player) {
|
||||||
|
send.player((Player) sender, prefix + " " + SelectMessages.PlayerGUIItemHelp_Slot);
|
||||||
|
} else send.sender(sender, prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
||||||
|
}
|
||||||
|
public static void sendGUIItemHelp(CommandSender sender) {
|
||||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
||||||
send.sender(sender, Prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
|
send.sender(sender, prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_on);
|
gUIItemHelp(sender);
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_off);
|
send.sender(sender, prefix + " §8------------------------------");
|
||||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
|
||||||
send.sender(sender, Prefix + " §8------------------------------");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import de.jatitv.commandguiv2.Spigot.Main;
|
|||||||
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
||||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
|
||||||
|
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -26,9 +27,9 @@ public class RegisterCommand extends Command {
|
|||||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
||||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + alias) || player.hasPermission("commandgui.bypass")) {
|
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + alias) || player.hasPermission("commandgui.bypass")) {
|
||||||
OpenGUI.openGUI(player, alias, true);
|
OpenGUI.openGUI(player, alias, true);
|
||||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + alias)
|
} else send.player(player,SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + alias)
|
||||||
.replace("[perm]", "commandgui.command." + alias));
|
.replace("[perm]", "commandgui.command." + alias));
|
||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
} else send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", gui.guiName));
|
||||||
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,17 @@ public class LanguagesCreate {
|
|||||||
set("Help.UseItem_Off", MSG.EN_GUIItemHelp_off, yamlConfigurationEN);
|
set("Help.UseItem_Off", MSG.EN_GUIItemHelp_off, yamlConfigurationEN);
|
||||||
set("Help.UseItem_Slot", MSG.EN_GUIItemHelp_Slot, yamlConfigurationEN);
|
set("Help.UseItem_Slot", MSG.EN_GUIItemHelp_Slot, yamlConfigurationEN);
|
||||||
|
|
||||||
|
set("Help.Player.CGUI", MSG.EN_PlayerHelp_CGUI, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Help", MSG.EN_PlayerHelp_Help, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Info", MSG.EN_PlayerHelp_Info, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Open", MSG.EN_PlayerHelp_Open, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Give", MSG.EN_PlayerHelp_Give, yamlConfigurationEN);
|
||||||
|
set("Help.Player.CreateDefaultGUI", MSG.EN_PlayerHelp_CreateDefaultGUI, yamlConfigurationEN);
|
||||||
|
set("Help.Player.Reload", MSG.EN_PlayerHelp_Reload, yamlConfigurationEN);
|
||||||
|
set("Help.Player.UseItem_On", MSG.EN_GUIItemPlayerHelp_on, yamlConfigurationEN);
|
||||||
|
set("Help.Player.UseItem_Off", MSG.EN_GUIItemPlayerHelp_off, yamlConfigurationEN);
|
||||||
|
set("Help.Player.UseItem_Slot", MSG.EN_GUIItemPlayerHelp_Slot, yamlConfigurationEN);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfigurationEN.save(messagesEN);
|
yamlConfigurationEN.save(messagesEN);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -135,6 +146,17 @@ public class LanguagesCreate {
|
|||||||
set("Help.UseItem_Off", MSG.DE_GUIItemHelp_off, yamlConfigurationDE);
|
set("Help.UseItem_Off", MSG.DE_GUIItemHelp_off, yamlConfigurationDE);
|
||||||
set("Help.UseItem_Slot", MSG.DE_GUIItemHelp_Slot, yamlConfigurationDE);
|
set("Help.UseItem_Slot", MSG.DE_GUIItemHelp_Slot, yamlConfigurationDE);
|
||||||
|
|
||||||
|
set("Help.Player.CGUI", MSG.DE_PlayerHelp_CGUI, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Help", MSG.DE_PlayerHelp_Help, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Info", MSG.DE_PlayerHelp_Info, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Open", MSG.DE_PlayerHelp_Open, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Give", MSG.DE_PlayerHelp_Give, yamlConfigurationDE);
|
||||||
|
set("Help.Player.CreateDefaultGUI", MSG.DE_PlayerHelp_CreateDefaultGUI, yamlConfigurationDE);
|
||||||
|
set("Help.Player.Reload", MSG.DE_PlayerHelp_Reload, yamlConfigurationDE);
|
||||||
|
set("Help.Player.UseItem_On", MSG.DE_GUIItemPlayerHelp_on, yamlConfigurationDE);
|
||||||
|
set("Help.Player.UseItem_Off", MSG.DE_GUIItemPlayerHelp_off, yamlConfigurationDE);
|
||||||
|
set("Help.Player.UseItem_Slot", MSG.DE_GUIItemPlayerHelp_Slot, yamlConfigurationDE);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfigurationDE.save(messagesDE);
|
yamlConfigurationDE.save(messagesDE);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -200,6 +222,17 @@ public class LanguagesCreate {
|
|||||||
set("Help.UseItem_Off", MSG.NO_GUIItemHelp_off, yamlConfigurationNO);
|
set("Help.UseItem_Off", MSG.NO_GUIItemHelp_off, yamlConfigurationNO);
|
||||||
set("Help.UseItem_Slot", MSG.NO_GUIItemHelp_Slot, yamlConfigurationNO);
|
set("Help.UseItem_Slot", MSG.NO_GUIItemHelp_Slot, yamlConfigurationNO);
|
||||||
|
|
||||||
|
set("Help.Player.CGUI", MSG.NO_PlayerHelp_CGUI, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Help", MSG.NO_PlayerHelp_Help, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Info", MSG.NO_PlayerHelp_Info, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Open", MSG.NO_PlayerHelp_Open, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Give", MSG.NO_PlayerHelp_Give, yamlConfigurationNO);
|
||||||
|
set("Help.Player.CreateDefaultGUI", MSG.NO_PlayerHelp_CreateDefaultGUI, yamlConfigurationNO);
|
||||||
|
set("Help.Player.Reload", MSG.NO_PlayerHelp_Reload, yamlConfigurationNO);
|
||||||
|
set("Help.Player.UseItem_On", MSG.NO_GUIItemPlayerHelp_on, yamlConfigurationNO);
|
||||||
|
set("Help.Player.UseItem_Off", MSG.NO_GUIItemPlayerHelp_off, yamlConfigurationNO);
|
||||||
|
set("Help.Player.UseItem_Slot", MSG.NO_GUIItemPlayerHelp_Slot, yamlConfigurationNO);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
yamlConfigurationNO.save(messagesNO);
|
yamlConfigurationNO.save(messagesNO);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -60,7 +60,18 @@ public class MSG {
|
|||||||
|
|
||||||
public static String EN_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eActivate the GUIItem for you.";
|
public static String EN_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eActivate the GUIItem for you.";
|
||||||
public static String EN_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDisable the GUIItem for yourself.";
|
public static String EN_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDisable the GUIItem for yourself.";
|
||||||
public static String EN_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSet the slot for GUIItem for you.";
|
public static String EN_GUIItemHelp_Slot = "&8''&b/gui-item slot &7<slot>&8'' &eSet the slot where you want to have the GUIItem.";
|
||||||
|
public static String EN_PlayerHelp_CGUI = "&b/commandgui &8| &b/cgui/*/&eOpen the default GUI &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui";
|
||||||
|
public static String EN_PlayerHelp_Open = "&b/commandgui [gui]/*/&eOpen the GUI: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui ";
|
||||||
|
public static String EN_PlayerHelp_Help = "&b/commandguihelp/*/&eOpen this help./*/SUGGEST_COMMAND/*//commandguihelp";
|
||||||
|
public static String EN_PlayerHelp_Info = "&b/commandgui admin info/*/&eCall the info from &4Command&9GUI &e./*/SUGGEST_COMMAND/*//commandgui admin info";
|
||||||
|
public static String EN_PlayerHelp_Give = "&b/commandgui admin give &7<player>/*/&eGive a player the GUI item./*/SUGGEST_COMMAND/*//commandgui admin give ";
|
||||||
|
public static String EN_PlayerHelp_CreateDefaultGUI = "&b/commandgui admin createdefaultgui/*/&eCreate a default GUI &7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui";
|
||||||
|
public static String EN_PlayerHelp_Reload = "&b/commandgui admin reload/*/&eReload the plugin./*/SUGGEST_COMMAND/*//commandgui admin reload";
|
||||||
|
|
||||||
|
public static String EN_GUIItemPlayerHelp_on = "&b/gui-item on/*/&eActivate the GUIItem for you./*/SUGGEST_COMMAND/*//gui-item on";
|
||||||
|
public static String EN_GUIItemPlayerHelp_off = "&b/gui-item off/*/&eDisable the GUIItem for yourself./*/SUGGEST_COMMAND/*//gui-item off";
|
||||||
|
public static String EN_GUIItemPlayerHelp_Slot = "&b/gui-item slot &7<slot>/*/&eSet the slot where you want to have the GUIItem./*/SUGGEST_COMMAND/*//gui-item slot ";
|
||||||
|
|
||||||
// DE
|
// DE
|
||||||
public static String DE_VaultNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
public static String DE_VaultNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
||||||
@ -109,7 +120,19 @@ public class MSG {
|
|||||||
|
|
||||||
public static String DE_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiviere f[ue]r dich das GUIItem.";
|
public static String DE_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiviere f[ue]r dich das GUIItem.";
|
||||||
public static String DE_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiviere f[ue]r dich das GUIItem.";
|
public static String DE_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiviere f[ue]r dich das GUIItem.";
|
||||||
public static String DE_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSetze den Slot für GUIItem für Sie einstellen.";
|
public static String DE_GUIItemHelp_Slot = "&8''&b/gui-item slot &7<slot>&8'' &eStelle den Slot ein, auf den du das GUIItem haben möchtest.";
|
||||||
|
|
||||||
|
public static String DE_PlayerHelp_CGUI = "&b/commandgui &8| &b/cgui/*/&e[OE]ffne die default GUI &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui";
|
||||||
|
public static String DE_PlayerHelp_Open = "&b/commandgui [gui]/*/&e[OE]ffne die GUI: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui ";
|
||||||
|
public static String DE_PlayerHelp_Help = "&b/commandguihelp/*/&e[OE]ffne diese help./*/SUGGEST_COMMAND/*//commandguihelp";
|
||||||
|
public static String DE_PlayerHelp_Info = "&b/commandgui admin info/*/&eRufe die Infos von &4Command&9GUI &eauf./*/SUGGEST_COMMAND/*//commandgui admin info";
|
||||||
|
public static String DE_PlayerHelp_Give = "&b/commandgui admin give &7<player>/*/&eGebe einem Spieler das GUI-Item./*/SUGGEST_COMMAND/*//commandgui admin give ";
|
||||||
|
public static String DE_PlayerHelp_CreateDefaultGUI = "&b/commandgui admin createdefaultgui/*/&eLasse eine default GUI erstellen &7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui";
|
||||||
|
public static String DE_PlayerHelp_Reload = "&b/commandgui admin reload/*/&eLade das Plugin neu./*/SUGGEST_COMMAND/*//commandgui admin reload";
|
||||||
|
|
||||||
|
public static String DE_GUIItemPlayerHelp_on = "&b/gui-item on/*/&eAktiviere f[ue]r dich das GUIItem./*/SUGGEST_COMMAND/*//gui-item on";
|
||||||
|
public static String DE_GUIItemPlayerHelp_off = "&b/gui-item off/*/&eDeaktiviere f[ue]r dich das GUIItem./*/SUGGEST_COMMAND/*//gui-item off";
|
||||||
|
public static String DE_GUIItemPlayerHelp_Slot = "&b/gui-item slot &7<slot>/*/&eStelle den Slot ein, auf den du das GUIItem haben möchtest./*/SUGGEST_COMMAND/*//gui-item slot ";
|
||||||
|
|
||||||
|
|
||||||
// FR
|
// FR
|
||||||
@ -162,5 +185,17 @@ public class MSG {
|
|||||||
|
|
||||||
public static String NO_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiverer en GUI gjenstand for deg.";
|
public static String NO_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiverer en GUI gjenstand for deg.";
|
||||||
public static String NO_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiverer en GUI gjenstand for deg.";
|
public static String NO_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiverer en GUI gjenstand for deg.";
|
||||||
public static String NO_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSett sporet for GUIItem for deg.";
|
public static String NO_GUIItemHelp_Slot = "&8''&b/gui-item slot &7<slot>&8'' &eSett sporet for GUIItem for deg.";
|
||||||
|
|
||||||
|
public static String NO_PlayerHelp_CGUI = "&b/commandgui &8| &b/cgui/*/&eÅpne default GUIen &7(&r[gui]&7)&e./*/SUGGEST_COMMAND/*//commandgui";
|
||||||
|
public static String NO_PlayerHelp_Open = "&b/commandgui [gui]/*/&eÅpne GUIen: &6[guiname]&e./*/SUGGEST_COMMAND/*//commandgui ";
|
||||||
|
public static String NO_PlayerHelp_Help = "&b/commandguihelp/*/&eSender denne hjelpe meldingen./*/SUGGEST_COMMAND/*//commandguihelp";
|
||||||
|
public static String NO_PlayerHelp_Info = "&b/commandgui admin info/*/&eKall informasjon fra &4Command&9GUI&e./*/SUGGEST_COMMAND/*//commandgui admin info";
|
||||||
|
public static String NO_PlayerHelp_Give = "&b/commandgui admin give &7<player>/*/&eGi en spiller GUI gjenstanden./*/SUGGEST_COMMAND/*//commandgui admin give ";
|
||||||
|
public static String NO_PlayerHelp_CreateDefaultGUI = "&b/commandgui admin createdefaultgui/*/&eLag en normalverdi GUI &7([directory])&e./*/SUGGEST_COMMAND/*//commandgui admin createdefaultgui";
|
||||||
|
public static String NO_PlayerHelp_Reload = "&b/commandgui admin reload/*/&eLast inn pluginet på nytt./*/SUGGEST_COMMAND/*//commandgui admin reload";
|
||||||
|
|
||||||
|
public static String NO_GUIItemPlayerHelp_on = "&b/gui-item on/*/&eAktiverer en GUI gjenstand for deg./*/SUGGEST_COMMAND/*//gui-item on";
|
||||||
|
public static String NO_GUIItemPlayerHelp_off = "&b/gui-item off/*/&eDeaktiverer en GUI gjenstand for deg./*/SUGGEST_COMMAND/*//gui-item off";
|
||||||
|
public static String NO_GUIItemPlayerHelp_Slot = "&b/gui-item slot &7<slot>/*/&eSett sporet for GUIItem for deg./*/SUGGEST_COMMAND/*//gui-item slot ";
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import net.t2code.lib.Spigot.Lib.replace.Replace;
|
|||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
public class SelectMessages {
|
public class SelectMessages {
|
||||||
|
|
||||||
@ -60,11 +61,21 @@ public class SelectMessages {
|
|||||||
public static String GUIItemHelp_on;
|
public static String GUIItemHelp_on;
|
||||||
public static String GUIItemHelp_off;
|
public static String GUIItemHelp_off;
|
||||||
public static String GUIItemHelp_Slot;
|
public static String GUIItemHelp_Slot;
|
||||||
|
public static String PlayerHelpCgui;
|
||||||
|
public static String PlayerHelpHelp;
|
||||||
|
public static String PlayerHelpInfo;
|
||||||
|
public static String PlayerHelpOpen;
|
||||||
|
public static String PlayerHelpGive;
|
||||||
|
public static String PlayerHelpCreateDefaultGUI;
|
||||||
|
public static String PlayerHelpReload;
|
||||||
|
public static String PlayerGUIItemHelp_on;
|
||||||
|
public static String PlayerGUIItemHelp_off;
|
||||||
|
public static String PlayerGUIItemHelp_Slot;
|
||||||
|
|
||||||
public static void onSelect(String Prefix) {
|
public static void onSelect(String Prefix) {
|
||||||
|
|
||||||
send.debug(Main.plugin, "§4Select language...");
|
send.debug(Main.plugin, "§4Select language...");
|
||||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
long long_ = System.currentTimeMillis();
|
||||||
|
|
||||||
File msg;
|
File msg;
|
||||||
|
|
||||||
@ -128,11 +139,22 @@ public class SelectMessages {
|
|||||||
GUIItemHelp_off = select("Help.UseItem_Off", yamlConfiguration_msg);
|
GUIItemHelp_off = select("Help.UseItem_Off", yamlConfiguration_msg);
|
||||||
GUIItemHelp_Slot = select("Help.UseItem_Slot", yamlConfiguration_msg);
|
GUIItemHelp_Slot = select("Help.UseItem_Slot", yamlConfiguration_msg);
|
||||||
|
|
||||||
|
PlayerHelpCgui = select("Help.Player.CGUI", yamlConfiguration_msg);
|
||||||
|
PlayerHelpHelp = select("Help.Player.Help", yamlConfiguration_msg);
|
||||||
|
PlayerHelpInfo = select("Help.Player.Info", yamlConfiguration_msg);
|
||||||
|
PlayerHelpOpen = select("Help.Player.Open", yamlConfiguration_msg);
|
||||||
|
PlayerHelpGive = select("Help.Player.Give", yamlConfiguration_msg);
|
||||||
|
PlayerHelpCreateDefaultGUI = select("Help.Player.CreateDefaultGUI", yamlConfiguration_msg);
|
||||||
|
PlayerHelpReload = select("Help.Player.Reload", yamlConfiguration_msg);
|
||||||
|
PlayerGUIItemHelp_on = select("Help.Player.UseItem_On", yamlConfiguration_msg);
|
||||||
|
PlayerGUIItemHelp_off = select("Help.Player.UseItem_Off", yamlConfiguration_msg);
|
||||||
|
PlayerGUIItemHelp_Slot = select("Help.Player.UseItem_Slot", yamlConfiguration_msg);
|
||||||
|
|
||||||
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
|
||||||
|
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String select(String path, YamlConfiguration yamlConfiguration){
|
private static String select(String path, YamlConfiguration yamlConfiguration){
|
||||||
return Replace.replace(Util.getPrefix(),yamlConfiguration.getString(path));
|
return Replace.replace(Util.getPrefix(), Objects.requireNonNull(yamlConfiguration.getString(path)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,7 +126,7 @@ public class OpenGUI {
|
|||||||
}
|
}
|
||||||
player.openInventory(inventory);
|
player.openInventory(inventory);
|
||||||
send.debug(plugin, "§6" + player.getName() + " §5Open §6" + Replace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
send.debug(plugin, "§6" + player.getName() + " §5Open §6" + Replace.replace(prefix, gui.guiName) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", Replace.replace(prefix, gui.guiName)));
|
} else send.player(player,SelectMessages.GUIIsDisabled.replace("[gui]", Replace.replace(prefix, gui.guiName)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void toggleOn(Function function, Integer slot, Player player, Inventory inventory) {
|
private static void toggleOn(Function function, Integer slot, Player player, Inventory inventory) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package de.jatitv.commandguiv2.Spigot.objects;
|
package de.jatitv.commandguiv2.Spigot.objects;
|
||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Main;
|
import de.jatitv.commandguiv2.Spigot.Main;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUITab;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
import de.jatitv.commandguiv2.Spigot.objects.functions.Function;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
import de.jatitv.commandguiv2.Spigot.objects.guis.Gui;
|
||||||
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
import de.jatitv.commandguiv2.Spigot.objects.slots.Slot;
|
||||||
@ -14,7 +14,6 @@ import java.io.File;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class Obj_Select {
|
public class Obj_Select {
|
||||||
public static void onSelect() {
|
public static void onSelect() {
|
||||||
@ -80,7 +79,7 @@ public class Obj_Select {
|
|||||||
key, commandAliasEnable, commandPermission, slots);
|
key, commandAliasEnable, commandPermission, slots);
|
||||||
|
|
||||||
Main.guiHashMap.put(key, gui);
|
Main.guiHashMap.put(key, gui);
|
||||||
CmdExecuter_GUITab.arg1.put(config_gui.getName()
|
CmdExecuter_GUI.arg1.put(config_gui.getName()
|
||||||
.replace(".yml", ""), "commandgui.gui." + key);
|
.replace(".yml", ""), "commandgui.gui." + key);
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import java.util.List;
|
|||||||
public class Debug {
|
public class Debug {
|
||||||
|
|
||||||
private static final Plugin plugin = Main.plugin;
|
private static final Plugin plugin = Main.plugin;
|
||||||
|
|
||||||
public static void debugmsg() {
|
public static void debugmsg() {
|
||||||
send.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
send.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
send.debug(plugin, "§3Bukkit Version: §e" + Bukkit.getBukkitVersion());
|
send.debug(plugin, "§3Bukkit Version: §e" + Bukkit.getBukkitVersion());
|
||||||
@ -32,15 +33,23 @@ public class Debug {
|
|||||||
File[] fileArray = f.listFiles();
|
File[] fileArray = f.listFiles();
|
||||||
File[] fileArray2 = f2.listFiles();
|
File[] fileArray2 = f2.listFiles();
|
||||||
File[] fileArray3 = f3.listFiles();
|
File[] fileArray3 = f3.listFiles();
|
||||||
|
if (fileArray != null) {
|
||||||
for (File config : fileArray) {
|
for (File config : fileArray) {
|
||||||
send.debug(plugin, String.valueOf(config).replace("plugins/CommandGUI/", ""));
|
send.debug(plugin, String.valueOf(config).replace("plugins/CommandGUI/", ""));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (fileArray2 != null) {
|
||||||
for (File config2 : fileArray2) {
|
for (File config2 : fileArray2) {
|
||||||
send.debug(plugin, String.valueOf(config2).replace("plugins/CommandGUI/", ""));
|
send.debug(plugin, String.valueOf(config2).replace("plugins/CommandGUI/", ""));
|
||||||
}
|
}
|
||||||
|
} else send.debug(plugin, "No GUI files available");
|
||||||
|
|
||||||
|
if (fileArray3 != null) {
|
||||||
for (File config3 : fileArray3) {
|
for (File config3 : fileArray3) {
|
||||||
send.debug(plugin, String.valueOf(config3).replace("plugins/CommandGUI/", ""));
|
send.debug(plugin, String.valueOf(config3).replace("plugins/CommandGUI/", ""));
|
||||||
}
|
}
|
||||||
|
} else send.debug(plugin, "No language files available");
|
||||||
|
|
||||||
}
|
}
|
||||||
send.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
send.debug(plugin, "§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package de.jatitv.commandguiv2.Spigot.system;
|
|||||||
|
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.GUIListener;
|
import de.jatitv.commandguiv2.Spigot.Listener.GUIListener;
|
||||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.EventsFrom110;
|
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.EventsFrom110;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUITab;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help;
|
||||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
||||||
@ -36,7 +36,7 @@ import java.util.List;
|
|||||||
public class Load {
|
public class Load {
|
||||||
static Plugin plugin = Main.plugin;
|
static Plugin plugin = Main.plugin;
|
||||||
|
|
||||||
public static void onLoad(String prefix, List autor, String version, String spigot, int spigotID, String discord, int bstatsID) {
|
public static void onLoad(String prefix, List<String> autor, String version, String spigot, int spigotID, String discord, int bstatsID) {
|
||||||
|
|
||||||
Long long_ = T2CodeTemplate.onLoadHeader(prefix, autor, version, spigot, discord);
|
Long long_ = T2CodeTemplate.onLoadHeader(prefix, autor, version, spigot, discord);
|
||||||
try {
|
try {
|
||||||
@ -98,7 +98,7 @@ public class Load {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
CmdExecuter_GUITab.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -133,7 +133,7 @@ public class Load {
|
|||||||
Main.plugin.getCommand("commandguihelp").setExecutor(new CmdExecuter_Help());
|
Main.plugin.getCommand("commandguihelp").setExecutor(new CmdExecuter_Help());
|
||||||
send.debug(plugin, "CommandRegister: commandguihelp");
|
send.debug(plugin, "CommandRegister: commandguihelp");
|
||||||
}
|
}
|
||||||
Main.plugin.getCommand("commandgui").setExecutor(new CmdExecuter_GUITab());
|
Main.plugin.getCommand("commandgui").setExecutor(new CmdExecuter_GUI());
|
||||||
send.debug(plugin, "CommandRegister: commandgui");
|
send.debug(plugin, "CommandRegister: commandgui");
|
||||||
Main.plugin.getCommand("commandgui-item").setExecutor(new CmdExecuter_GUIItem());
|
Main.plugin.getCommand("commandgui-item").setExecutor(new CmdExecuter_GUIItem());
|
||||||
send.debug(plugin, "CommandRegister: commandgui-item");
|
send.debug(plugin, "CommandRegister: commandgui-item");
|
||||||
|
@ -42,17 +42,18 @@ public class MySQL {
|
|||||||
send.console(Main.prefix + " §4MYSQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
send.console(Main.prefix + " §4MYSQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
|
||||||
send.error(Main.plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
|
send.error(Main.plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
|
||||||
}
|
}
|
||||||
if (SelectConfig.Debug || Main.version.contains("DEV")){
|
|
||||||
|
if (SelectConfig.Debug || Main.version.toLowerCase().contains("dev") || Main.version.toLowerCase().contains("beta") || Main.version.toLowerCase().contains("snapshot")) {
|
||||||
try {
|
try {
|
||||||
send.warning(Main.plugin, "MySQL DEBUG:");
|
send.error(Main.plugin, "MySQL DEBUG:");
|
||||||
Connection con = ds.getConnection();
|
Connection con = ds.getConnection();
|
||||||
DatabaseMetaData dbmd = con.getMetaData();
|
DatabaseMetaData dbmd = con.getMetaData();
|
||||||
Bukkit.getConsoleSender().sendMessage("Metadata of the database:");
|
send.debugmsg(Main.plugin, "§6Metadata of the database:");
|
||||||
Bukkit.getConsoleSender().sendMessage("DB :" + dbmd.getDatabaseProductName());
|
send.debugmsg(Main.plugin, "§6DB: §e" + dbmd.getDatabaseProductName());
|
||||||
Bukkit.getConsoleSender().sendMessage("Version :" + dbmd.getDatabaseProductVersion());
|
send.debugmsg(Main.plugin, "§6Version: §e" + dbmd.getDatabaseProductVersion());
|
||||||
Bukkit.getConsoleSender().sendMessage("Driver :" + dbmd.getDriverName());
|
send.debugmsg(Main.plugin, "§6Driver: §e" + dbmd.getDriverName());
|
||||||
Bukkit.getConsoleSender().sendMessage(" :" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
send.debugmsg(Main.plugin, "§6Driver MajorVersion: §e" + dbmd.getDriverMajorVersion() + "." + dbmd.getDriverMinorVersion());
|
||||||
Bukkit.getConsoleSender().sendMessage(" :" + dbmd.getDriverVersion());
|
send.debugmsg(Main.plugin, "§6Driver Version: §e" + dbmd.getDriverVersion());
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import net.t2code.lib.Spigot.Lib.messages.send;
|
|||||||
|
|
||||||
public class Util {
|
public class Util {
|
||||||
private static Integer configVersion = 5;
|
private static Integer configVersion = 5;
|
||||||
private static double requiredT2CodeLibVersion = 11.8;
|
private static double requiredT2CodeLibVersion = 11.9;
|
||||||
private static String Prefix = "§8[§4C§9GUI§8]";
|
private static String Prefix = "§8[§4C§9GUI§8]";
|
||||||
private static Integer SpigotID = 90671;
|
private static Integer SpigotID = 90671;
|
||||||
private static Integer BstatsID = 10840;
|
private static Integer BstatsID = 10840;
|
||||||
|
Loading…
Reference in New Issue
Block a user