Update ExecuteAlias.java

This commit is contained in:
JaTiTV 2024-07-04 06:13:55 +02:00
parent f0b3b6e4fd
commit 5f6648c628

View File

@ -316,8 +316,13 @@ public class ExecuteAlias {
} }
for (String cmd : aliasObject.adminCommands) { for (String cmd : aliasObject.adminCommands) {
if (aliasObject.adminBungeeCommand) { if (aliasObject.adminBungeeCommand) {
<<<<<<< Updated upstream
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) { if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.adminCommandAsConsole); BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.adminCommandAsConsole);
=======
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.adminCommandAsConsole);
>>>>>>> Stashed changes
} else { } else {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -325,9 +330,9 @@ public class ExecuteAlias {
} }
} else { } else {
if (aliasObject.adminCommandAsConsole) { if (aliasObject.adminCommandAsConsole) {
T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias)); T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias));
} else { } else {
T2Ccmd.player(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias)); T2Ccmd.player(player, cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias));
} }
} }
} }
@ -343,8 +348,13 @@ public class ExecuteAlias {
} }
for (String cmd : aliasObject.adminCommands) { for (String cmd : aliasObject.adminCommands) {
if (aliasObject.adminBungeeCommand) { if (aliasObject.adminBungeeCommand) {
<<<<<<< Updated upstream
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) { if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.adminCommandAsConsole); BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.adminCommandAsConsole);
=======
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.adminCommandAsConsole);
>>>>>>> Stashed changes
} else { } else {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -352,9 +362,9 @@ public class ExecuteAlias {
} }
} else { } else {
if (aliasObject.adminCommandAsConsole) { if (aliasObject.adminCommandAsConsole) {
T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias)); T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias));
} else { } else {
T2Ccmd.player(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias)); T2Ccmd.player(player, cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias));
} }
} }
} }
@ -408,17 +418,22 @@ public class ExecuteAlias {
} }
for (String cmd : aliasObject.command) { for (String cmd : aliasObject.command) {
if (aliasObject.bungeeCommand) { if (aliasObject.bungeeCommand) {
<<<<<<< Updated upstream
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) { if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.commandAsConsole); BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.commandAsConsole);
=======
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias), aliasObject.commandAsConsole);
>>>>>>> Stashed changes
} else { } else {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
T2Csend.player(player, Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); T2Csend.player(player, Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
} }
} else { } else {
if (aliasObject.commandAsConsole) { if (aliasObject.commandAsConsole) {
T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias)); T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias));
} else { } else {
T2Ccmd.player(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt).replace("[alias]", alias)); T2Ccmd.player(player, cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt).replace("[alias]", alias));
} }
} }
} }
@ -434,8 +449,13 @@ public class ExecuteAlias {
} }
for (String cmd : alias.command) { for (String cmd : alias.command) {
if (alias.bungeeCommand) { if (alias.bungeeCommand) {
<<<<<<< Updated upstream
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) { if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt), alias.commandAsConsole); BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt), alias.commandAsConsole);
=======
if (T2CLibConfig.getBungee()) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt), alias.commandAsConsole);
>>>>>>> Stashed changes
} else { } else {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config."); T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -443,9 +463,9 @@ public class ExecuteAlias {
} }
} else { } else {
if (alias.commandAsConsole) { if (alias.commandAsConsole) {
T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); T2Ccmd.console(cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt));
} else { } else {
T2Ccmd.player(player, cmd.replace("[player]", player.getName()).replace("[target]", targetSt)); T2Ccmd.player(player, cmd.replace("[player]", player.getName()).replace("%player_name%",player.getName()).replace("[target]", targetSt));
} }
} }
} }
@ -492,6 +512,6 @@ public class ExecuteAlias {
} }
private static String replacePlayer(String s, Player player) { private static String replacePlayer(String s, Player player) {
return s.replace("[player]", player.getName()); return s.replace("[player]", player.getName()).replace("%player_name%",player.getName());
} }
} }