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) {
if (aliasObject.adminBungeeCommand) {
<<<<<<< Updated upstream
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
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 {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -325,9 +330,9 @@ public class ExecuteAlias {
}
} else {
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 {
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) {
if (aliasObject.adminBungeeCommand) {
<<<<<<< Updated upstream
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
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 {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -352,9 +362,9 @@ public class ExecuteAlias {
}
} else {
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 {
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) {
if (aliasObject.bungeeCommand) {
<<<<<<< Updated upstream
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
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 {
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.");
}
} else {
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 {
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) {
if (alias.bungeeCommand) {
<<<<<<< Updated upstream
if ((boolean) T2CLibConfig.VALUES.proxy.getValue()) {
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 {
T2Csend.console(Util.getPrefix() + " §4To use bungee commands, enable the Bungee option in the config.");
@ -443,9 +463,9 @@ public class ExecuteAlias {
}
} else {
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 {
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) {
return s.replace("[player]", player.getName());
return s.replace("[player]", player.getName()).replace("%player_name%",player.getName());
}
}