Plugin unable to hook into vault

Discussion in 'Plugin Development' started by Goblom, Nov 14, 2013.

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

    Goblom

    My plugin, http://dev.bukkit.org/bukkit-plugins/gui/, recently added economy support via vault, but, no matter what i do economy does not work. Right now i have it setup to disable the plugin if an economy plugin is not found, and no matter what econ plugin i use the plugin gets disabled.

    I am using the same code that is used as an example on the Vault Github Repo, and here is the code i am using in my plugin.

    Code:java
    1. public class SimpleGUI extends JavaPlugin {
    2.  
    3. public static Economy econ = null;
    4.  
    5. public void onEnable() {
    6. if (!setupEconomy() ) {
    7. getLogger().severe("Vault or economy not found. Plugin Disabling");
    8. getServer().getPluginManager().disablePlugin(this);
    9. }
    10. }
    11.  
    12. private boolean setupEconomy() {
    13. if (getServer().getPluginManager().getPlugin("Vault") == null) {
    14. getLogger().severe("Nulled Vault");
    15. return false;
    16. }
    17. RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
    18. if (rsp == null) {
    19. getLogger().severe("Nulled RSP");
    20. return false;
    21. }
    22. econ = rsp.getProvider();
    23. return econ != null;
    24. }
    25. }
    Every time setupEconomy() is ran it print out "Nulled RSP" to the console (which is why i am asking for help)

    Edit: In my plugin yml i already depend on vault
    Code:
    depend: [Vault]
     
  2. Offline

    EnvisionRed

    Do you have vault as a soft dependency or dependency in your plugin yml? Otherwise bukkit may load your plugin before it.
     
  3. Offline

    Goblom

    EnvisionRed
     
  4. Offline

    ZachBora

    Goblom Do you have an economy plugin installed? Vault will return null if you don't have any installed.
     
  5. Offline

    Goblom

    ZachBora I have tested this with iConomy, BOSEconomy, and now im just trying to use this with Essentials Econ.

    I vaguely remember that if an economy plugin is found vault will say something along the lines of "Econ plugin found. Using ______ for economy support" If that is still in vault then something is up with everything i am trying because i do not get that message.
     
  6. Offline

    ZachBora

    Goblom Can you show us your server start log?
     
  7. Offline

    Goblom

    ZachBora Log generated when ran from my test environment
    Code:
    2013-11-14 08:43:51 [INFO] Starting minecraft server version 1.6.4
    2013-11-14 08:43:51 [INFO] Loading properties
    2013-11-14 08:43:51 [INFO] Default game type: SURVIVAL
    2013-11-14 08:43:51 [INFO] Generating keypair
    2013-11-14 08:43:51 [INFO] Starting Minecraft server on *:25565
    2013-11-14 08:43:52 [INFO] This server is running CraftBukkit version git-Bukkit-1.6.4-R1.0-4-g6fe76fa-b2917jnks (MC: 1.6.4) (Implementing API version 1.6.2-R1.1-SNAPSHOT)
    2013-11-14 08:43:52 [INFO] [Vault] Loading Vault v1.2.27-b349
    2013-11-14 08:43:52 [INFO] [Simple-GUI Creator] Loading Simple-GUI Creator v2.4
    2013-11-14 08:43:52 [INFO] [Essentials] Loading Essentials v2.12.1
    2013-11-14 08:43:53 [INFO] [Vault] Enabling Vault v1.2.27-b349
    2013-11-14 08:43:53 [INFO] [Vault][Permission] SuperPermissions loaded as backup permission system.
    2013-11-14 08:43:53 [INFO] [Vault] Enabled Version 1.2.27-b349
    2013-11-14 08:43:53 [INFO] Preparing level "world"
    2013-11-14 08:43:53 [WARNING] ----- Bukkit Auto Updater -----
    2013-11-14 08:43:53 [WARNING] Your version of CraftBukkit is out of date. Version 1.6.4-R2.0 (build #2918) was released on Wed Oct 30 23:39:40 PDT 2013.
    2013-11-14 08:43:53 [WARNING] Details: /downloads/craftbukkit/view/02389_1.6.4-R2.0/
    2013-11-14 08:43:53 [WARNING] Download: /downloads/craftbukkit/get/02389_1.6.4-R2.0/craftbukkit.jar
    2013-11-14 08:43:53 [WARNING] ----- ------------------- -----
    2013-11-14 08:43:53 [INFO] Preparing start region for level 0 (Seed: -7167352568204938599)
    2013-11-14 08:43:54 [INFO] Preparing spawn area: 10%
    2013-11-14 08:43:55 [INFO] Preparing spawn area: 47%
    2013-11-14 08:43:56 [INFO] Preparing spawn area: 71%
    2013-11-14 08:43:57 [INFO] Preparing start region for level 1 (Seed: -7167352568204938599)
    2013-11-14 08:43:58 [INFO] Preparing spawn area: 2%
    2013-11-14 08:43:59 [INFO] Preparing spawn area: 12%
    2013-11-14 08:44:00 [INFO] Preparing spawn area: 46%
    2013-11-14 08:44:03 [INFO] Preparing spawn area: 48%
    2013-11-14 08:44:04 [INFO] Preparing spawn area: 65%
    2013-11-14 08:44:04 [INFO] Preparing start region for level 2 (Seed: -7167352568204938599)
    2013-11-14 08:44:09 [INFO] Preparing spawn area: 0%
    2013-11-14 08:44:10 [INFO] Preparing spawn area: 50%
    2013-11-14 08:44:11 [INFO] Preparing spawn area: 62%
    2013-11-14 08:44:12 [INFO] Preparing spawn area: 92%
    2013-11-14 08:44:12 [INFO] [Simple-GUI Creator] Enabling Simple-GUI Creator v2.4
    2013-11-14 08:44:12 [WARNING] [Simple-GUI Creator] Could not save gui-example.yml to ..\..\target\Simple-GUI Creator\gui-example.yml because gui-example.yml already exists.
    2013-11-14 08:44:12 [SEVERE] [Simple-GUI Creator] Unable to find an economy plugin
    2013-11-14 08:44:12 [SEVERE] [Simple-GUI Creator] Vault or economy not found. Economy support disabled
    2013-11-14 08:44:12 [INFO] [Essentials] Enabling Essentials v2.12.1
    2013-11-14 08:44:15 [INFO] Essentials: Using config file enhanced permissions.
    2013-11-14 08:44:15 [INFO] Permissions listed in as player-commands will be given to all users.
    2013-11-14 08:44:15 [INFO] Server permissions file permissions.yml is empty, ignoring it
    2013-11-14 08:44:15 [INFO] Done (22.073s)! For help, type "help" or "?"
    
     
  8. Offline

    L33m4n123

    I don't see no Economy starting o.o If you use Essentials Economy, Essentials finishs loading after your plugin. that may cause it
     
  9. Offline

    ZachBora

    Are you sure you enabled economy in essentials?
     
  10. Offline

    Goblom

  11. Offline

    ZachBora

    Goblom Try to ask on vault dbo site. I've asked for help before and got an answer.
     
Thread Status:
Not open for further replies.

Share This Page