2.3.3

Details

  • Filename
    TacoAPI.jar
  • Uploaded by
  • Uploaded
    Aug 22, 2013
  • Size
    128.28 KB
  • Downloads
    700
  • MD5
    fa72ebe0e4989381d148931bbffde51c

Supported Bukkit Versions

  • CB 1.6.2-R0.1

Changelog

!!!!!THIS UPDATE IS NOT MANDATORY BUT YOU SHOULD TOTALLY UPDATE CAUSE IT MAKES YOUR LIFE EASIER!!!!!

  • + Added PlayerStatsSerialization using built-in JSON (org.json, not the built-in JSON from bukkit)
  • + Added a system in command handlers that checks if a player has override permissions (see below)
  • + Added a PermissionAPI to test this as well.

Override Permissions

Some plugins allow you to put a star/asterisk (*) at the end of some permissions to say that the player has all permissions in a certain group. TacoAPI makes this incredibly easy. Be aware that this only applies to plugins the use the TacoCommandHandler class to handle commands.

I'm going to take Mineopoly for example. There are two major groups, Mineopoly.general.<permission> for general user commands, and Mineopoly.admin.<permission> for some admin commands. However, typing all of those permissions can be time-consuming. Especially if you want to give all those permissions in that group to a player.

Let's say you want to give a player all the 'general' permissions. Instead of typing out all those permissions (or copy/paste), you can give them:

Mineopoly.general.*

And now they have all the 'general' permissions! Giving a player all admin permission is the same thing:

Mineopoly.admin.*

However, let's say you're an admin, and you want all the admin permissions and all the general permissions. Instead of giving yourself two permissions:

Mineopoly.general.*
Mineopoly.admin.*

You can instead use:

Mineopoly.*

Which would basically give you all permissions within Mineopoly.

How this Works

When the command handler finds that a user doesn't have a certain permission, it recursively works backwards to find the appropriate override permission (or 'star' permission).

For example, let's say a plugin requires the permission Plugin.example.parent.child to run a command. The command handler will then check if the player has any of the following permissions:

  • Plugin.example.parent.child
  • Plugin.example.parent.*
  • Plugin.example.*
  • Plugin.*

If the player has any one of those permissions, that means they have permission to run the command, even if they may not have the longer version of the permission.

If the player does not have any of the permissions listed above, then they do not have permission to run the command.