55import org .allaymc .api .command .Command ;
66import org .allaymc .api .command .SenderType ;
77import org .allaymc .api .command .tree .CommandTree ;
8- import org .allaymc .api .permission .PermissionGroups ;
8+ import org .allaymc .api .permission .OpPermissionCalculator ;
99import org .allaymc .api .utils .TextFormat ;
1010
1111public class DaogeLabCommand extends Command {
1212
1313 public DaogeLabCommand () {
14- super ("dglab" , "DgLab main command" );
15- this . permissions . forEach ( PermissionGroups . MEMBER :: addPermission );
14+ super ("dglab" , "DgLab main command" , "dglab.command" );
15+ OpPermissionCalculator . NON_OP_PERMISSIONS . addAll ( this . permissions );
1616 }
1717
1818 @ Override
@@ -25,19 +25,19 @@ public void prepareCommandTree(CommandTree tree) {
2525 DaogeLab .INSTANCE .getConfig ().useHttps () ? "wss" : "ws" ,
2626 DaogeLab .INSTANCE .getConfig ().address (),
2727 DaogeLab .INSTANCE .getConfig ().publicPort (),
28- player .getLoginData ().getUuid ().toString ());
28+ player .getController (). getLoginData ().getUuid ().toString ());
2929 if (QRCodeUtils .showQRCode (player , qrText )) {
3030 player .sendTranslatable (TextFormat .YELLOW + "%daogelab:scan_qr_code" );
3131 return context .success ();
3232 }
3333
3434 return context .fail ();
35- }, SenderType .PLAYER )
35+ }, SenderType .ACTUAL_PLAYER )
3636 .root ()
3737 .key ("disconnect" )
3838 .exec ((context , player ) -> {
3939 QRCodeUtils .clearQRCode (player );
40- var connection = ConnectionManager .getByUUID (player .getLoginData ().getUuid ());
40+ var connection = ConnectionManager .getByUUID (player .getController (). getLoginData ().getUuid ());
4141 if (connection != null ) {
4242 connection .disconnect ();
4343 player .sendTranslatable (TextFormat .YELLOW + "%daogelab:disconnecting" );
@@ -46,7 +46,7 @@ public void prepareCommandTree(CommandTree tree) {
4646 player .sendTranslatable (TextFormat .RED + "%daogelab:not_connected" );
4747 return context .fail ();
4848 }
49- }, SenderType .PLAYER )
49+ }, SenderType .ACTUAL_PLAYER )
5050 .root ()
5151 .key ("switchmode" )
5252 .str ("modename" )
0 commit comments