Solved Iconomy promblems

Discussion in 'Plugin Development' started by xepisolonxx, Oct 4, 2014.

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

    xepisolonxx

    I get error on this line
    Code:
       
          r = econ.depositPlayer(event.getPlayer().getName(), 200.00);
    
    event i already setted up economy and vault in main class im also using iConomy for money.
    Code:
        @SuppressWarnings("deprecation")
        @EventHandler
        public void onGetScoreboard(PlayerJoinEvent event){
          r = econ.depositPlayer(event.getPlayer().getName(), 200.00);
            setupScoreboard(event.getPlayer());
     
            }
        }
    
     
  2. You don't need the "r =". You only need this if you are withdrawing and want to check if it was a success.
     
  3. Offline

    xepisolonxx

  4. xepisolonxx What is the exact error you are getting? Please post the stack trace.
     
  5. Offline

    xepisolonxx

    xtechgamer735
    Code:
    Loading libraries, please wait...
    [17:28:25 INFO]: Starting minecraft server version 1.7.9
    [17:28:25 INFO]: Loading properties
    [17:28:25 INFO]: Default game type: SURVIVAL
    [17:28:25 INFO]: Generating keypair
    [17:28:25 INFO]: Starting Minecraft server on *:25565
    [17:28:25 INFO]: This server is running CraftBukkit version git-Bukkit-1.7.9-R0.
    1-10-g8688bd4-b3092jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.2)
    [17:30:28 INFO]: [ColoredSigns] Loading ColoredSigns v3.7 Release
    [17:30:28 INFO]: [eDRP] Loading eDRP v1.0
    [17:30:28 INFO]: [CrackShot] Loading CrackShot v0.97.13
    [17:30:28 INFO]: [Vault] Loading Vault v1.4.1-b436
    [17:30:28 INFO]: [WorldEdit] Loading WorldEdit v5.5.8
    [17:30:28 INFO]: [SimpleRename] Loading SimpleRename v3.0
    [17:30:28 INFO]: [iConomy] Loading iConomy v7.0
    [17:30:28 INFO]: [Vault] Enabling Vault v1.4.1-b436
    [17:30:28 WARN]: iConomy - If you are using Flatfile storage be aware that versi
    ons 6, 7 and 8 have a CRITICAL bug which can wipe ALL iconomy data.
    [17:30:28 WARN]: if you're using Votifier, or any other plugin which handles eco
    nomy data in a threaded manner your server is at risk!
    [17:30:28 WARN]: it is highly suggested to use SQL with iCo6 or to use an altern
    ative economy plugin!
    [17:30:28 INFO]: [Vault] [Economy] iConomy 6 found: Waiting
    [17:30:28 INFO]: [Vault] [Permission] SuperPermissions loaded as backup permissi
    on system.
    [17:30:28 INFO]: [Vault] Enabled Version 1.4.1-b436
    [17:30:28 INFO]: [ColoredSigns] Enabling ColoredSigns v3.7 Release
    [17:30:28 INFO]: [ColoredSigns] ColoredSigns v3.7 Release has been enabled.
    [17:30:28 INFO]: [eDRP] Enabling eDRP v1.0
    [17:30:28 INFO]: [eDRP] Plugin has been enabled!
    [17:30:28 INFO]: [CrackShot] Enabling CrackShot v0.97.13
    [17:30:28 INFO]: [CrackShot] Gun-mode activated. Boop!
    [17:30:28 INFO]: [WorldEdit] Enabling WorldEdit v5.5.8
    [17:30:28 INFO]: WEPIF: Using the Bukkit Permissions API.
    [17:30:28 INFO]: [SimpleRename] Enabling SimpleRename v3.0
    [17:30:28 INFO]: SimpleRename enabled!
    [17:30:28 INFO]: [SimpleRename] en
    [17:30:29 INFO]: [iConomy] Enabling iConomy v7.0
    [17:30:29 INFO]: [iConomy - April Fools] Enabled (43 ms)
    [17:30:29 INFO]: [iConomy] Hello, I'm Nijikokun. Yes, this is an April Fools jok
    e, but '/money top' was fixed! Enjoy :) - Rare Version!
    [17:30:29 INFO]: [Vault][Economy] iConomy 7 hooked.
    [17:30:29 INFO]: Server permissions file permissions.yml is empty, ignoring it
    [17:30:29 INFO]: [iConomy - April Fools] Purged accounts with default balance.
    [17:30:29 INFO]: CONSOLE: Reload complete.
    [17:30:29 INFO]: [Vault] Checking for Updates:
    [17:30:29 INFO]: [Vault] No new version available
    [17:30:34 ERROR]: Could not pass event PlayerJoinEvent to eDRP v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:294) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:501) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:486) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PlayerList.c(PlayerList.java:251) [craft
    bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.PlayerList.a(PlayerList.java:138) [craft
    bukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.LoginListener.c(LoginListener.java:76) [
    craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.LoginListener.a(LoginListener.java:42) [
    craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:160
    ) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craf
    tbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:6
    67) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:2
    60) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:5
    58) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    :469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.NullPointerException
            at jr.net.me.money.Salary.onGetScoreboard(Salary.java:49) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0
    _45]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0
    _45]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
    .7.0_45]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_45]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:292) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
            ... 14 more
    [17:30:34 INFO]: xEpisolonxX[/127.0.0.1:53707] logged in with entity id 1 at ([w
    orld] 299.48501213080203, 57.0, -675.133486740703)
    >
    This line
    Code:
         
    econ.depositPlayer(event.getPlayer().getName(), 20.00);
    
     
  6. Offline

    xepisolonxx

    xtechgamer735
    Main class
    Code:
    public class Main extends JavaPlugin implements Listener {
     
          public static Economy econ = null;
     
       
            public void onEnable() {
                if (!setupEconomy() ) {
     
                    getLogger().severe(String.format("[%s] - Disabled due to no Vault dependency found!", getDescription().getName()));
                    getServer().getPluginManager().disablePlugin(this);
                   
                    return;
                   
                }
                getCommand("build").setExecutor(new Build());
                PluginManager pm = Bukkit.getPluginManager();
               
                  pm.registerEvents(this, this);
                  pm.registerEvents(new DDListener(this), this);
                  pm.registerEvents(new Salary(), this);
                  pm.registerEvents(new Build(), this);
                  pm.registerEvents(new Shipment(this), this);
     
     
                getLogger().info("Plugin has been enabled!");
                Bukkit.getServer().getPluginManager().registerEvents(this, this);
            }
       
           
            private boolean setupEconomy()
            {
                RegisteredServiceProvider<Economy> economyProvider = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
                if (economyProvider != null) {
                    econ = economyProvider.getProvider();
                }
     
                return (econ != null);
            }
    }
    
     
  7. Right, watch this video to learn about the vault api and to make its setup properly. I can see some bits are different

    Check this one out too:
     
  8. Offline

    mythbusterma

    xtechgamer735

    I have no idea what you're on about, his Vault set up is just fine, and recommending YouTube tutorials to make his code "fall in line" with whatever your idea of perfect integration is isn't going to help him.

    xepisolonxx

    Don't bother with the "tutorials," where is your "econ" being declared in Salary?
     
  9. Offline

    xepisolonxx

    mythbusterma
    Code:
    public class Salary implements Listener{
     
        public static Economy econ = null;
      
     
  10. Offline

    mythbusterma

    @xepisolonxxo

    If you MUST make "econ" public and static, at least get it from the main class...
     
Thread Status:
Not open for further replies.

Share This Page