Writing a Permissions plugin - hooking into Bukkit's Permissions

Discussion in 'Plugin Development' started by MarkehMe, Apr 3, 2014.

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


    Please read this thread first.

    So, I'm writing a Permissions plugin. Although, with this plugin permissions are changed depending on the area of the map you're in.

    Now I know you can use PermissionAttachment stuff and unset/set permissions. However, I don't want to have to do this every time a player moves (yuck). I only want to check the player location when .hasPermission is being called.

    So I thought of maybe overriding .hasPermission - but this doesn't seem healthy.. or is that OK? Can anyone suggest a way to override hasPermission without reflection?

    Is there an event called when .hasPermission is called? Or an alternative way to call my plugin's hasPermission?

    Any other suggestions on how to go about this?

    Thanks for your help.
  2. Offline


    MarkehMe I'm not sure why you'd want to write your own permissions plugin; just use Vault. Unless this is a practice project, or someone hired you to write their own permissions plugin. In the latter case, just tell them to use Vault; there's no reason you should have to write your own permissions plugin.
  3. Offline


    Maurdekye My plugin will also hook into vault. However, I want to add SuperPerms API. Not all plugins have support for Vault, some simply just use .hasPermission().

    If you read my description, my permissions plugin will allow or deny permissions depending on their location and other variables. That part is done however, the important part is adding support for the SuperPerms API.

    As a matter of fact, I've already made the permissions plugin - it's just these last things.
  4. Offline


    Hate to do this, but - bump.
  5. Offline


    Write a custom method that will call hasPermission() and then do whatever you want, and use that instead of hasPermission in your code.
  6. Offline


    I don't quite understand what you mean. How will that redirect calls from Bukkit's hasPermission to my hasPermission method?
  7. Offline


    Mark, you have to Zethariel if you want them to see your response.
    MarkehMe likes this.
  8. Offline


Thread Status:
Not open for further replies.

Share This Page