FROM_ANOTHER_COMMAND and delaytimer issues #213


  • Defect
Open
  • voigtman created this issue Jul 17, 2020

    In the following command situations I am seeing issues -
    NOTE: this affects multiple commands called at once from a single primary command. 

    First, Any command with a delaytimer that calls up other commands is returned with errors from the called commands.
    1 - If the command is TEXT created in mycommand you get an error - if you specify the error message, the color is not rendered.

    2 - If the command calls up any other kind of command you get:
    "this command can only be performed by another command" and the command is not performed.

    Secondly, if you remove the delaytimer and run the same commands you are returned with Text as expected but again the second scenario is the same. It would seem you cannot call up another command that specifies FROM_ANOTHER_COMMAND no matter what (unless that command is the only thing called, in which case the primary command is merely an alias)

    Servers tested on: Spigot: 1.16.1
    paper 1.16.1 Builds 33 - 91

     

    MyCMD version v5.6.6

     

    # Test 1 
    test1:
      command: /test1
      type: RUN_COMMAND
      runcmd:
      - /test1a
      - /test1b
      error-message: '&cThis is an Error'
      register: true #doesn't matter
      permission-required: true
      permission-node: mycmd.player
      permission-error: '&cYou do not have the perms for this test.'
    
    test1a:
      command: /test1a
      type: TEXT
      execute_mode: FROM_ANOTHER_COMMAND
      text:
      - "&7&oThis is a test, this is only a test"
      error-message: "&cThis is also an Error"
      permission-required: true
      permission-node: mycmd.player
    
    test1b:
      command: /test1b
      type: RUN_COMMAND
      execute_mode: FROM_ANOTHER_COMMAND
      runcmd:
      - /home
      permission-required: true
      permission-node: mycmd.player
    
    
    #Test 2 include delay timer
    test2:
      command: /test2
      type: RUN_COMMAND
      runcmd:
      - $delay$
      - /test2a
      - /test2b
      delaytimer: 1
      error-message: '&cThis is an Error'
      register: true #doesn't matter
      permission-required: true
      permission-node: mycmd.player
      permission-error: '&cYou do not have the perms for this test.'
    
    test2a:
      command: /test2a
      type: TEXT
      execute_mode: FROM_ANOTHER_COMMAND
      text:
      - "&7&oThis is a test, this is only a test"
      error-message: "&cThis is also an Error"
      permission-required: true
      permission-node: mycmd.player
    
    test2b:
      command: /test2b
      type: RUN_COMMAND
      execute_mode: FROM_ANOTHER_COMMAND
      runcmd:
      - /home
      permission-required: true
      permission-node: mycmd.player

     

  • voigtman added a tag Defect Jul 17, 2020
  • ivanfromitaly posted a comment Jul 18, 2020

    You can concatenate the commands, and move /test1b inside test1a. Anyway, i'll see if i can do something, but i guess once the the command is executed, the nextone doesn't have the "permission" anymore, i should carry the "allow that" to the next command ecc.

     

    About the error message, strange, i'll fix that whatever it is.

  • voigtman posted a comment Jul 18, 2020

    Thank you very much for the quick response,
    I should note this is incredibly simplified. I had built a large section of command sequences a few years ago based on permissions to seamlessly link various plugins into a fluid interaction for the player. Some of the commands all linked together need to be run either from console or as operator and some can be issued from the player as well.


    Additionally, in a command such as the one below, the $multiargs will drop the first word typed into it. So if you type:
    "/btest ivanfromitaly thank you for this amazing plugin."
    You'll see:
    [BROADCAST] Hey, ivanfromitaly!
    [BROADCAST] you for this amazing plugin. - voigtman

    And it doesn't matter if you type "thank thank thank thank you..." it'll drop the first word no matter how many times it's repeated and jump to the second word. 

     

    broadcast_example:
      command: /btest
      type: BROADCAST_TEXT
      text:
      - '&0Hey, $arg1!'
      - '&6$multiargs &f&o- $player'
      required_args: 1  
      error-message: '&cNot enough Information! &fUse "&b/btest playerName message&f" to broadcase your message.'
      permission-required: false
      permission-node: mycmd.player

     

     


To post a comment, please login or register a new account.