[ECO/FIX]FayConomy v1.4 - iConomy to Essentials Eco Bridge [740]

Discussion in 'Inactive/Unsupported Plugins' started by xeology, Apr 28, 2011.

  1. Offline


    FayConomy - iConomy to Essentials Eco Bridge:
    - Doubles as Essentials Eco API - EcoAPI
    Version: v1.4


    Use these if you are using the new version! ONLY USE 1 BY THE VERSION YOU NEED!


    Ever want all those awesome iConomy plugins for Essentials Eco? Are you a developer and wanted an easy API for Essentials Eco? Well guess what! I got your solution!

    FayConomy (Fake - iConomy) is a mock API of iConomy's API while pretending to be iConomy. It will take iConomy API calls and reformat and redirect them directly into Essentials Eco!

    FayConomy also supports non-player accounts separate from Essentials but following their standards! Now you can have plugins that work with such features in iConomy such as iCoLand.

    If you are curious on how it is done the source is in the JAR and FULLY annotated. To develop using the API just develop as if it were iConomy using the iConomy JAR.

    WARNING: Do NOT attempt to run this with iConomy or without Essentials Eco! Do NOT delete the config.yml in the iConomy folder, this belongs to FayConomy. If you have a file with that name PRIOR to installing FayConomy then back it up and remove it!

    • Bridges iConomy API over to Essentials Eco!
    • Custom API for Essentials Eco that is simple, easy and intuitive!
    • Bridges Deprecated API Functions for reverse compatibility
    • Fixes improper use of the API and makes it work regardless of the improper usage
    • Makes iConomy plugins work with Essentials Eco!
    • Adds NPC account support to Essentials Eco!
    • Change the name of the Currency!
    • Basic Persistance with configurable save times (in minutes!)
    Download The Plugin

    Source Code is in the JAR

    • Just install the JAR
    • Run once, then open the iConomy\config.yml and change SaveRate: 10 to any amount in minutes that you may want!
    • Open the iConomy\config.yml and change CurrencyName and MultipleCurrencyName to whatever you like!
    Tested Plugins:

    • CookieMonster
    • iCoLand
    • MultiVerse
    • Towny

    • Create a method for storing non-player money in Essentials
    • Bug fixes? +4
    • Optimization As optimized as it will get, no loops, no constants, no arrays, NOTHING
    • Get rid of my hacky Essentials iConomy Check bypass (ALMOST!)

    Show Spoiler

    Version 1.4
    • Added Essentials Eco API, EcoAPI. Easier, less confusing and more intuitive. ONLY SUPPORTS ESSENTIALS!
    Version 1.3
    • Now allow improper iConomy API usage and fixes the negative results of such usage!
    • Added Currencyname and MultipleCurrencyName.
    Version 1.2
    • Added left out iConomy API, even the Deprecated ones!
    • Added NPC support!
    • Added basic lightweight persistance Minor fixes
    Version 1.1
    • Removed ALL loops
    • Removed ALL arrays
    • Removed ALL methods for storing
    • Fixed decimals messing up essentials, essentials just doesn't handle them well so I truncate!
    • Direct player access opposed to storing player references on login
    Version 1.0b
    • Fixed the pesky ArrayIndexOutofBounds error, sorry guys, should have tested better!
    Version 1.0
    • Released

    Essentials Eco API - For Devs!
    Show Spoiler
    First off you will want to make sure you are checking for FayConomy so your not hooking into iConomy. Here is what you put in your main somewhere,

    Show Spoiler

        private void detectFay() throws NoSuchMethodException{
            if (com.nijiko.coelho.iConomy.iConomy.isFay()){
                System.out.println("FayExtended - Linked with FayConomy!");
            catch(Throwable ex){
                System.out.println("FayExtended - YOU NEED FAYCONOMY!");
                throw new NoSuchMethodException();
            System.out.println("FayExtended - YOU NEED FAYCONOMY!");

    Put this in your onEnable()


    Put this in the import area of whatever class is going to use FayConomy hooks,

    import com.nijiko.coelho.iConomy.EcoAPI;
    if you will be using the Essentials Version of this it will be
    import com.earth2me.essentials.EcoAPI;
    Here are a few rules, follow them well!

    Show Spoiler

    Accounts for npc's must be made first.

    Do not bother will decimals right now they will be truncated until Essentials Eco supports them.

    You will have to have your methods using the following hooks throw NoSuchMethodException, this is because that is the only way I can stop Essentials Eco calling to FayConomy thinking it is iConomy.

    The API will NEVER have anything removed or reformatted. I will ONLY change their internals in a way that does not break plugins unless some act of GOD stops me from keeping this promise.

    I may add new things, I may not. Doubles will be supported eventually!

    These are the player account checks

    Show Spoiler

    EcoAPI.getMoney(String player);

    - This gets the player's balance
    !Returns double

    EcoAPI.isNegative(String player);

    -This will see if it the player's balance is negative or not
    !Returns boolean

    EcoAPI.hasEnough(String player, double amount) ;

    - Will see if the player can afford amount
    !Returns boolean

    EcoAPI.hasMore(String player, amount);

    - Will see if the player has more than the amount
    !Returns boolean

    EcoAPI.hasLess(String player, amount);

    -Will see if the player has less than the amount
    !Returns boolean

    EcoAPI.getCurrency() ;

    - This will return the currency set by the admin
    !Returns String


    - This will return the currency set by the admin in plural
    !Returns String

    These are the player account modifiers

    Show Spoiler

    EcoAPI.setMoney(String player, double amount);

    -This will set the player's balance

    EcoAPI.add(String player, amount);

    - This will add the amount to the player's balance

    EcoAPI.subtract(String player, amount);

    - This will subtact from the player's balance

    EcoAPI.multiply(String player, double multiplier);

    -This will multiply the player's balance by the multiplier.

    EcoAPI.multiply(String player, double dividend);

    -This will divide the player's balance by the dividend.

    EcoAPI.resetBalance(String player);

    - This will reset the player's balance to 0!


    Show Spoiler

    EcoAPI.newAccount(String npc);

    - This will generate a new npc account, it will not recreate existing accounts!
    !Returns boolean, true for success and false for already exists!

    EcoAPI.accountExist(String Name);

    -This will return if the npc's account exists
    !Returns boolean

    EcoAPI.removeAccount(String name);

    - This will remove an EXISTING npc account!

    • Makers of Essentials
    • Makers of iConomy
    • Guys on IRC for aid with my iConomy Check Bypass (one was scared of what I was doing lol)
    • Me for the time and code, Xeology
    Xordaii and KidCanada like this.
  2. Offline


    com/iConomy/iConomy <--- looking for iconomy 5.0 this only bridges iconomy 4.65 HOWEVER Essentials will be releasing a version in some time (dont ask when, dont know, it will be done when it is done I spose) which includes a bridge for iconomy 4.65 AND iconomy 5.

    I know, I integrated it in ;)
    quickclay likes this.
  3. Offline


    Oh ok ! And do you know approximately when this feature will come ? monthes or weeks ?
  4. Offline


    Very unsure, but if all goes well it comes with a very special surprise ;) but SHHHH! it's a surprise!
  5. Offline


    Essentials seems to be interrupting things now on 2.2.11 since integration has started. I'm really on the edge of my seat waiting for the essentialsicobridge

    When purchasing land through icoland I get an internal error and this console message.

    Anyway, not that it probably matters but here is the error.

    07.05 02:42:50 [Server] INFO     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    07.05 02:42:50 [Server] INFO     at me.slaps.iCoLand.iCoLandCommandListener.onCommand(iCoLandCommandListener.java:241)
    07.05 02:42:50 [Server] INFO     at me.slaps.iCoLand.iCoLandCommandListener.buyLand(iCoLandCommandListener.java:648)
    07.05 02:42:50 [Server] INFO     at me.slaps.iCoLand.iCoLandCommandListener.purchaseLand(iCoLandCommandListener.java:582)
    07.05 02:42:50 [Server] INFO     at com.nijiko.coelho.iConomy.system.Account.getBalance(Account.java:49)
    07.05 02:42:50 [Server] INFO     at com.nijiko.coelho.iConomy.userConverter.usrConv(userConverter.java:14)
    07.05 02:42:50 [Server] INFO Caused by: java.lang.NoSuchMethodError: com.earth2me.essentials.User.get(Lorg/bukkit/entity/Player;)Lcom/earth2me/essentials/User;
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:634)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:640)
    07.05 02:42:50 [Server] INFO     at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:677)
    07.05 02:42:50 [Server] INFO     at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:255)
    07.05 02:42:50 [Server] INFO     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
    07.05 02:42:50 [Server] INFO     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    07.05 02:42:50 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'icl' in plugin iCoLand vv2.45
    07.05 02:42:50 [Server] SEVERE null
  6. Offline


    Are you using fayconomy with essentials dev build? :confused:
  7. Offline


    no with version 2.2.13

    There is no iconomybridge.jar file in essentials yet from what i can see but there are some things in the config.yml that reference it so I stuck fayconomy back in and I get these messages. Do you know when essentials plans to ship the iconomybridge.jar file?
  8. Offline


    Wasn't aware that version went live. . . .
    Only use one depending on the version of iConomy you need bridged!
  9. Offline


    Man I'm sorry, about this. Removed fayconomy and the iconomy folder. Installed the version you posted above into the plugins folder and was given this.

    07.05 20:12:07 [Server] INFO     at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135)
    07.05 20:12:07 [Server] INFO     at java.lang.Class.asSubclass(Class.java:3018)
    07.05 20:12:07 [Server] INFO java.lang.ClassCastException: class com.nijiko.coelho.iConomy.iConomy
    07.05 20:12:07 [Server] SEVERE Could not load 'plugins/EssentialsiConomyBridge.jar' in folder 'plugins': 
  10. Offline


    Yeah the main got screwed up some how. It's fixed, just redownload. Sorry for that.
  11. Offline


    Thanks, cookiemonster is working

    icoland latest gives me this

    07.05 23:07:55 [Server] INFO     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
    07.05 23:07:55 [Server] INFO     at me.slaps.iCoLand.iCoLand.onEnable(iCoLand.java:124)
    07.05 23:07:55 [Server] INFO     at me.slaps.iCoLand.iCoLand.tryEnablePlugins(iCoLand.java:157)
    07.05 23:07:55 [Server] INFO     at me.slaps.iCoLand.iCoLand.setup(iCoLand.java:172)
    07.05 23:07:55 [Server] INFO     at me.slaps.iCoLand.LandDBH2.<init>(LandDBH2.java:34)
    07.05 23:07:55 [Server] INFO     at me.slaps.iCoLand.LandDBH2.initDB(LandDBH2.java:58)
    07.05 23:07:55 [Server] INFO     at me.slaps.iCoLand.LandDBH2.tableExists(LandDBH2.java:390)
    07.05 23:07:55 [Server] INFO java.lang.NullPointerException
    07.05 23:07:55 [Server] SEVERE null loading iCoLand vv2.45 (Is it up to date?)
    07.05 23:07:55 [Server] SEVERE     at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    07.05 23:07:55 [Server] SEVERE     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
    07.05 23:07:55 [Server] SEVERE     at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
    07.05 23:07:55 [Server] SEVERE     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
    07.05 23:07:55 [Server] SEVERE     at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
    07.05 23:07:55 [Server] SEVERE     at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:94)
    07.05 23:07:55 [Server] SEVERE     at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:116)
    07.05 23:07:55 [Server] SEVERE     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:218)
    07.05 23:07:55 [Server] SEVERE     at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:632)
    07.05 23:07:55 [Server] SEVERE     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
    07.05 23:07:55 [Server] SEVERE     at me.slaps.iCoLand.iCoLand.onEnable(iCoLand.java:124)
    07.05 23:07:55 [Server] SEVERE     at me.slaps.iCoLand.iCoLand.tryEnablePlugins(iCoLand.java:157)
    07.05 23:07:55 [Server] SEVERE     at me.slaps.iCoLand.iCoLand.setup(iCoLand.java:172)
    07.05 23:07:55 [Server] SEVERE     at me.slaps.iCoLand.LandDBH2.<init>(LandDBH2.java:34)
    07.05 23:07:55 [Server] SEVERE     at me.slaps.iCoLand.LandDBH2.initDB(LandDBH2.java:40)
    07.05 23:07:55 [Server] SEVERE     at java.lang.Class.forName(Class.java:169)
    07.05 23:07:55 [Server] SEVERE     at java.lang.Class.forName0(Native Method)
    07.05 23:07:55 [Server] SEVERE     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    07.05 23:07:55 [Server] SEVERE     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    07.05 23:07:55 [Server] SEVERE     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
    07.05 23:07:55 [Server] SEVERE     at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
    07.05 23:07:55 [Server] SEVERE     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    07.05 23:07:55 [Server] SEVERE     at java.security.AccessController.doPrivileged(Native Method)
    07.05 23:07:55 [Server] SEVERE     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    07.05 23:07:55 [Server] SEVERE java.lang.ClassNotFoundException: org.h2.Driver
  12. Offline


    hey whats now with "fayextended" ? i thinking about to use iconomy again because the "money for online time" feature ( like every hour 10 coins or something like this) its really important for me :(
  13. Offline


    This is an issue with that damn h2 file lol. Use this in your startup (overwrite JUST the craftbukkit part with this, put the h2.jar file in your root folder.

    -cp h2.jar:craftbukkit.jar org.bukkit.craftbukkit.Main server-restart-alerts=3h,1h,30m,10m,5m,1m

    This and more, it's about halfway done and it will make the server admins of the world shit bricks >: D I'll JUST say the stock market just got finished up!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 14, 2016
  14. Offline


    hm sounds really cool but i need only this one feature xD when this functions its finished included, can you then give a pre version for public ? :D:D

    edit: why is in the download two parts of fayconomy ? EssentialsiConomyBridge5.jar and EssentialsiConomyBridge.jar ... what is the difference ?
  15. Offline


    iconomy 5 killed any possibility of reverse compatibility in one plugin so the bridge had to be split. And Yes I may be releasing a pre-version.
  16. Offline


    ahh okay understand :) okay thanks :)
  17. Offline


    I'd like to see the "Persisting NPC Data" spam either eliminated or optional. Thanks.. ps: This is awesome.
  18. Offline


    Amen, son....I love *especially* authors who provide bridges between faction oriented plugins....this and the groupmanager bridge are prime targets. Winner winner chicken dinner. I did end up talking some smack about Essentials, but I found that the alternative was buggy as all get out. After a fresh build of the server, I'm experiencing NO errors, no problems, no lag....even with the plethora of plugins I run.

  19. Offline


    I r confused nao. I asked them how to get the fayconomy deal, but they haven't responded yet. Any clarification on what exactly is going on? I would LOVE to install fayconomy essentials that can run iconomy5 stuff, but I also don't want to screw up the server by adding the wrong thing.

    Basically I know this probably has a simple answer, but what do I do to get the fayconomy essentials if it actually exists?
  20. Offline


    Im using Essentials 2.2.15 which file should i download? because rigth now Essenstials is giving me KR currncy and not coins for some reason... i didnt install this since it says this is included in essentials, or did i get it wrong ?
  21. Offline


    Lets make this clear. We did not include it in our distribution because of the way Xeology implemented the bank accounts. These are the new features in iConomy 5. It will create many user files for non-existing users in our userdata directory, that makes it's very messy. Once we clean up the code, we might add it again. In general I want to point every developer that is creating a economy plugin to the Register plugin.
  22. Offline


    If I'm using Essentials 2.2.3 and iConomy 4.65, then which jar do I download? :confused:.
  23. Offline


    I'd take a thorough look at the essentials page, but i guess what you're looking for can be found here http://dl.dropbox.com/u/18601879/EssentialsiConomyBridges.rar

    Use the one without the "5" in it.

    Hope this helps.

    edit* I just noticed this, but I actually have no clue why you posted that in a thread about a plugin that was made to remove your need for iconomy...I suggest reading this thread and the essentials wiki/threads all over again :/
  24. Offline


    Im using 2.2.15 essentials which one should i use ? i used the bridge5 it bugs essentails and makes the currency not coins but KR
  25. Offline


    Have you tried the other bridge?
  26. Offline


    Once we upgrade to essentials 2.2.17, should we remove this plugin? (it claims to support iconomy 4/5)

    Cookiemonster generates the following error: (CB766, EssentialsEcoBridge.jar)
    2011-05-16 07:17:12 [SEVERE] [CookieMonster] Unexpected Error processing Reward
    at org.yaml.snakeyaml.emitter.Emitter.expectNode(Emitter.java:399)
    at org.yaml.snakeyaml.emitter.Emitter.access$1600(Emitter.java:64)
    at org.yaml.snakeyaml.emitter.Emitter$ExpectDocumentRoot.expect(Emitter.java:373)
    at org.yaml.snakeyaml.emitter.Emitter.emit(Emitter.java:216)
    at org.yaml.snakeyaml.serializer.Serializer.serializeNode(Serializer.java:177)
    at org.yaml.snakeyaml.serializer.Serializer.serializeNode(Serializer.java:203)
    at org.yaml.snakeyaml.serializer.Serializer.serialize(Serializer.java:114)
    at org.yaml.snakeyaml.representer.BaseRepresenter.represent(BaseRepresenter.java:68)
    at org.yaml.snakeyaml.Yaml.dumpAll(Yaml.java:221)
    at org.yaml.snakeyaml.Yaml.dump(Yaml.java:205)
    at org.bukkit.util.config.Configuration.save(Configuration.java:103)
    at com.earth2me.essentials.UserData.setMoney(UserData.java:86)
    at com.earth2me.essentials.User.setMoney(User.java:313)
    at com.earth2me.essentials.api.Economy.setMoney(Economy.java:98)
    at com.earth2me.essentials.api.Economy.add(Economy.java:111)
    at com.nijiko.coelho.iConomy.system.Account.add(Account.java:67)
    at com.pi.coelho.CookieMonster.CMEcon.addMoney(CMEcon.java:74)
    at com.pi.coelho.CookieMonster.CMRewardHandler.GivePlayerCoinReward(CMRewardHandler.java:78)
    at com.pi.coelho.CookieMonster.CMRewardHandler.GivePlayerCoinReward(CMRewardHandler.java:18)
    at com.pi.coelho.CookieMonster.CMEntityListener$MonsterAttack.rewardKill(CMEntityListener.java:127)
    at com.pi.coelho.CookieMonster.CMEntityListener.onEntityDeath(CMEntityListener.java:101)
    at org.bukkit.plugin.java.JavaPluginLoader$48.execute(JavaPluginLoader.java:524)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:289)
    at net.minecraft.server.EntityLiving.r(EntityLiving.java:470)
    at net.minecraft.server.EntityLiving.a(EntityLiving.java:449)
    at net.minecraft.server.EntityLiving.damageEntity(EntityLiving.java:393)
    at net.minecraft.server.EntityMonster.damageEntity(EntityMonster.java:47)
    at net.minecraft.server.EntityHuman.d(EntityHuman.java:532)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:815)
    at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:372)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)

    Here's the startup sequence:
    2011-05-16 07:02:34 [INFO] [CookieMonster] Attached to iConomy.
    2011-05-16 07:02:34 [INFO] [CookieMonster] v1.3.4 loaded successfully.
    2011-05-16 07:02:34 [INFO] [CookieMonster] Developed by: [jascotty2, Coelho]

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 14, 2016
  27. Offline


    So let me get this straight...I don't need this anymore because Essentials has this built in now?
  28. Offline


    no, op needs updated. essentials needs this OR iconomy or one of the others, like BOSEconomy. The purpose of this feels more like it is to bypass using iconomy in the first place. For instance, I don't NEED a bank on my server, which is what iConomy gives me, because Essentials already handles everyone having a personal account (think wallet.) I would go back to using this instead of iConomy in a heartbeat, but it hasn't updated. iConomy is great, but has more features than I want to deal with. This just simply makes the plugins that need iConomy handles think iConomy has been installed and properly pass the handles.
  29. Offline


    any news on this lately?
  30. Offline


    he hasn't been updating it.

    I would think because Register is out now. Plugin owners can include Register in their plugins. Register does almost exactly the same as this plugin, but the programmers use it, not the server admins. Register makes it so every economy plugin, including Essentials since they are using it too, is usable with any plugin which ties into economies.

    Therefore, because Essentials has Register, you only have to make sure the other plugins you get also have Register or support other economy plugins. I can think of several that did before either this or Register came out. You just have to read up on each of them.
  31. Offline

    Daniel Heppner

    But Essentials is a buggy piece of crap. Why not just use iConomy? Nijikokun is an awesome developer, and I'm sure the Essentials team is too. The difference is that Essentials packs everything into a single plugin, which makes it hard to maintain, and therefore really buggy. It has a bug which lights random fires around your world.

Share This Page