File tree Expand file tree Collapse file tree
src/main/java/dev/loat/command/sub_command Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ public final class Cleanup extends Command {
1212 public static final String COMMAND = "cleanup" ;
1313
1414 public static int execute (CommandContext <CommandSourceStack > context ) {
15- Logger .info ("Running cleanup process" );
15+ String playerName = context .getSource ().getTextName ();
16+
17+ Logger .info ("[%s] Running cleanup process" .formatted (playerName ));
1618
1719 Cleanup .sendSuccess (context , () -> Component .literal ("/backup cleanup" ));
1820
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ public final class Create extends Command {
1515
1616 @ SuppressWarnings ("null" )
1717 public static int execute (CommandContext <CommandSourceStack > context ) {
18+ String playerName = context .getSource ().getTextName ();
1819 String comment ;
19- String playerName = context .getSource ().getPlayer ().getName ().getString ();
2020
2121 if (Create .hasArgument (context , Create .ARGUMENT )) {
2222 comment = StringArgumentType .getString (context , Create .ARGUMENT );
Original file line number Diff line number Diff line change @@ -16,9 +16,10 @@ public final class Delete extends Command {
1616
1717 @ SuppressWarnings ("null" )
1818 public static int execute (CommandContext <CommandSourceStack > context ) {
19+ String playerName = context .getSource ().getTextName ();
1920 String name = StringArgumentType .getString (context , Restore .ARGUMENT );
2021
21- Logger .info ("Deleting existing backup \" %s\" " .formatted (name ));
22+ Logger .info ("[%s] Deleting existing backup \" %s\" " .formatted (playerName , name ));
2223
2324 Delete .sendSuccess (context , () -> Component .literal ("/backup delete \" %s\" " .formatted (name )));
2425 return 1 ;
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ public final class Help extends Command {
1212 public static final String COMMAND = "help" ;
1313
1414 public static int execute (CommandContext <CommandSourceStack > context ) {
15- Logger .info ("Getting help" );
15+ String playerName = context .getSource ().getTextName ();
16+
17+ Logger .info ("[%s] Getting help" .formatted (playerName ));
1618
1719 Help .sendSuccess (context , () -> Component .literal ("/backup help" ));
1820 return 1 ;
Original file line number Diff line number Diff line change @@ -15,9 +15,10 @@ public final class Info extends Command {
1515
1616 @ SuppressWarnings ("null" )
1717 public static int execute (CommandContext <CommandSourceStack > context ) {
18+ String playerName = context .getSource ().getTextName ();
1819 String name = StringArgumentType .getString (context , Info .ARGUMENT );
1920
20- Logger .info ("Getting info about existing backup \" %s\" " .formatted (name ));
21+ Logger .info ("[%s] Getting info about existing backup \" %s\" " .formatted (playerName , name ));
2122
2223 Info .sendSuccess (context , () -> Component .literal ("/backup info \" %s\" " .formatted (name )));
2324 return 1 ;
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ public final class List extends Command {
1212 public static final String COMMAND = "list" ;
1313
1414 public static int execute (CommandContext <CommandSourceStack > context ) {
15- Logger .info ("Listing all backups" );
15+ String playerName = context .getSource ().getTextName ();
16+
17+ Logger .info ("[%s] Listing all backups" .formatted (playerName ));
1618
1719 List .sendSuccess (context , () -> Component .literal ("/backup list" ));
1820 return 1 ;
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ public final class Reload extends Command {
1313 public static final String COMMAND = "reload" ;
1414
1515 public static int execute (CommandContext <CommandSourceStack > context ) {
16- Logger .info ("Reloading config" );
16+ String playerName = context .getSource ().getTextName ();
17+
18+ Logger .info ("[%s] Reloading config" .formatted (playerName ));
1719
1820 ConfigManager .loadAll ();
1921
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public static final class Argument {
1919
2020 @ SuppressWarnings ("null" )
2121 public static int execute (CommandContext <CommandSourceStack > context ) {
22+ String playerName = context .getSource ().getTextName ();
2223 String name ;
2324
2425 if (Create .hasArgument (context , Restore .ARGUMENT )) {
@@ -27,7 +28,7 @@ public static int execute(CommandContext<CommandSourceStack> context) {
2728 name = Restore .Argument .LATEST ;
2829 }
2930
30- Logger .info ("Restoring existing backup \" %s\" " .formatted (name ));
31+ Logger .info ("[%s] Restoring existing backup \" %s\" " .formatted (playerName , name ));
3132
3233 Restore .sendSuccess (context , () -> Component .literal ("/backup restore \" %s\" " .formatted (name )));
3334 return 1 ;
You can’t perform that action at this time.
0 commit comments