Giter Site home page Giter Site logo

powerfulpermsapi's Introduction

PowerfulPerms API

Release

API for Spigot plugin PowerfulPerms. This API works on both BungeeCord and Spigot.

<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

<dependencies>
	<dependency>
		<groupId>com.github.CheeseSoftware</groupId>
		<artifactId>PowerfulPermsAPI</artifactId>
		<version>1.4.0</version>
		<scope>provided</scope>
	</dependency>
</dependencies>

Example of how to use:

final PowerfulPermsPlugin plugin = (PowerfulPermsPlugin) Bukkit.getPluginManager().getPlugin("PowerfulPerms");
PermissionManager permissionManager = plugin.getPermissionManager();

// Add permission to player. There are more optional parameters such as server, world and expiry date.
final ListenableFuture<Response> future = permissionManager.addPlayerPermission(uuid, "some.permission");
future.addListener(new Runnable() {

    @Override
    public void run() {
        // This function is run when the action is finished. You can also change the executor so that it executes in the thread you want.
        // There is a boolean to tell you if the action succeeded or not, there is also a string response.
        boolean result = future.get().succeeded();
        if (!result)
            plugin.getLogger().severe("Could not add player permission. " + future.get().getResponse());
    }

}, MoreExecutors.sameThreadExecutor());

// Get prefix of an online/offline player.
// This time you will use a ResultRunnable with template for the returned data.
final ListenableFuture<String> future = permissionManager.getPlayerPrefix(uuid);
future.addListener(new Runnable() {

    @Override
    public void run() {
        // This function is run when the action is finished.
        // The prefix is in the variable called "result"
        String prefix = future.get();
    }

}, MoreExecutors.sameThreadExecutor());

// Get an online player.
// Will be null if the player isn't online.
// This is simpler to use since there are no callbacks involved.
PermissionPlayer permissionPlayer = permissionManager.getPermissionPlayer(uuid);

// Get the prefix for a specific ladder from the online player.
String staffPrefix = permissionPlayer.getPrefix("staff");

// Get the prefix for the default ladder, if the player has his own prefix set it returns that instead.
String prefix = permissionPlayer.getPrefix();

// Get the player's own prefix.
String ownPrefix = permissionPlayer.getOwnPrefix();    

powerfulpermsapi's People

Contributors

gustav9797 avatar chris54721 avatar rowdyrotifer avatar

Stargazers

Sebastian Binder avatar Matthew Hogan avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Sebastian Binder avatar  avatar  avatar

powerfulpermsapi's Issues

BungeeCord Postlogin Event (Issue)

I had some listener which promotes players on postlogin event.
For some reasons p.haspermission always was false.
I think thats was caused that you load cached data on EventPriority.LOW which was the same as my listener. Maybe you should load data on Byte.MIN_VALUE

Publish the API on a maven repository

Hi,

Having the plugin published to an external maven repository would make it much more convenient when including it as an dependency for a maven project.

Something like oss.sonatype.org would be great, if not, spigot or another existing Minecraft related repository could work. Even a repo just for this would be better than nothing.

Thanks!

Command setgroup

I would be very nice if you can add a command that sets the group. (Delete all other groups).

Thanks

Unable to Download or Register

05.05 12:24:23 [Server] INFO Dark_Potato23 issued server command: /papi reload
05.05 12:24:23 [Server] INFO Successfully registered expansion: player
05.05 12:24:23 [Server] ERROR Failed to load placeholder expansion from class: com.github.gustav9797.PowerfulPermsPlaceholderAPIExpansion.PowerfulPermsPlaceholderAPIExpansion
05.05 12:24:23 [Server] ERROR com/github/gustav9797/PowerfulPermsAPI/PowerfulPermsPlugin
05.05 12:24:28 [Server] INFO โ™‚ {powerfulperms_prefix} Dark_Potato23 ยป .

Feature Requests

Edited to Amend Already Implemented Features

  • A command to add a group to all existing users, if they already have it, do nothing.
  • A placeholder that functions similarly to;
    '{powerfulperms_firstprefix_<ladder 1><ladder 2><ladder 3 etc>}'
    but would instead be;
    '{powerfulperms_prefixes_<ladder 1><ladder 2><ladder 3 etc>}'
    This would display ALL prefixes of the defined groups instead of just the first one. For example, '{powerfulperms_prefixes_Donator_Default}' would show as http://prntscr.com/dt8flv
    This would eliminate the need to use a heck of a lot of placeholders on servers with lots of ranks.

CaseInsensitive World and Server permissions

Currently permissions have to have the correct case for server and world names.
May you can add caseinsensitive for this.

Hopefully you understand what i mean.

essentials.fly main newfreebuild (does not work)
essentials.fly main NewFreebuild (does work)

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.