small fix
This commit is contained in:
parent
13af9faf36
commit
90696365dd
@ -54,7 +54,6 @@ public final class Main extends JavaPlugin {
|
|||||||
autor = this.getDescription().getAuthors();
|
autor = this.getDescription().getAuthors();
|
||||||
version = this.getDescription().getVersion();
|
version = this.getDescription().getVersion();
|
||||||
if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
|
if (pluginNotFound("T2CodeLib", 96388, Util.getRequiredT2CodeLibVersion())) return;
|
||||||
Util.load();
|
|
||||||
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() ||
|
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()) {
|
T2C_McVersion.isMc1_14() || T2C_McVersion.isMc1_15() || T2C_McVersion.isNms1_16_R1()) {
|
||||||
legacy = true;
|
legacy = true;
|
||||||
|
@ -174,18 +174,28 @@ public class Commands {
|
|||||||
} else T2C_Send.player(player, Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui")
|
} else T2C_Send.player(player, Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui")
|
||||||
.replace("[perm]", "commandgui.command"));
|
.replace("[perm]", "commandgui.command"));
|
||||||
} else T2C_Send.player(player, Languages.VALUES.GUIIsDisabled.getValue().toString().replace("[gui]", gui.guiName));
|
} else T2C_Send.player(player, Languages.VALUES.GUIIsDisabled.getValue().toString().replace("[gui]", gui.guiName));
|
||||||
|
} else {
|
||||||
|
T2C_Send.player(player, Languages.VALUES.guiNotFound.getValue().toString());
|
||||||
|
T2C_Send.error(Main.getPlugin(), "");
|
||||||
|
T2C_Send.console(Util.getPrefix()+ " <red>The gui <gold>[gui]</gold> that the player <gold>[player]</gold> wanted to open does not exist!".replace("[gui]", Config.VALUES.defaultGUI.getValue().toString()).replace("[player]", player.getName())); //todo in lang
|
||||||
|
T2C_Send.error(Main.getPlugin(), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void gui(Player player, String arg) {
|
public static void gui(Player player, String arg) {
|
||||||
if (Main.guiHashMap.containsKey(arg)) {
|
Gui gui = Main.guiHashMap.get(arg);
|
||||||
Gui gui = Main.guiHashMap.get(arg);
|
if (gui == null) {
|
||||||
if (gui.guiEnable || player.hasPermission("commandgui.bypass")) {
|
T2C_Send.player(player, Languages.VALUES.guiNotFound.getValue().toString());
|
||||||
if (!gui.commandPermissionEnable || player.hasPermission("commandgui.command." + gui.key) || player.hasPermission("commandgui.bypass")) {
|
T2C_Send.error(Main.getPlugin(), "");
|
||||||
OpenGUI.openGUI(player, arg, true);
|
T2C_Send.console(Util.getPrefix()+ " <red>The gui <gold>[gui]</gold> that the player <gold>[player]</gold> wanted to open does not exist!".replace("[gui]", arg).replace("[player]", player.getName())); //todo in lang
|
||||||
} else T2C_Send.player(player, Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui " + gui.key)
|
T2C_Send.error(Main.getPlugin(), "");
|
||||||
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
|
return;
|
||||||
} else T2C_Send.player(player, Languages.VALUES.GUIIsDisabled.getValue().toString().replace("[gui]", gui.key));
|
}
|
||||||
} else T2C_Send.player(player, Languages.VALUES.guiNotFound);
|
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 T2C_Send.player(player, Languages.VALUES.NoPermissionForCommand.getValue().toString().replace("[cmd]", "/commandgui " + gui.key)
|
||||||
|
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
|
||||||
|
} else T2C_Send.player(player, Languages.VALUES.GUIIsDisabled.getValue().toString().replace("[gui]", gui.key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,15 @@ public class OpenGUI {
|
|||||||
private static final String prefix = Util.getPrefix();
|
private static final String prefix = Util.getPrefix();
|
||||||
|
|
||||||
public static void openGUI(Player player, String guiString, Boolean sound) {
|
public static void openGUI(Player player, String guiString, Boolean sound) {
|
||||||
|
if (!Main.guiHashMap.containsKey(guiString)) {
|
||||||
|
T2C_Send.player(player, Languages.VALUES.guiNotFound.getValue().toString());
|
||||||
|
T2C_Send.error(Main.getPlugin(), "");
|
||||||
|
T2C_Send.console(Util.getPrefix() + " <red>The gui <gold>[gui]</gold> that the player <gold>[player]</gold> wanted to open does not exist!".replace("[gui]", guiString).replace("[player]", player.getName()));
|
||||||
|
T2C_Send.error(Main.getPlugin(), "");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Gui gui = Main.guiHashMap.get(guiString);
|
Gui gui = Main.guiHashMap.get(guiString);
|
||||||
|
|
||||||
long long_ = System.currentTimeMillis();
|
long long_ = System.currentTimeMillis();
|
||||||
switch (guiString) {
|
switch (guiString) {
|
||||||
//case "plugin.PlotSquaredGUI":
|
//case "plugin.PlotSquaredGUI":
|
||||||
|
@ -34,7 +34,7 @@ public class Util {
|
|||||||
private static final String spigot = "https://www.spigotmc.org/resources/" + getSpigotID();
|
private static final String spigot = "https://www.spigotmc.org/resources/" + getSpigotID();
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
private static String discord;
|
private static final String discord = "http://dc.t2code.net";
|
||||||
|
|
||||||
public static String[] getConfigLogo() {
|
public static String[] getConfigLogo() {
|
||||||
ArrayList<String> arrayList = new ArrayList<>(T2C_Util.getConfigT2CodeLogo());
|
ArrayList<String> arrayList = new ArrayList<>(T2C_Util.getConfigT2CodeLogo());
|
||||||
@ -42,10 +42,6 @@ public class Util {
|
|||||||
return arrayList.toArray(new String[0]);
|
return arrayList.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void load() {
|
|
||||||
discord = T2C_Util.getDiscord();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void replace(T2C_ConfigItem item) {
|
public static void replace(T2C_ConfigItem item) {
|
||||||
if (item.getValue() instanceof List) {
|
if (item.getValue() instanceof List) {
|
||||||
item.setValue(T2C_Replace.replace(Config.VALUES.prefix.getValue().toString(), (List<String>) item.getValue()));
|
item.setValue(T2C_Replace.replace(Config.VALUES.prefix.getValue().toString(), (List<String>) item.getValue()));
|
||||||
|
Loading…
Reference in New Issue
Block a user