Vault - A Permissions/Economy API - alternative to Register [STABLE]

Discussion in 'Resources' started by Sleaker, Oct 21, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    desht

  2. Offline

    Sleaker

    @desht - Looking great! -

    Added a few more plugins to the list on the vault page too.

    If anyone wants to write a bit more of a How-To guide on showing some actual examples after the linking is done and posted the up in WikiCreole on the Vault forum I'd appreciate it much, and I'm sure other prospective devs would like to see it also!
     
  3. Offline

    Sleaker

    new version up today, fixes P3 mutable permissions, and adds some extra compatibility to bPermissions.
     
  4. Offline

    Taco

    It seems to return a null Economy variable when using EssentialsEcon and BOSEconomy.
     
  5. Offline

    tips48

    Love it!
    Wish it had maven though..Oh well, can just install manually.
     
  6. Offline

    Sleaker

    responded to your post, you're not checking it properly based on what you linked (as far as I can tell)

    @tips48 - maven is meh :p - and I think ecoCreature that is on our build server uses maven.

    EDIT: took a look at it and it maintains a local download of Vault, annoying since ant can download artifacts from any location you want, while maven seems like it can only download from artifact repositories.

    EDIT2: Maven supports running Ant tasks internally - just use a local dependency in your pom and before you run the maven compile run an Ant task to download the latest RB of a non-maven project via: http://maven.apache.org/plugins/maven-antrun-plugin/
     
  7. Offline

    Waffletastic

    Anyone want to help me understand how this works, and how to use it? Nub gonna nub.

    @Sleaker I don't really understand how to use this, but I can't send you messages.

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

    desht

    @Waffletastic hooking Vault is pretty well described on the front page - http://dev.bukkit.org/server-mods/vault

    Once you've hooked whichever part(s) of the API you need (one or more of Permission, Economy, Chat), just follow the javadocs at http://ci.milkbowl.net/job/Vault/javadoc/

    E.g. to charge a player 20 economy credits:
    PHP:
    YourPlugin.economy.withdrawPlayer("playername"20.0);
    To check if a player is in some permission group:
    PHP:
    YourPlugin.permission.playerInGroup("playername""groupname");
     
  9. Offline

    Sleaker

    @tips48 - we just setup a maven artifact for Vault - should be usable now for any project that uses maven.
     
    tips48 likes this.
  10. Offline

    WizzleDonker

    Wow good god I love this! This api is a lifesaver for when I want to do some simple editing for MY economy even... I like to be flexible, and in the event I ever switch economy plugins, I will still be very well handled. The methods all make sense, and return what you expect. Once again, great work!

    In fact, one of my first plugins, SimpleHotel uses Vault, and without it I would be absolutely nowhere.
     
  11. Offline

    Waffletastic

    @Sleaker How would I compile against Vault, so that my users don't have to get the Vault plugin?
     
  12. Offline

    Sleaker

    You don't... That's exactly what we DON'T want. Register allows you to do this and it completely breaks when multiple plugins do it along with trying to run the library.

    Link the Vault page as a required dependency and have your plugin warn when it's enabled (and disable itself if it needs the econ/permission support) if they try to use your plugin without it.
     
  13. Offline

    Sleaker

    Vault now supports MineConomy and eWallet - making it the most inclusive Economy API available!
     
    WalkerCrouse likes this.
  14. Offline

    Windwaker

    This is everything I need and more :)

    So glad I used this. I've used Vault to create an economy converter for RealExchange (iConomy -> RealExchange, etc)
     
  15. Offline

    awesomebilly

    Hello, I've been looking on google for a few hours about updating register (its been abandoned I believe?)
    I came across "Vault" and would like to know if I need to change a config or something to take place of register? Or do the plugin developers need to change their code to use vault?
     
  16. Offline

    Sleaker

    plugin devs would need to change their code.
     
  17. Offline

    xGhOsTkiLLeRx

    @Sleaker

    Hey!
    First great idead!
    I just started using Vault.

    Is there any way to have Vault optional?
    If Vault & any economy plugin is installed & running -> Use economy
    if Vault isn't installed -> use everything without economy

    Because of the dependency I keep this error without Vault...
    Show Spoiler
    2011-12-01 18:20:19 [SEVERE] Could not load 'plugins\SecretPlugin.jar' in folder 'plugins': Vault
    org.bukkit.plugin.UnknownDependencyException: Vault
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:215)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:147)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:123)
    at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:52)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:141)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:388)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)

    Would be awesome if there is any way to do it!
     
  18. Offline

    Sleaker

    The same way you would prevent a hard-error when checking for optional dependencies. before instantiating any of the Vault values or trying to getProvider, check if Vault is loaded. Then put it as a softdepend: [ Vault ] instead ofa depend: [Vault] in your plugin.yml
     
  19. Offline

    xGhOsTkiLLeRx

    Thx <3
     
  20. Offline

    wwsean08

    looks like I've got a project ahead of me adding to ClearInv, it's about time i added support for economy.
     
  21. Offline

    Sleaker

    Vault now supports bPerms 2.x - as well as doing update threaded update checks every 30 minutes to notify the server of when it's time to update. Hopefully this will keep servers so they don't have outdated versions such as the bPerms update.
     
  22. Offline

    okami35

    Hello, I would like to use Vault instead of Register, but i don't understand how to use setupEconomy?
    How can I call the method? I don't find sources.

    Thank you for your help
     
  23. Offline

    smickles

    I just want to say, I switched from Register recently. Vault is easy to use and just plain awesome.
     
  24. Offline

    andrewkm

    @Sleaker
    Do you have a jenkins where we can follow along with the development builds of this? (If exist)
     
  25. Offline

    desht

    I'm not Sleaker, but I happen to know he maintains a Jenkins here: http://ci.milkbowl.net/ :)

    setupEconomy() is a method you need to provide yourself - but the good news is you can generally just copy & paste one or more of the example methods on the http://dev.bukkit.org/server-mods/vault/ plugin page.

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

    okami35

    Thank you it works
     
  27. Offline

    Sleaker

    There's not too much development that goes on, usually if I'm going to add something it gets added, tested briefly and pushed as a new version, the interfaces are all written at this point and really only small changes are getting pushed to maintain it. There is the possibility of adding other APIs though at this point, someone suggested a Region API.
     
  28. Offline

    PatrickFreed

    @Sleaker
    I wrote a simple plugin that modifies a users group onCommand, and it seems to work with PEX (haven't tested with bPerms), but in GM, the user's group stays the same. permission.playerAddGroup(...) should change the user's group correct?

    http://pastie.org/private/pcrm07mjyw1wvlkdo9wdg Here's the class I'm referring to.
     
  29. Offline

    Sleaker

    @PatrickFreed - GM handles groups in an odd way to the point that I have no drive/desire to write compatibility for adding/removing groups with GM. It has a Primary Group and all other groups are secondary. but Vault/every other permission system does not indicate a primary group in this way (except through internal weighting sometimes). Which leads me to the sticky situation of not knowing how to handle group removal.

    So if GM wants to add addGroup and removeGroup to their API I'll definetely hook them. Until then, it's doubtful.
    Also, this is why Vault returns success/failure messages. If you're hooking Vault you MUST listen to the messages otherwise your plugin will have issues where you're telling everyone yes it worked! When vault actually returned a failure notification.
     
    PatrickFreed likes this.
  30. Offline

    Sleaker

    added CurrencyCore support to latest version!
     
Thread Status:
Not open for further replies.

Share This Page