[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


    Can anyone give me the link to Essentials Eco because i cant seem to find it

    thank you
  3. Offline


  4. Offline


    Ok I just upgraded to 1.3 with CB 740, and lottery 0.4.2 and am still getting this error:

    2011-04-30 20:50:01 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'lottery' in plugin Lottery v0.4.2
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:255)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:677)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:640)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:634)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:195)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:370)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:285)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.NoClassDefFoundError: com/nijiko/coelho/iConomy/iConomy
    at net.erbros.Lottery.Lottery.addPlayer(Lottery.java:504)
    at net.erbros.Lottery.Lottery$1.onCommand(Lottery.java:144)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 12 more
    Caused by: java.lang.ClassNotFoundException: com.nijiko.coelho.iConomy.iConomy
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 15 more
  5. Offline


    You didnt install FayConomy in the right place . . . I tested this plugin through and through just now and NEVER got this error but yet got this EXACT error on deleteing the fayconomy plugin . . .
  6. Offline


    Yup. Download was corrupt. Re downloaded and it works, though when I buy a ticket it says "You just bought a ticket for 100 10 coins." though not sure if that's on Fay's end or Lottery's. :)

    EDIT: I just found the currency name setting and changed it. All is working great! :D Thanks.
  7. Offline


    hey can you add the possibility to become money for online time ? like every hour 10 coins or something like this
  8. Offline


    This will be included in FayExtended, a seperate mech plugin that adds all sorts of awesome features. This being a main one.
  9. Offline


    okay, can you tell me a release date for fayextended ?
  10. Offline


    2-3 days, it's a big plugin and have just started working on it.
  11. Offline


    hm okay thanks for information :)
  12. Offline


    Fayconomy seems to rebuild the iconomy config.sys file each time I restart the server with default values. How do I get it to change these settings permanently?
  13. Offline


    First it is the config.yml.

    Second it works for me, just tested again and the save() function is very solid, are you stopping your server correctly?
  14. Offline


    First: just a typo
    Second: just realized you need to stop the server before you change it.. not afterwards. Thanks!
  15. Offline


    *cries quietly in a corner*
    I just got all my players ported to iConomy, took days for them to understand things changed...

    But thank you for giving others the ability to avoid that mess.
  16. Offline


    Thank you for the update!
  17. Offline


    Qoute: "FayConomy v.1.4 iz in ur Bukkitz emulating ur iConomyz and extendingz your Ecoz!

    Love the LOL :) Thank you for this plug-in. I prefer the Essentials Eco, too.
  18. Offline



    Few questions:
    Would this screw up my players balances in any way? (I have tons of players with balances on the server, will it keep the balances and use the same money system)
    Is it compatible with everything in essentials economy, like trade signs, buy signs and everything. (Like will everything work how it does now with just essentials?)
    Possibility of lag? (Is it a resource hog) ?
    Sorry im not too familiar with this thats why questions :p
    Thank you very much for making this btw ! Huge Respects!

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


    Well it doesn't seem to mention this anywhere... I get this message in my server.log:

    [INFO] FayConomy - Persisting NPC data!

    It seems to happen every 10 minutes (which is the save interval I'm using) what does this mean?
  20. Offline


    Its saving your npc data since essentials doesnt handle it yet, set the interval differently, 10 minutes is the default. /plugins/iconomy/config.yml

    Yes and Yes.

    Sorry guys apparently I didnt get alerts for this and I have been working on bridging ico 5.0 and porting EVERYTHING directly INTO essentials for the next release!

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


    Alright looking forward to updates.
  22. Offline


    there will not be any, I integrated this project into the next version of essentials. It will come standard, well not the bridge, but it will be downloadable and more efficient.
  23. Offline


    Oh alright, either way looking forward to this :)
  24. Offline


    I noticed when I updated essentials to 2.2.8 that in the changelog this mod was mentioned, when will it be part of the essentials mod? And after this happens will everything convert automatically or will I have to change the settings in essentials to match what I have for fayconomy (I guess the only thing is refresh rate and currency name)? Also will I have to delete the fayconomy.jar out of my plugins directory after this happens?
    Thanks for taking the time to work with us and answer our questions (especially mine because I feel they may be kind of stupid and answered after this officially becomes part of essentials). I really appreciate the work you've done and are doing and this is an awesome mod, +1 internets to you sir!
  25. Offline


    1. It is already integrated into the DEV build, but dont use that lol
    2. iConomy 5 is already bridged
    3. There is no refresh rate in Essentials iConomy Bridge, it uses a better method
    4. Yes you will need to set your currency names in the Essentials config
    5. Yes you will need to delete your old FayConomy.jar when you use that.
    Hope that helps!
  26. Offline


    I'm going to keep iConomy free of hassles so you guys can continue making amazing things with it. :)
  27. Offline


    Well, hoping we are not doing anything that makes the COMMUNITY uncomfortable here :D After all I seriously believe that we are all here for the COMMUNITY and not self cause, because that would be childish and be detrimental to our grateful users. We would never want to catch them in the cross-fire of old or present grudges.

    However I am always up for friendly competition! Competition is what drives innovation to it's max. Without pairs striving to be better no one would have any drive to try to be better!

    So I say I accept your challenge of best man, because in the end, for better or for worse, we will have driven the development of minecraft economy to its best and highest potentials!
  28. Offline


    Plugin tested with RealShop and it seems to work !

    Good job :) ! Ty a lot.

    Bug : Shop owner's account isn't credited when he's offline. It would be great to fix it :)
  29. Offline


    UNFORTUNATELY, that is impossible to fix as of right now considering essentials does not handle offline players. HOWEVER, the version I have integrated into the dev build of Essentials DOES, both the 4 and 5 bridge. Your best bet would be to use Eco Signs until that is available . . . Coming along nicely from what I see ;)
  30. Offline


    Yes eco signs does handle offline :) Or i think thats what you call it.
    Use essentials economy signs, people buy from them, and when the person is offline he gets his money.
  31. Offline


    I get the following iConomy error in the Stargates plugin, just FYI.
    2011-05-06 11:47:20 [INFO] Stargate v.0.4.6 is enabled.
    2011-05-06 11:47:20 [INFO] [Stargate] Loaded 2 gate layouts
    2011-05-06 11:47:20 [INFO] [Stargate] {world} No stargates for world
    2011-05-06 11:47:20 [INFO] [Stargate] {netherWorld} No stargates for world
    2011-05-06 11:47:20 [INFO] [Stargate] Found Permissions (v2.7)
    2011-05-06 11:47:20 [INFO] [Stargate] Found iConomy (v4.65)
    2011-05-06 11:47:20 [SEVERE] com/iConomy/iConomy loading Stargate v0.4.6 (Is it up to date?)
    java.lang.NoClassDefFoundError: com/iConomy/iConomy
    at net.TheDgtl.Stargate.Stargate.onEnable(Stargate.java:119)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:127)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:632)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:218)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:116)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:94)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassNotFoundException: com.iConomy.iConomy
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:36)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:24)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 11 more

Share This Page