Vault is saying no dependency found

Discussion in 'Plugin Development' started by Jmcm71, Oct 3, 2013.

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

    Jmcm71

    Ok so i just finished the plugin i was making and all the code is right, but when i run the server it says Disabling CivilTaxes - No vault dependency found. Please help me, thanks in advance i have vault in the plugins folder, i may have did somthing wrong in plugin.yml
     
  2. Offline

    beastman3226

    Well, did you change anything in your plugin.yml to try and solve the problem?
    If you haven't, do that first. It is seriously annoying when people do not attempt to solve their problem before asking for help. Also, if you read your stacktrace closer, you will find exactly what is causing the problem.

    If you have gotten this far then you have already exhausted your alternatives.
    If you do have a depend or softdepend line then make sure that Vault is enabled, and ensure that your plugin is enabled after vault. You can do this by doing getServer().getPluginManager().enablePlugin("Vault");. That statement has to be the first thing. If it is not and you end up calling from method from vault then you will keep throwing the same error.
     
  3. Offline

    Jmcm71

    beastman3226 i tried my plugin.yml many different ways, i will try the second paragraph

    Here is my code:

    Code:java
    1. package me.josiah.civiltaxes;
    2.  
    3. import java.util.logging.Logger;
    4.  
    5. import net.milkbowl.vault.economy.Economy;
    6. import net.milkbowl.vault.economy.EconomyResponse;
    7.  
    8. import org.bukkit.Bukkit;
    9. import org.bukkit.ChatColor;
    10. import org.bukkit.command.Command;
    11. import org.bukkit.command.CommandSender;
    12. import org.bukkit.entity.Player;
    13. import org.bukkit.plugin.PluginDescriptionFile;
    14. import org.bukkit.plugin.RegisteredServiceProvider;
    15. import org.bukkit.plugin.java.JavaPlugin;
    16.  
    17. public class civiltaxes extends JavaPlugin{
    18.  
    19. public Logger logger = Logger.getLogger("Minecraft");
    20. public static Economy econ = null;
    21.  
    22. private boolean setupEconomy() {
    23. if (getServer().getPluginManager().getPlugin("Vault") == null) {
    24. return false;
    25. }
    26. RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
    27. if (rsp == null) {
    28. return false;
    29. }
    30. econ = rsp.getProvider();
    31. return econ != null;
    32. }
    33.  
    34. @Override
    35. public void onDisable() {
    36. PluginDescriptionFile pdfFile = this.getDescription();
    37. this.logger.info("[" + pdfFile.getName() + "]" + " "+ "Has been Disabled!");
    38. }
    39. @Override
    40. public void onEnable() {
    41. PluginDescriptionFile pdfFile = this.getDescription();
    42. this.logger.info("[" + pdfFile.getName() + "]" + " " + "Version "+ pdfFile.getVersion() + " " + "Has been Enabled!");
    43. if (!setupEconomy() ) {
    44. logger.severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName()));
    45. getServer().getPluginManager().disablePlugin(this);
    46. return;
    47. }
    48. }
    49.  
    50. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    51. Player player = (Player) sender;
    52. if(commandLabel.equalsIgnoreCase("tax")){
    53. if(args.length == 0){
    54. player.sendMessage(ChatColor.RED + "Invailed args use /tax [number]");
    55. }
    56. if(args.length == 1){
    57. int tax = 0;
    58. try {
    59. tax = Integer.parseInt(args[0]);
    60. } catch(NumberFormatException ex) {
    61. player.sendMessage(ChatColor.RED + "You must type in a number example: /tax 20");
    62. }
    63. for(Player online : Bukkit.getOnlinePlayers()){
    64. EconomyResponse r = econ.withdrawPlayer(online.getName(), tax);
    65. if(r.transactionSuccess()) {
    66. player.sendMessage(ChatColor.GREEN + "You were taxed " + tax + " dallors.");
    67. } else {
    68. player.sendMessage("An error occured while trying to tax you.");
    69. }
    70. }
    71. }
    72. }
    73. return false;
    74. }
    75. }



    Here is my plugin.yml:

    Code:
    name: CivilTaxes
    main: me.josiah.civiltaxes.civiltaxes
    version: 1.0.1
    description: >
                A plugin which allows you to tax your players.
    depend: [Vault]
    commands:
      tax:
        description: tax players
    
    And here is the error i get:

    Code:
    14:51:04 [INFO] [CivilTaxes] Enabling CivilTaxes v1.0.1
    14:51:04 [INFO] [CivilTaxes] Version 1.0.1 Has been Enabled!
    14:51:04 [SEVERE] [CivilTaxes] - Disabled due to no Vault dependency found!
    14:51:04 [INFO] [CivilTaxes] Disabling CivilTaxes v1.0.1
    14:51:04 [INFO] [CivilTaxes] Has been Disabled!
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
Thread Status:
Not open for further replies.

Share This Page