[ECON/FUN] BuyAbilities v0.9.2 - Purchase Abilities [953]

Discussion in 'Inactive/Unsupported Plugins' started by andune, May 30, 2011.

  1. Offline

    andune

    BuyAbilities - Purchase Abilities:
    Version: v0.9.2

    Reviving the plugin originally written by @rcjrrjcr. This update includes iConomy5 and a number of other fixes. I've spoken with @rcjrrjcr and I will be maintaining this plugin going forward. Here is the link to the original BuyAbilities thread.

    So without further ado, here is the original description (with updates):

    ---

    BuyAbilities is a plugin that allows your players to purchase abilities or permissions with iConomy/EssentialsEco/BOSEconomy money! This way, players can finally have a long-term investment for their virtual money, instead of spending it on items. Also, the time-based and use-based rent systems allow temporary access to permissions.

    Abilities are groups of related permission nodes, which are granted to the player upon purchase. Abilities are also grouped into categories, which the server admins can deny or allow access to via permissions.

    Original Suggestion Thread
    Purchasable Permissions/Abilities

    Features:

    • Rent abilities for a specified duration
    • Purchase uses of an ability and its associated commands
    • Purchase abilities permanently and retain its benefits forever (theoretically:p)
    Download zip file
    Download jar only (for updates)


    Help

    Source Code

    Requirements:
    • An economy plugin (iConomy 4 or 5, EssentialsEco, BOSEconomy)
    • A permissions plugin (Permissions 2.7, GroupManager)
    Usage Instructions:
    For players:
    • Plugin commands are "/bab" and "/buyab". Each can be used instead of the other.
    • From player's chat:
      • "/bab categories" returns all accessible categories.
      • "/bab category <categoryname>" returns all abilities in the category.
      • "/bab page" lists all accessible abilities.
      • "/bab current" lists all active abilities.
      • "/bab buy <abilityname>" buys an ability.
      • "/bab rent <abilityname>" rents an ability for a period of time.
      • "/bab rentuse <abilityname>" purchases uses of an ability.
      • "/bab info <abilityname>" returns information about that ability.
      • "/bab help <abilityname>" returns the help text about that ability.
    For Admins:
    • From server console:
      • "/bab listall" prints out a list of all active abilities for all players.
      • "/bab status" prints out the current status of the hooks into the permissions and economy plugins.
      • "/bab reload" reload the abilities definition file
    • For admins:
      • To allow usage of the /bab command, grant the permission "buyabilities.use".
      • To allow access to a category, grant the permission "buyabilities.abilities.<categoryname>" where <categoryname> is the name of the category, with periods replacing spaces.
      • To allow live reloading of ability definitions, grant the permission "buyabilities.admin.reload"
      • NOTE: A user can access an ability if he can access any single one of its categories. It does not matter if he can access its other categories, just one.
    • NOTE: If an ability or category name is misspelled, this plugin will provide suggestions for the correct spelling of the name.

    TODO:
    • Permission 3.x support
    • Permissions 2.7.x fixes for mixed-case names
    • PEX support (maybe?)
    • WorldGuard region support (permissions specific to a region)
    • Better messaging to users when rented abilities are expiring


    Changelog:
    v0.9.2
    • fixed issue with abilities not persisting across plugin restarts & server reboots
    • fixed "ConcurrentModificationException" issues, reported by @Joy
    • fixed dangling "Categories: /" issue on "/bab info", reported by @Joy
    • added debug message to try to narrow down what's happening with mixed case names and Permissions
    v0.9.1
    • added live reload capability via "/bab reload", available via permission 'buyabilities.admin.reload'
    Show Spoiler

    v0.9.0
    • integrated Nijikokun's Register module (iConomy5 support)
    • bukkit ebean support for serializing user data
    • fixes to support Essentials 2.2.18+
    • other bug fixes
    • debug messages cleanup (converted to Logger log.fine())
    v0.8.9
    • Fixes ability removal bug. Iterators finally get a use.


    Suggestions and ideas are welcome!


    Credits: (from @rcjrrjcr)

    I would like to credit the people whose code I used:

    (And of course thanks to @rcjrrjcr for writing this great plugin to begin with!)

    Report bugs by enclosing the exception's stack trace, your costs.yml and data.yml in spoilers or preferably using pastebin.
     
    Taranis01 and Phaedrus like this.
  2. Offline

    SpeakingCactus

    Here it is !
     

    Attached Files:

  3. Offline

    WeedFreak

    @SpeakingCactus x) I Really think thats the france letters like " é " there are some ^^etc. use a normal e and letters to get it work!

    @morganm
    Push xD post #66

    can you build in a remove Command for a Permanently buyed permission like > /bab remove Jump <
    i need this so much x)

    Nice Greetz
     
  4. Offline

    andune

    @WeedFreak

    Seems a reasonable feature request. My highest priority right now is adding Perm 3.x support, which I'm actively working on. Once that's out of the way, I may take a look at adding some of the other great feature suggestions posted here, including yours.
     
  5. Offline

    wizroul

    HI i keep gettingthis error spamming the console when i enable your plugin

    Code:
    2011-06-26 12:49:36 [SEVERE] java.lang.NoSuchMethodError: com.nijiko.permissions.PermissionHandler.removeUserPermission(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    2011-06-26 12:49:36 [SEVERE] at com.rcjrrjcr.bukkitplugins.util.permissionsinterface.PermYetiHandler.removePerm(PermYetiHandler.java:83)
    2011-06-26 12:49:36 [SEVERE] at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.AbilityManager.update(AbilityManager.java:233)
    2011-06-26 12:49:36 [SEVERE] at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilitiesChecker.run(BuyAbilities.java:825)
    2011-06-26 12:49:36 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    2011-06-26 12:49:36 [SEVERE] at java.lang.Thread.run(Unknown Source)
    2011-06-26 12:49:37 [SEVERE] Exception in thread "Thread-20078" 
    the thread-number keeps changeing and seams to be going up by 1
    this error happens when i try to rent super pickaxe haven't tried any other commands

    here is the cost.yml

    Code:
       SuperPick Axe:
            info:
                name: 'Super Picaxe'
                description: 'Allows you to Use Super Pickaxe'
                help: 'Type /sp to turn super pickaxe on and off.'
            permissions:
                - 'worldedit.superpickaxe'
            categories:
                - 'basic'
            costs:
                buy:
                    cost: 100000
                rent:
                    cost: 5000
                    duration: 5000
    i also am getting this error when shutting server

    Code:
    2011-06-26 12:50:05 [SEVERE] Error occurred while disabling BuyAbilities v0.9.2 (Is it up to date?): This method not implemented
    java.lang.UnsupportedOperationException: This method not implemented
    at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.storage.StorageEBeans.writeData(StorageEBeans.java:94)
    at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.onDisable(BuyAbilities.java:162)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:128)
    at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:878)
    at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:269)
    at org.bukkit.plugin.SimplePluginManager.disablePlugins(SimplePluginManager.java:262)
    at org.bukkit.craftbukkit.CraftServer.disablePlugins(CraftServer.java:146)
    at net.minecraft.server.MinecraftServer.stop(MinecraftServer.java:312)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:391)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    I am runninng bukkit 928 and your latest release

    probably something i am doin wrong

    thanks for any help :D
     
  6. Offline

    WeedFreak

    @wizroul

    you must remove the Space @ SuperPick Axe make SuperPickAxe i think this will work!

    and Big THX @morganm when the remove Function will work , my Second Server goes Perfekt with this plugin and becomes one of the Main Plugins I use on it!

    Greetz
     
  7. Offline

    wizroul

    Nope sorry removed the space and all loads and when ever a non op uses commands this error is on server
    Code:
    org.bukkit.command.CommandException: Unhandled exception executing command 'bab' in plugin BuyAbilities v0.9.2
    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:298)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:725)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:691)
    at com.edwardhand.commandsigns.CommandSigns.runCommandString(CommandSigns.java:1360)
    at me.desht.scrollingmenusign.SMSCommandFile.executeCommand(SMSCommandFile.java:139)
    at me.desht.scrollingmenusign.SMSCommandFile.executeCommand(SMSCommandFile.java:105)
    at me.desht.scrollingmenusign.SMSPlayerListener.executeMenu(SMSPlayerListener.java:101)
    at me.desht.scrollingmenusign.SMSPlayerListener.processAction(SMSPlayerListener.java:72)
    at me.desht.scrollingmenusign.SMSPlayerListener.onPlayerInteract(SMSPlayerListener.java:64)
    at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:307)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:168)
    at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:64)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:466)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    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.NoSuchMethodError: com.nijiko.permissions.PermissionHandler.addUserPermission(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    at com.rcjrrjcr.bukkitplugins.util.permissionsinterface.PermYetiHandler.addPerm(PermYetiHandler.java:67)
    at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.AbilityManager.addPlayerAbility(AbilityManager.java:70)
    at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.AbilityManager.rentAbility(AbilityManager.java:96)
    at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.commandHandler(BuyAbilities.java:543)
    at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.onCommand(BuyAbilities.java:280)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 23 more
    Oh and is there a permission just to rent an ability at the moment I am just using

    buyabilities.abilities.basic
    buyabilities.use

    is there a buyabilities.rent

    Thanks for help :D
     
  8. Offline

    Vittek

    I think the latest bukkit (935) broke this plugin.. it worked before, now when someone tries to buy the ability I get this:

     
  9. Offline

    WeedFreak

    I use the NEwest version off Bukkit and it Works...
     
  10. Offline

    baem

    still waiting for permissions 3 support
     
  11. Offline

    andune

    Update on Permissions 3 support: the handler for Permissions 3 is mostly complete; I do still need to hook a few world events to make sure it responds properly to plugin reload events. So the next phase in development is testing. For that I am upgrading my own server to Perm3 so I can test it in a known environment and look for issues, since it'll be much easier for me to troubleshoot them there than just releasing and inflicting buggy, untested code on you all.

    Unfortunately, I'm having significant issues with Perm3.1, which has some bugs related to MySQL (the storage engine I've chosen to use and a big motivator for me upgrading). And Perm 3.2 (which fixes some of those bugs) is in dev-only and has significant bugs of it's own. So once I'm able to get a working, stable Perm3 functioning on my server, rest assured BuyAbilities will support it very quickly after that since I use BuyAbilities myself and want it working on my server. :)

    I can't give a time frame since I don't know what it's going to take to get Perm3 fixed and tested, but it is something I really want to get done on my server so it's very high on my priority list. Sorry to those who've already upgraded and want this plugin working already, I'll get there just as soon as I can get Perm3 working without bugs for me.
     
    Taranis01 likes this.
  12. Offline

    footwo

    screw Permissions 3, it will be superseded by Bukkit's own permissions API. Please fix the current issue with mix cased names and I will send you some flowers. EXPENSIVE ONES.
     
  13. Offline

    emcitement

    This looks fabulous.

    I may use it in the future.
     
  14. Offline

    Radza

    When player typing command

    Code:
    /bab buy Miner
    he gain command /jobs join Miner, but also, server got error below

    Code:
    2011-07-09 22:18:04 [INFO] BuyAbilities.addPlayerAbility(): world: Civilization, player: Player, node:jobs.join.Miner
    2011-07-09 22:18:04 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'bab' in plugin BuyAbilities v0.9.2
        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:298)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:711)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:676)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:669)
        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:84)
        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.NoSuchMethodError: com.nijiko.permissions.PermissionHandler.setCacheItem(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V
        at com.rcjrrjcr.bukkitplugins.util.permissionsinterface.PermYetiHandler.addPerm(PermYetiHandler.java:68)
        at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.AbilityManager.addPlayerAbility(AbilityManager.java:70)
        at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.AbilityManager.buyAbility(AbilityManager.java:101)
        at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.commandHandler(BuyAbilities.java:501)
        at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.onCommand(BuyAbilities.java:280)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    Another prob, are 1 /bab buy comand can set more then 1 permision?
    like:

    Code:
        Blackshmit:
            info:
                name: 'Blackshmit'
                description: 'Allows you to set a Blackshmit speciality'
                help: 'Type /jobs join Blackshmit  to gain accses for Blackshmit abilities'
            permissions:
                - 'jobs.join.Blackshmit'
                - 'mcmmo.skills.repair'
                - 'mcmmo.skills.unarmed'
            categories:
                - 'Jobs'
            costs:
                buy:
                    cost: 1000
     
  15. Offline

    andune

    I assume you're using Permissions 3.x or PEX? If so, this plugin does not support those yet, please read up in the thread. I will support Permissions 3.x just as soon as some of the MySQL bugs are worked out and I can have it running on my local test server to test BAB with. I will take another pass at this today and see if some of the bugs are fixed or if I can just workaround them for now for the sake of getting BAB updated.

    Regarding multiple permissions, yes that should work (assuming you are using Perm2.7.x or GroupManager).
     
  16. Offline

    Devboi

    I know you are working on the permissions 3 update.
    Just to let you know this plugin is Great and is a key part in my Survival/Creative server for people to buy commands for a period of time, there is no other plugin to do this....
    Looking forward to the update so I can get my freebuild area re opened
     
  17. Offline

    Crete21

    +1 to just fixing the mixed case problem in Permissions 2.7

    works great other than that!
     
  18. Offline

    GayJuice

    hey guys are the bug ironed out yet for buy and rent?
     
  19. Offline

    andune

    Good news: I built a stripped-down test server specifically for testing this plugin with various Permission systems. I'm starting with Permissions 2.7 and the good news is that I have locally reproduced the name-case issue that people were complaining about, so I will be looking into this and fixing it if at all possible.

    I also have a minimal Permission 3 setup running (using YAML configs, MySQL still having issues) so I can now test the code for Permissions3 and hopefully get a release out for that soon.

    I will consider PEX as well, depending on how much work that appears to be and how much interest there is in it.

    Last, I know Bukkit now has their own Permission system built-in as of RB #1000, I have no idea how possible it is or is not to use this system with BAB, but I will be looking to add support for that as well.
     
  20. Offline

    Sonorpearl

    morganm, do you now have any new idea, with the new Permissions System and Build 1000? Would we nice if you can update it and release the Full version 1.0 on RB #1000.
     
  21. Offline

    Lanuk

    This plugin looks awesome! Is it PermissionsBukkit (SuperPerms) compatible yet? And will it be updated?
     
  22. Offline

    Imm0rt41

    does this mean like buy abilities in other plugins, or like admin abilities?
     
  23. Offline

    SLUGAKARL

    Support For PEX would be much appreciated.

    Great Plugin, Keep Up The Great Work.
     
  24. Offline

    nicquehen

    +1 i use PEX but i loose this plugin !

    Please update i love it.
     
  25. Offline

    cpalms

    Screw PEX update for bPermissions or Permissions Bukkit (superperms)
     
  26. Offline

    Alienware777

    PEX support would be awesome :)
     
  27. Offline

    Syd

    Is this Plugin continued?
     
  28. Offline

    M1C

    I'm going to write PermissionBukkit and possibly PEX support.
    You will recive a pull request on github :)
     
  29. Offline

    arxxis

    Overall this is a really useful plugin. But a few issues I have experienced that is making this difficult for long term usage.
    1) When I buy abilities they do appear to be purchased however after a server restart they are no longer purchased. I read in the release notes that this was fixed but I guess the plugin has a regression.

    2) If an ability is rentuse it shows up in the list of current abilities but any bought abilities does not show up there. And of course if the server is restarted this ability is lost as well. One thing to note is that if both abilities are purchased instead of one being rentuse they both show in the list just fine.
     
  30. Offline

    andune

    A few folks have offered to write some PEX and/or Superperms bridges, but there was a missing piece, as this was originally written by another author who had a dependency on a utils package he wrote. I've now uploaded the latest copy of this utils into GIT:

    https://github.com/morganm/RcjrUtil/

    So anyone looking to contribute to this plugin can download both the BuyAbilities GIT and this utils package and then you should have everything you need to get a build working that you can hack away on and test. Feel free to push me back a GIT pull request and I'll be more than happy to add you as an author and release an update to the eager community. :)
     
  31. Offline

    shanko

    this doesn't work with the newest verison of craftbukkit does it?

    23.10 15:27:24 [Server] INFO at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
    23.10 15:27:24 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
    23.10 15:27:24 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:174)
    23.10 15:27:24 [Server] INFO at com.rcjrrjcr.bukkitplugins.buyabilitiesplugin.BuyAbilities.onEnable(BuyAbilities.java:107)
    23.10 15:27:24 [Server] INFO java.lang.NullPointerException
    23.10 15:27:24 [Server] SEVERE Error occurred while enabling BuyAbilities v0.9.2 (Is it up to date?): null

    seems to conflict with

    http://forums.bukkit.org/threads/ec...gold-into-money-1337.25477/page-4#post-764237

    some how, they both wouldnt work then i disabled this plugin and gold 2 economy worked

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

Share This Page