[FUN/ADMN] Professions v0.2.1 - Advance Group Selection Plugin [1060]

Discussion in 'Inactive/Unsupported Plugins' started by ArtemisTheSecond, Sep 3, 2011.

  1. Professions: A Group Selection Plugin
    Recommended Bukkit Build [1060]
    Version: 0.2.1
    Description: A very Simple but yet Advance Group Selection Plugin
    Inspired by: Roles by AnjoCaido
    Downloads: Professions.jar , Professions.zip
    Source: https://github.com/aRt3m1s/Professions
    this plugin uses the latest PermissionsEx...download it here
    this plugin needs iConomy...download it here

    Professions is a plugin that allows users to select there own groups, specifically the PEX permission groups. Before, this plugin is named Roles(orig. thread here) by AnjoCaido himself. Now, from Roles, it is renamed to Professions, because: one, the code itself is re-created from scratch, only yaml configs are a bit untouched . two, this project is still far from done. By the help of people, mostly by giving ideas, this project will climb its way up to the top. last, not the least, even though I'm still a beginner at java programming and has no knowledge of other programming languages other than java, i will devoting myself to this project until the end. Hope you all Like this.

    Features:
    • PermissionsEx support.
    • iConomy support. Joining and Leaving group will cost you some money.(configurable)
    • In-game settings.yml manipulation.
    • User's can change their own professions to some pre-made professions like: factions, jobs, subjobs, skills.
    • Time based leave, users cant leave the group right away. They have to wait for a couple of hours until they can leave. Joining is instant.
    • Multi-World support.
    • In-Game help, by Typing '/professions help' or '/p help'
    • In-Game help, by Typing '/settings help' or '/s help'
    • Permission for settings configuration is "professions.settings"
    Commands:




    commands (open)



    Settings.yml
    settings.yml (open)

    Code:
    
    world:
        professions:
            faction:
                limit: 1
                time: 192
                join-cost: 200.0
                leave-cost: 600.0
            job:
                limit: 1
                time: 48
                join-cost: 100.0
                leave-cost: 300.0
            subjob:
                limit: 2
                time: 12
                join-cost: 50.0
                leave-cost: 150.0
            skill:
                limit: 4
                time: 3
                join-cost: 25.0
                leave-cost: 75.0
    settings:
        default-limit: 999
        default-time: 0
        default-joincost: 0.0
        default-leavecost: 0.0
        enable-iConomy: true
    
    


    As you can see, i renamed config.yml to settings.yml, cause it sounds more appropriate. And i omitted the main-category and the default-group as i do not think we need that anymore. For some who does not know the stuffs in this yaml, here are some few explanation:
    (taken from AnjoCaido's Roles)

    world is the world name. This plugin respects PEX mirroring, so the name of the world must be the the same of the real world which you have data on PermissionsEx.
    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 subjobsrole.
    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.
    join-cost is the amount of money that will be subtracted to your holdings(the money in your hand, not you bank accounts money) every group join.
    leave-cost is the amount of money that will be subtracted to your holdings(the money in your hand, not you bank accounts money) every group leave.
    settings - this here is for settings.yml manipulation purposes only. This defaults will be created when u use the command addProfession.
    default-limit look at limit above.
    default-time look at time above.
    default-joincost look at join-cost above.
    default-leavecost look at leave-cost above
    • enable-iConomy enables or disables iConomy support

    and for the GROUPS
    we can find the groups in the permissions.yml of PermissionEx folder in plugins/
    heres an example:
    permissions.yml (open)


    Code:
    users:
        ViruSpreadeR:
            group:
            - Admin
    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:
                profession: faction
        Farmer:
            default: false
            permissions:
            - essentials.kit
            - essentials.kit.farmer
            - essentials.spawnmob
            inheritance: []
            options:
                profession-requirement: BlueFaction,RedFaction
                profession: job
        Healer:
            default: false
            permissions:
            - essentials.kit
            - essentials.kit.healer
            - essentials.heal
            inheritance: []
            options:
                profession-requirement: BlueFaction,RedFaction
                profession: job
        Fighter:
            default: false
            permissions:
            - essentials.kit
            - essentials.kit.fighter
            inheritance: []
            options:
                profession: skill
        Admin:
            default: false
            permissions:
            - '*'
            inheritance:
            - semiadmin
            options: []
        Miner:
            default: false
            permissions:
            - essentials.kit
            - essentials.kit.miner
            - flashlight.regular
            inheritance: []
            options:
                profession-requirement: BlueFaction,RedFaction
                profession: job
        FlyingMan:
            default: false
            permissions:
            - nocheat.moving
            inheritance: []
            options:
                profession-requirement: Fighter&SuperCart
                profession: skill
        Peasant:
            default: false
            permissions:
            - roles.joinrole
            - roles.leaverole
            - roles.myroles
            inheritance:
            - default
            options: []
        BlueFaction:
            default: false
            permissions: []
            inheritance:
            - peasant
            options:
                profession: faction
        Railer:
            default: false
            permissions:
            - essentials.kit
            - essentials.kit.railer
            inheritance: []
            options:
                profession-requirement: Miner
                profession: subjob
        SuperCart:
            default: false
            permissions:
            - minecartmania.*
            inheritance: []
            options:
                profession-requirement: Railer
                profession: skill
        Moderator:
            default: false
            permissions:
            - essentials.tp
            - essentials.tphere
            - essentials.item
            - essentials.give
            inheritance:
            - default
            options: []
    


    in these permissions.yml we need to put a special node for each groups or for the groups where you want to have Professions.

    these nodes GO into the OPTIONS node for every group you want to set as a Profession:
    profession: (String datatype) - in here goes your professions category like faction, subjob, job and skill.
    profession-requirement: (String datatype) - this node is a special one. This means to join this group you will need to have this groups also, aka requirement. And because PEX has not added multiple OPTIONS sub-datas, we will need to use the ','(or) and '&'(and) tokens. Let me give you an example:
    Code:
    groups:
        trainee:
            options:
                profession: subjob
                profession-requirement: BlackList&General,GlobalRisk&Commander
    
    this means that YOU can JOIN trainee group if you are in "BlackList AND General groups" OR if you are in "GlobalRisk AND Commander groups". GOT IT? if not...just post your problem.

    TO-DOS
    • make a separate professions for every permissions plugin that exists
    • i dunno , have idea? please post a reply
    oldChangeLogs (open)

    version 0.1.2​
    change /p me all command to just /p me​
    added /s help​
    fixed all exception errors​
    version 0.1.1​
    added commands to manipulate settings.yml in-game​
    fixed some error messages​
    version 0.1.01​
    added iConomy support​
    version 0.1.0​
    release of professions​


    this is the same as the Roles...all features of Roles is in this plugin
    the changes are just the commands
    and this has permissions now

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
    Terra-Network.org likes this.
  2. there is one thing that is bugging me with these SuperPerms...is the infos...what im talking about is the profession and the profession-requirement options like from PEX...i dont know how this will work

    :(...the permsBukkit doesnt have the options stuffs like PEX...im thinking how am i gonna see if a group has requirements and what profession it has

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  3. Hm i don't know how the permission system works, but maybe you can create a second config-file: "professions" where the admin has to configure the following things:

    [permission-groupname]
    ____[profession-type]
    ____[profession-requirements]
    (____ = 4 spaces ^^)

    And everytime a player want's to buy a permission-group, your plugin checks in which groups the player is and how the players groups match with the config-file. You know what i mean?
    If SuperPerms doesn't provide the "options"-part, you have to build it for your own inside a file.

    For me as an admin, it's not so much more work to do.
    Every group i create inside the permission-plugin, i create inside your plugin, too, with just these 2 options.

    Ah it's ok, i think i will try to manage all plugins with PEX. I mentioned, one of my important plugins is going to upgrade for PEX, too!
    So forget my question about SuperPerms ^^
     
  4. another problem is...SuperPerms is solely for checking permissions...which Professions lacks...only for professions.settings...and this plugin(Professions) is for user groupings based on the groups of a permissions plugin like PEX and permissionBukkit or bPermissions...so i guess i have to Check all the top used Permissions and try to support them with these plugin(Professions)
    and if i do this...the jar file will be bigger...and it will cause more lag than it supposed to be...so my only solution for this, is make a professions plugin for every top used permissions...
    and make a separate .jar for every permissions there is

    all im gonna need is the list of top used permissions and make a Professions plugin for each...xD

    i have a resolution...if thats how you call it
    i convinced myself that i will create a Professions for every permissions plugins that exists...this plugin has been only for PEX...but now, i will make it support all permissions plugin including bPerms and PermsBukkit...all i need is the list of all permissions that is used by people till now
    and to those who dont know Professions yet:
    Professions let user add their own groups (this groups can be found in your own Permissions plugin). This plugin is best on rpg servers. And for the sake of the normal servers, this plugin will only be able to add groups to users IF that specific group has a profession. This so called professions can be found in the settings.yml in the Professions folder after you started server with these plugin enabled(you can configure this pre-made professions and make new ones). Every group has only one profession(Example below). This Groups can also have requirements. In this requirements, you can only be added to that group IF you have the group requirement(see below example). The example means that if you are in (groupName1 AND groupName3) OR (groupName2), you can join groupName...if you dont have the requirements...then you cant join:
    (from the groups of your permissions OR from the TODO global professions.yml)
    Code:
    groupName
      <options/infos> // hint 1: check below
        profession: <someProfession>
        requirement:
          - groupName1&groupName3
          - groupName2
     
    hint 1: if your permissions plugin does not support this part...i will add a feature that creates a yml and auto add all Groups from your perms plugin and you only have to add what profession it will have and what group requirement it needs to have to be in that specific groups... this idea is from @terra-network-org...hmmm, infact lets make this global for all permissions...agree?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  5. I think this way of configuration will work well and it doesn't need a specific permission plugin and can work with permission Plugins without options part!
     
  6. Offline

    Thequickthinkin

    Don't bother with group manager (unless requested) it is outdated...
     
  7. Offline

    Thequickthinkin

    Everytime I join a group it says a internal error occured, however it still puts me into that group... It still lets me do everything that group does

    **Edit**: Why don't you bring in nodes for each command? I really liked that idea :)
     
  8. Pex errors...hasnt been updated to 1.8.1...im making plugins currently for all permissions that exists
     
  9. Offline

    Thequickthinkin

    I fixed the errors, (iConomy V.6 caused them) And I would really like the nodes for indivdual commands, I'd like people to register on my website Before being allowed to join groups.
     
  10. will do...i will release the jars and zips after i made the Professions for all permissions
     
  11. Offline

    Shereis

    I get an Error, when an Player try to join a profession in another world than the one is configurated for !
    Code:
    2011-09-24 03:31:36 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'p' in plugin Professions v0.2.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:129)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:320)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:713)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
        at org.getspout.spout.SpoutNetServerHandler.a(SpoutNetServerHandler.java:478)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NullPointerException
        at me.aRt3m1s.professions.Professions.onCommand(Professions.java:165)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 13 more
    I have many world and I think it would be better to have the possibility to have professions designed for all worlds ! Configurating each professions for each world is not so difficult, but it's making my permission file really messy ...! I haven't fully tested it yet, but it looks like players must buy profession again for the other worlds too.

    Another Issue, is that player can join a profession even if they don't have enough money ! Their balance then get to a negative value ! (anyway, it could be a feature, but a configuration file for that would be nice ! )
     
  12. yeah...i figured that might happen...so in this new professions i'm making, i'm gonna add a feature or command to add the pre-made professions for every world you have
     
  13. Offline

    Shereis

    nice ! I hope it will be available soon !
     
  14. Offline

    Thequickthinkin

    There is a slight flaw in the plugin: When someone joins a race, they are put in the group, however it doesn't show there in the group or put them properly into the group:
    Pex User:
    madsniper77:
    group:
    - Humans
    worlds:
    world:
    group:
    - Netherians
    There still in the 'humans' group not in the Netherians.
     
  15. u should leave the Humans group first...i think...thats not my plugins doing...thats the default group for your pex?
     
  16. Offline

    Thequickthinkin

    Right I will try to be as specific as possible, When I join a group I join the group 'sucessfully' However it does not put that as my main group, It has that as a group for that world, I go from the 'admin' group that is not the default group, This is what my user looks like:
    vvmattozzvv:
    group:
    - Admin
    worlds:
    world:
    group:
    - Admin
    - Hunter

    As you can see it does not change my group fully, and it also puts the 'Admin' group in the world specific group aswell. Then when doing the /professions me this shows up:
    Admin<=>No ProfesionS
    Hunter <=> Race
    Admin<=>No ProfesionS
    But I still only count as the admin group, I get the permissions from the hunter group tho,
    Im using RB: 1185 Pex: v1.13 and the latest of your plugin, There are no errors in my server log, this is the only thing that may be of interest to you:
    2011-09-24 16:20:26 [INFO] [P](null)<vvmattozzvv> me
    That is from executing the /professions me Command.

    Now when doing this from the default group it works because it has not oficially put me into a group
    groups:
    default:
    default: true
    permissions:
    - modifyworld.*
    test:
    inheritance:
    - default
    options:
    rank: '900'
    profession: faction
    users:
    vvmattozzvv:
    worlds:
    world:
    group:
    - test
    --------------------
    That is from my tests, What I expected to happen is this:
    users:
    vvmattozzvv:
    group:
    - test
     
  17. First of all, sorry guys if I am gonna take long. I only have a little time everyday to work on this, as i have work and school. But I think the plugin will be finished in 3 or 4 days. hmmm... for the meantime I will just say the changes for now.

    CHANGES:
    • add bPermission support
    • add PermissionsBukkit support
    • add permission nodes on each command
    • add Groups.yml or lets just say the <worldName>.yml for each world so u can have different professions in each world
    • add command to auto generate professions.yml(this is the settings.yml just renamed it to professions.yml) for every new world u have.
    • add command to auto generate groups.yml for every new world u have.
    • add feature to check the groups requirement...ROLES lacks this one, i think this would be needed as players in your server sometimes do not know what requirement he needs to join the group
    • hmmm...I think I have left something out, but it will be added in the change-logs when i released the plugin
    • and feel free to post some ideas or pm me, and i will try to add it in the Professions(oh and the name will be renamed to ProfessionsPlus cause i am recoding it and this plugin was supposed to be only for PEX from a request, i will add bPerms and PermsBukkit.. thats why i renamed it to ProfessionsPlus)

    this was not a problem of Professions, this was fixed on PEX...use the latest PEX found here

    oh and for the main and world group thing...cause this supports multiworld...u dont have to put a main group...it will all be in world: groups: groupName:

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

    Thequickthinkin

    Please re-add permissions;
    Like the nodes I mean,
    - professions.join​
    - professions.leave​
    ----------------------​
    I really need these :)
     
  19. Any progress?
    I mean ok, it's working great so i need nothing ... ^^
    Just interested :)
     
  20. Offline

    vobilli

    So does this not work with bPermissions at all?
     
  21. @ArtemisTheSecond

    Emergency!
    Code:
    2011-11-25 15:17:17 [SEVERE] Error occurred while enabling Professions v0.2.0 (Is it up to date?): ru/tehkode/permissions/bukkit/PermissionsEx
    java.lang.NoClassDefFoundError: ru/tehkode/permissions/bukkit/PermissionsEx
        at me.aRt3m1s.professions.Professions.onEnable(Professions.java:49)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:176)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:159)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:422)
        at org.bukkit.Bukkit.reload(Bukkit.java:186)
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:22)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:364)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:360)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:553)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:530)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:414)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    Caused by: java.lang.ClassNotFoundException: ru.tehkode.permissions.bukkit.PermissionsEx
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 16 more
    It needs to be fixed to work with the new Configuration-System of Bukkit!
    And there are some Problems with iConomy6, too.
     
  22. I solved the problem and added support for Vault (better alternative of Register), so most economy plugins are supported now.
    I will upload it tomorrow.
     
  23. Due to problems Vault can do, i changed to Register support.
    After several days of testing i can say: it works.
     
  24. Offline

    Thequickthinkin

    @Terra-Network.org
    Sadly, I believed Artemis left his support on this plugin, I saw a post somewhere but I believe he removed it, real life caught up with him and he is too busy to maintain it. Maybe we can do a plugin request for someone to carry on this what I regard as core plugin for servers such as my own?

    - Matt
     
  25. Good idea, maybe there's someone out there.
    My knowledge of Java is very limited, i managed to update it to Register instead of iConomy5 only, but PEX, Permission nodes, ... that's too much for me :)

    But as i say, it works for me with CB15++ and that's all i need to know, because i don't miss any features.
    Do you want the working version?
     
  26. Offline

    Thequickthinkin

    I'm running it with CB1549 now, I have no need for the money system :)
     
  27. Ok, fine :)

    Added account-balance control.
    Now it isn't possible anymore to buy a skill without enough money.

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

    Thequickthinkin

    Why don't you make a thread for your version? Then you can upload downloads and maybe get plugin dev :)
     
  29. Offline

    Sleaker

    What problems with Vault?
    Register is completely discontinued and no longer developed.

    Why didn't you report a bug, or ask for help with Vault, I'm more than willing to give support help, or patch quickly if there is an issue. Continuing to use buggy, outdated, and unsupported code (Register) is generally not a good idea.
     
  30. You're right, i'm sry, switched back to Vault and it works great.
    Was my fault, of course Vault is lot easiert then Register!
     
  31. Im having a problem when someone trys to use commands like /prof list

    Code:
    04:49:20 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'prof' in plugin Professions v0.2.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:378)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:757)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:722)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:715)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:93)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:527)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    Caused by: java.lang.NullPointerException
        at me.aRt3m1s.professions.Professions.onCommand(Professions.java:165)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        ... 12 more
    
    -edit-

    NVM i found the problem the plugin is up to date with the current multiworld
     

Share This Page