diff --git a/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/SudoCommand.java b/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/SudoCommand.java index 4e2e11652..57b3bbf86 100644 --- a/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/SudoCommand.java +++ b/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/SudoCommand.java @@ -12,6 +12,7 @@ import dev.rollczi.litecommands.annotations.join.Join; import dev.rollczi.litecommands.annotations.permission.Permission; import org.bukkit.Server; +import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @FeatureDocs(name = "Spy sudo", description = "Allows you to spy on other players' sudo commands execution, permission to spy: eternalcore.sudo.spy") @@ -32,7 +33,7 @@ class SudoCommand { @DescriptionDocs(description = "Execute command as console", arguments = "") void console(@Context Viewer viewer, @Join String command) { this.server.dispatchCommand(this.server.getConsoleSender(), command); - this.sendSudoSpy(viewer, command); + this.sendSudoSpy(viewer, this.server.getConsoleSender(), command); } @Execute @@ -40,14 +41,15 @@ void console(@Context Viewer viewer, @Join String command) { @DescriptionDocs(description = "Execute command as player", arguments = " ") void player(@Context Viewer viewer, @Arg Player target, @Join String command) { this.server.dispatchCommand(target, command); - this.sendSudoSpy(viewer, command); + this.sendSudoSpy(viewer, target, command); } - private void sendSudoSpy(Viewer viewer, String command) { + private void sendSudoSpy(Viewer viewer, CommandSender target, String command) { this.noticeService.create() .notice(translation -> translation.sudo().sudoMessage()) .placeholder("{COMMAND}", command) .placeholder("{PLAYER}", viewer.getName()) + .placeholder("{TARGET}", target.getName()) .viewer(viewer) .send(); @@ -57,6 +59,7 @@ private void sendSudoSpy(Viewer viewer, String command) { .notice(translation -> translation.sudo().sudoMessageSpy()) .placeholder("{COMMAND}", command) .placeholder("{PLAYER}", viewer.getName()) + .placeholder("{TARGET}", target.getName()) .player(player.getUniqueId()) .send()); } diff --git a/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/messages/ENSudoMessages.java b/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/messages/ENSudoMessages.java index 5466868e1..69476274e 100644 --- a/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/messages/ENSudoMessages.java +++ b/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/messages/ENSudoMessages.java @@ -10,9 +10,9 @@ @Accessors(fluent = true) @Contextual public class ENSudoMessages implements SudoMessages { - @Description({"# {PLAYER} - Player who executed the command, {COMMAND} - Command that the player executed"}) - public Notice sudoMessageSpy = - Notice.chat("[Sudo] {PLAYER} executed command: {COMMAND}"); - public Notice sudoMessage = - Notice.chat("You executed command: {COMMAND} on player: {PLAYER}"); + @Description({"# {PLAYER} - Player who executed the command, {TARGET} - Player or console on which the command was executed, {COMMAND} - Command"}) + public Notice sudoMessageSpy = Notice.chat("[Sudo] {PLAYER} executed command: {COMMAND} on: {TARGET}"); + + @Description({"# {TARGET} - Player or console on which the command was executed, {COMMAND} - Command"}) + public Notice sudoMessage = Notice.chat("You executed command: {COMMAND} on: {TARGET}"); } diff --git a/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/messages/PLSudoMessages.java b/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/messages/PLSudoMessages.java index 629f0b326..ad0290020 100644 --- a/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/messages/PLSudoMessages.java +++ b/eternalcore-core/src/main/java/com/eternalcode/core/feature/sudo/messages/PLSudoMessages.java @@ -10,9 +10,9 @@ @Accessors(fluent = true) @Contextual public class PLSudoMessages implements SudoMessages { - @Description({"# {PLAYER} - Gracz który wykonał komendę, {COMMAND} - Komenda, którą wykonał gracz"}) - public Notice sudoMessageSpy = - Notice.chat("[Sudo] {PLAYER} wykonał komendę: {COMMAND}"); - public Notice sudoMessage = - Notice.chat("Wykonałeś komendę: {COMMAND} na graczu: {PLAYER}"); + @Description({"# {PLAYER} - Gracz, który wykonał komendę, {TARGET} - Gracz lub konsola, na której wykonano komendę, {COMMAND} - Komenda"}) + public Notice sudoMessageSpy = Notice.chat("[Sudo] {PLAYER} wykonał komendę: {COMMAND} na: {TARGET}"); + + @Description({"# {TARGET} - Gracz lub konsola, na której wykonano komendę, {COMMAND} - Komenda"}) + public Notice sudoMessage = Notice.chat("Wykonałeś komendę: {COMMAND} na: {TARGET}"); }