Jump to content

[1.6.4] Use permissions by forge


Try4W

Recommended Posts

Good time of day!

 

I wanna give access to some right click by item if player have permission like -dc.useTools. How i can use permissions from plugin by forge?

In CustomNPCs source code i found one class and interface, but i don't understand, how it works.

 

package noppes.npcs.permissions;

import noppes.npcs.permissions.PermissionsInterface;

public class CustomNpcsPermissions implements PermissionsInterface {

   public static PermissionsInterface Instance = new CustomNpcsPermissions();
   private static final String[] permissions = new String[]{"-customnpcs.*"};


   public boolean hasPermission(String username, String permission) {
      return true;
   }

}

 

package noppes.npcs.permissions;


public interface PermissionsInterface {

   boolean hasPermission(String var1, String var2);
}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.