Updating A Plugin, Need help with Permissions

Discussion in 'Plugin Development' started by hazik666, May 6, 2012.

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

    hazik666

    Hi,

    Well I am an admin on a server, and we had a plugin a long time ago that we want back now, the problem is that it is outdated, so I am just updating it to the newest version of Bukkit, I have some knowledge of Java so I sort of know what I am doing, but I keep getting an error with permissions and I know what it is I just need the reference library for PermissionsEx so the plugin doesn't get errors like this:

    http://puu.sh/tjId

    But I have no clue where to find it, so that's why I posted here, just wondering if anyone can help me out.

    Also getting a problem with Bukkit config, here is the error:

    http://puu.sh/tjJQ

    Seems to be affecting a lot of the plugin, may be a simple fix but this is my first time looking at plugin's.

    I may have problems later but I think they will just be some terms but if I do I would be grateful if anyone can help me out.

    Thanks,
    hazik666.

    PS: If anyone is wondering what plugin I am updating it is the Paintball one.
     
  2. Offline

    JPie

    Your working in eclipse correct? Just add the pex jar as an external jar, the one in your plugins folder should work
     
  3. Offline

    hazik666

    Added it in, but I think its because the plugin ran off the original permissions, so it only has the imports from them but I have no idea to make it work with a different version of permissions (PermissionsEx).

    The code below is what I have for the permissions

    Code:
    import com.nijiko.permissions.PermissionHandler;
    import com.nijikokun.bukkit.Permissions.Permissions;
     
     
    public class pb extends JavaPlugin {
       
        private final pbe entitylistener = new pbe(this);
        private final pbp playerlistener = new pbp(this);
     
        //UsePermissions? Lets find out!
        private boolean UsePermissions;
        public static PermissionHandler Permissions;
        private void setupPermissions() {
            Plugin test = this.getServer().getPluginManager().getPlugin("Permissions");
            if (this.Permissions == null) {
                if (test != null) {
                    UsePermissions = true;
                    this.Permissions = ((Permissions) test).getHandler();
                    System.out.println("[Paintball] Permissions system detected!");
                } else {
                    log.info("[Paintball] Permission system not detected, defaulting to OP");
                    UsePermissions = false;
                }
            }
        }
    So basically I want it to be PermissionsEx, and not the original by Nijikokun, any idea how?

    Anyone able to help, would really appreciate it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  4. Offline

    MCForger

    run it through vault. It adds permissions and iconomy support.
     
  5. Offline

    hazik666

    Adding permissions isn't my problem, the problem is that the plugin already has it but its an older version, so how do I remove the older version and replace it?
     
  6. Offline

    MCForger

    oh is it the old way? I can take a look at the code.
     
  7. Offline

    hazik666

    Code:
    import com.nijiko.permissions.PermissionHandler;
    import com.nijikokun.bukkit.Permissions.Permissions;
     
     
    public class pb extends JavaPlugin {
     
    private final pbe entitylistener = new pbe(this);
    private final pbp playerlistener = new pbp(this);
     
    //UsePermissions? Lets find out!
    private boolean UsePermissions;
    public static PermissionHandler Permissions;
    private void setupPermissions() {
       Plugin test = this.getServer().getPluginManager().getPlugin("Permissions");
       if (this.Permissions == null) {
           if (test != null) {
               UsePermissions = true;
               this.Permissions = ((Permissions) test).getHandler();
               System.out.println("[Paintball] Permissions system detected!");
           } else {
               log.info("[Paintball] Permission system not detected, defaulting to OP");
               UsePermissions = false;
           }
       }
    }
     
    public pbe ent = new pbe(this);
     
        public boolean canUseSet(Player p) {
            if (UsePermissions) {
                return this.Permissions.has(p, "paintball.commands");
            }
            return p.isOp();
        }
    
    Still need help, any help would be appreciated.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
Thread Status:
Not open for further replies.

Share This Page