Somthing wrong with vault... Pls help

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

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

    Jmcm71

    vault gives me an error when i run my plugin thanks in advance :D also i have vault downloaded and in my plugins folder

    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!
     
  2. Offline

    1Achmed1

  3. Offline

    Henzz

    Jmcm71
    Are you definitely sure you have Vault installed on your server? Screenshots?
     
  4. Offline

    Jmcm71

    Henzz yes vault is in my plugins folder
     
Thread Status:
Not open for further replies.

Share This Page