Roles v2.0.1

Roles (re-coded) The user-driven group selection plugin.

(originally created by AnjoCaido on this thread)

Roles - The user-driven group selection plugin.

version 2.0

I AM RECREATING THIS PLUGIN...AGAIN...BECAUSE OF A MASSIVE MESS OF CODES OF THE PLUGIN
I MEAN BY MESS IS BECAUSE THE ALL THE CODES ARE IN JUST IN ONE CLASS, SO ITS MESSY TO READ...AND IF ITS MESSY TO READ,
IT WILL BE HARD TO SEE WHERE THE ERRORS OR BUGS ARE...SO I WILL BE RECREATING THIS...AND MORE, I WILL ADD GUIs.
SO YOU DONT HAVE TO TYPE THE COMMANDS...JUST JOIN A ROLES "and" GROUPS BY A DISPLAY...JUST USE A COMMAND TO POP UP THE DISPLAY...THIS WOULD TAKE DAYS...AS I HAVE TO LEARN FIRST HOW GUIs WORK...SO WISH ME LUCK
oh and feel free to comments some suggesstions for this plugin...i might add it here if i can do it...thx


NOTE: Please read this first


As you all know, or not, i don't have my own server, and haven't played Minecaft for months. And I also don't have the time to get my server public, because I'm pretty busy studying java(still a noob) and creating some simple plugins from plugin requests in bukkit site. So, as i don't have the time to test this myself, I need testers. Test this plugin first please and if there's a problem or a bug, post a comment in here or submit a TICKET by clicking the button on the upper right corner of this page. THANKS all.


Main


FIRST of all, THIS plugin does not support GroupManager anymore. But if u really like GM, i could look into it too and update it myself. But that will be more harder than this cause I think i have to learn more advance programming, and learn how superperms work. But(xD, lots of buts), it will widen my knowledge of java too, so its all good.
SECOND , as i said earlier, GM support is gone. I guess your thinking what permission THIS plugin supports now huh? The answer to that is PermissionsEx also known as PEX. And because of the great turn of this plugin, migrating the Roles plugin from GM support to PEX support is really hard(hard for me, easy for advance devs). That is why I'm forced to RE-CODE it all and start from scratch. And for the second time, as i said earlier, this is why i need testers. Testers should have many users in their server and willing to test this plugin. The many the users, the more bugs and problems will be known, the more work for me...xD
THIRD , ah. there is not even a third. This was the reason why I'm looking for plugin requests in bukkit forums. I need ideas. I cant think of any ideas so give me ideas on a plugin. Or what do you want me to add on this plugin.
FOURTH , do not worry...this is the last. I will say this in advance, sorry for my bad English. Apparently my first and main language is not English, so please do not criticize me, and just try to understand what I'm saying. Or just tell me that you do not understand what i said, and I will try to make it more clearer the next time.


INFOsNsTUFF


most of the stuff here are from the original thread of AnjoCaido

Roles

Roles, in my understanding, basically, is a plugin that let users choose their own groups, i mean roles. But(uh oh, buts are coming), there is more to it than choosing roles and groups. Users can choose there roles such as:factions, jobs, skills and etc. These roles are the core of the plugin. With these roles, you can choose any groups within the role. Also, the time limit, our old friend. This time limit is to stop users to join or leave a group all the time. They have to wait until the specified cool-down has come down to 0. That time limit is configurable. make it a lifetime...lol... And last but not the least, hmmm...i think that is it. Tell me if i left out something and i will see to it.

Commands

(nothing changed here)

commands:
  joinrole:
    description: Join a role of your choice.
    permission: roles.joinrole
    usage: |
      /<command> [category] [group]
  leaverole:
    description: Leave a role of your choice.
    permissions: roles.leaverole
    usage: |
      /<command> [category] [group]
  myroles:
    description: List roles you have.
    permissions: roles.myroles
    usage: |
      /<command> [category]
  whoroles:
    description: List somebody else roles.
    permissions: roles.whoroles
    usage: |
      /<command> <player> [group]
  roles:
    description: Reload Roles configuration.
    permissions: roles.roles
    usage: |
      /<command>

Config file

(nothing changed here too)

