Vault Issue

Discussion in 'Plugin Development' started by nggmc, Apr 16, 2013.

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


    I haven't done Java for a while and here is what I got when trying to update my plugins.
    2013-04-18 18:34:27 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'lotto' in plugin MCLotto v4.0
    at org.bukkit.command.PluginCommand.execute(
    at org.bukkit.command.SimpleCommandMap.dispatch(
    at org.bukkit.craftbukkit.v1_5_R2.CraftServer.dispatchCommand(
    at net.minecraft.server.v1_5_R2.PlayerConnection.handleCommand(
    at net.minecraft.server.v1_5_R2.PlayerConnection.a(
    at net.minecraft.server.v1_5_R2.Packet3Chat.handle(
    at net.minecraft.server.v1_5_R2.NetworkManager.b(
    at net.minecraft.server.v1_5_R2.PlayerConnection.d(
    at net.minecraft.server.v1_5_R2.ServerConnection.b(SourceFile:35)
    at net.minecraft.server.v1_5_R2.DedicatedServerConnection.b(SourceFile:30)
    at net.minecraft.server.v1_5_R2.MinecraftServer.r(
    at net.minecraft.server.v1_5_R2.DedicatedServer.r(
    at net.minecraft.server.v1_5_R2.MinecraftServer.q(
    Caused by: java.lang.NullPointerException
    at me.pineabe.modernmc.Commands.onCommand(
    at org.bukkit.command.PluginCommand.execute(
    ... 15 more
    Heres a link to my CommandExecutor class.
  2. Offline


    EconomyResponse r = econ.withdrawPlayer(p.getName(), plugin.getConfig().getInt("TicketFare"));

    Something on that line is null, my guess is plugin.getConfig().getInt("TicketFare")).

    Also, you don't have to have EconomyResponce for vault.
  3. I wouldn't think getting the int from the config is resulting that, more likely that you don't set the econ variable. Since it's a public variable, I don't know if you set it somewhere else (in the main class for example), but as far as I can see, you don't set it to something at all.
  4. Offline

    ZeusAllMighty11 Retired Staff

    Your plugin variable is null, look at your constructor
  5. TheGreenGamerHD As long as he doesn't pass in null into the constructor, it won't.
  6. Offline


    Unless this changed very recently, config.getInt does not return null if the path doesn't exist (despite the JavaDocs saying it does).
  7. Offline



    Maybe plugin is null?
  8. ->
  9. Offline


    I've removed the economy response as a test. All the commands work perfectly fine except for /lotto buyticket. The command will work if you have the wrong ticket number or you have already purchased a ticket previously. It's become obvious this is a vault problem (i.e anything with Economy or EconomyResponse). I will try fix it or wait for an update. If not I will switch to Register or something. Thanks for your help.
  10. Like I said in my first post, are you sure you don't forget to set the econ variable?
  11. Offline


    Thanks for your help :) That was it I had econ set to null and the setupEconomy was in the main class all I needed to do was add this code to my onCommand boolean.
    RegisteredServiceProvider<Economy> rsp = plugin.getServer().getServicesManager().getRegistration(Economy.class);
            econ = rsp.getProvider();
Thread Status:
Not open for further replies.

Share This Page