Nodes (Permissions)

Discussion in 'Plugin Development' started by Zelnehlun, Mar 26, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Zelnehlun

    Hey,
    I am currently trying to do a Permissions support for my plugins. For the commands I used things like "if(cmd.getName().equalsIgnoreCase("setspawn")){". Now I read through the tutorial on how to use Permissions for my plugin. There it says something about these nodes and this "Some plugin authors use /command style for nodes, please do not do this.".
    I would appreciate your help on how I could make my plugins support Permissions:)
     
  2. Offline

    Edward Hand

  3. Offline

    Zelnehlun

    That was the page I found the stuff with the nodes on. My question is how I can create these nodes for the commands.
     
  4. Offline

    Crash

    You don't actually create the node anywhere, you can just do :
    permissions.getHandler().permission(<player>, "node path");

    For example if you wanted to check for setspawn
    Code:
    if(permissions.getHandler().permission(player, "spawnplugin.setspawn")){
    
        // Has the node
    
    } else {
    
        // Doesn't have the node
    
    }
    Then if you want your player or group or whatever to have the node just add this after permissions:
    in the <world name>.yml file
    Code:
    - 'spawnplugin.setspawn'
    
     
  5. Offline

    Zelnehlun

    Thanks for your help, I will take a look at it tomorrow :)
     
Thread Status:
Not open for further replies.

Share This Page