public static Optional < CommandResource > createCommandResource ( Identification provider , String command , Capabilities capabilities , Context context ) { CommandResource commandResource = new CommandResource ( provider , command , capabilities ) ; if ( ! verifyCommand ( command ) ) { context . getLogger ( ) . error ( "IllegalCommand!" ) ; return Optional . empty ( ) ; } if ( ! verifyCapabilities ( command , capabilities ) ) { context . getLogger ( ) . error ( "Player is not able to handle Command!" ) ; return Optional . empty ( ) ; } return Optional . of ( commandResource ) ; }
creates a new Resource .