world:
    categories:
        faction:
            limit: 1
            time: 168
        job:
            limit: 1
            time: 24
        subjob:
            limit: 2
            time: 12
        skill:
            limit: 4
            time: 1
    setting:
        defaultgroup: Peasant
        maincategory: faction
  • world is the world name. This plugin respects GM mirroring, so the name of the world must be the the same of the real world which you have data on GroupManager.
  • faction,job,subjob,skill are the categories that you use on group specification. You can create as many as you want like that.(use always lower case, please)
  • limit is the quantity of roles of that category each user can join in. subjob is 2, so everyuser can join in two subjobs role.
  • time is the amount of time, in hours, a player need to wait before leaving a group that he joined of such category. The usual is the bigger the role, the bigger the time. No need to explain that.
  • maincategory You can optionally set a category for users to choose their main groups. When a group change a role of main category, he will have his prefix, suffix, build and other variables affected, just like he get physically changed groups(instead of subgrouping).
  • defaultgroup will tell Roles to which group should take a user if he leaves a group of the main category. So if you leave your faction, you will be redirected to Peasant group. No need for this if you don't use main category.

now for the big change, or rather small, nah i think its big.

the GROUPS file

because we changed from GroupManager to PermissionsEx, we need to use the PEX groups. For every groups in PEX yaml, there is a special node where we put our own Roles variable.

These following nodes go inside the OPTIONS node for every group you wanna set as a Role:

  • rolesCategory: faction - Type accepted: String - Explanation: this is setting a group for a role called faction.
  • rolesRequirement: Miner - Type accepted: List/String - Explanation: this telling you that for you to join this role, you must have joined a role(group) called Miner.

Every entry of the list is considered a full requirement, so you just need to fulfill one of the requirements to be able to join.
Example:

rolesRequirement:
  - BlueFaction
  - RedFaction

To enforce multiple roles as requirement, you put role names in same entry separated by the character '&', just like this:

rolesRequirement: Fighter&SuperCart

Example of permissions.yml file on PermissionsEx, using Roles:

groups:
  default:
    default: true
    permissions:
    - essentials.help
    - essentials.home
    - essentials.motd
    - essentials.sethome
    - essentials.spawn
  SemiAdmin:
    default: false
    permissions:
    - some.permissions
    inheritance:
    - moderator
    options:
      tes.tes: '100500'
  RedFaction:
    default: false
    permissions: []
    inheritance:
    - peasant
    options:
      roles-category: faction
  Farmer:
    default: false
    permissions:
    - essentials.kit
    - essentials.kit.farmer
    - essentials.spawnmob
    inheritance: []
    options:
      roles-requirement:
      - BlueFaction
      - RedFaction
      roles-category: job
  Healer:
    default: false
    permissions:
    - essentials.kit
    - essentials.kit.healer
    - essentials.heal
    inheritance: []
    options:
      roles-requirement:
      - BlueFaction
      - RedFaction
      roles-category: job
  Fighter:
    default: false
    permissions:
    - essentials.kit
    - essentials.kit.fighter
    inheritance: []
    options:
      roles-category: skill
  Admin:
    default: false
    permissions:
    - '*'
    inheritance:
    - semiadmin
    options: []
  Miner:
    default: false
    permissions:
    - essentials.kit
    - essentials.kit.miner
    - flashlight.regular
    inheritance: []
    options:
      roles-requirement:
      - BlueFaction
      - RedFaction
      roles-category: job
  FlyingMan:
    default: false
    permissions:
    - nocheat.moving
    inheritance: []
    options:
      roles-requirement: Fighter&SuperCart
      roles-category: skill
  Peasant:
    default: false
    permissions:
    - roles.joinrole
    - roles.leaverole
    - roles.myroles
    inheritance:
    - default
    options: []
  BlueFaction:
    default: false
    permissions: []
    inheritance:
    - peasant
    options:
      roles-category: faction
  Railer:
    default: false
    permissions:
    - essentials.kit
    - essentials.kit.railer
    inheritance: []
    options:
      roles-requirement: Miner
      roles-category: subjob
  SuperCart:
    default: false
    permissions:
    - minecartmania.*
    inheritance: []
    options:
      roles-requirement: Railer
      roles-category: skill
  Moderator:
    default: false
    permissions:
    - essentials.tp
    - essentials.tphere
    - essentials.item
    - essentials.give
    inheritance:
    - default
    options: []

TO-DOS

  • If requested, I will try to update GroupManager and hook it in this plugin
  • Add in-game commands to auto add rolesCategory and rolesRequirement in PEX permissions.yml
  • Add in-game commands to configure config.yml like add categories, change limit of the roles or time limit
  • GUIs
  • (open for ideas, as long as i can make it...xD)

To Download Plugin, Press the Download button on the top right corner

Source is coming soon


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    31608
  • Created
    Aug 29, 2011
  • Last Released File
    Aug 31, 2011
  • Total Downloads
    3,329
  • License

Categories

Members

Recent Files

No files uploaded yet.