Register - Now accepting all Payment Methods (Economy API) [Stable]

Discussion in 'Resources' started by Nijikokun, May 10, 2011.

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

    xZise

    I'm getting the error message, that there is no such class:
    Code:
    java.lang.NoClassDefFoundError: com/nijikokun/register/payment/Methods
            at de.xzise.xwarp.EconomyHandler.<init>(EconomyHandler.java:61)
            at me.taylorkelly.mywarp.MyWarp.onEnable(MyWarp.java:93)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:131)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:109)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused by: java.lang.ClassNotFoundException: com.nijikokun.register.payment.Methods
            at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
            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(ClassLoader.java:321)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
            ... 12 more
    
    Now do I have to pack Register in my plugin jar? Or won't it now work without a plugin supporting Register? The line 61 simply does:
    Code:
    private final Methods methods = new Methods();
    Okay I'm confused: Who is implementing Register? The plugin which uses Register? The plugin which is implementing Register? Or is it a standalone plugin (where is the jar?).

    Fabian
     
  2. Offline

    Nijikokun

    You include the source in your plugin. It's stated in the FAQ.

    Yes, it automatically saves for all transactions.

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

    Archelaus

    Your examples are off and have mistakes in them.
     
  4. Offline

    Auroraah

    Can I just ask, what was wrong with plugins like FayConomy? I had that the whole time and it worked perfectly, I never had any problems with it. But now this has replaced it and I can't make any sense of it, I just have no idea what I'm supposed to do with it. Any help would be greatly appreciated because there are some iConomy dependent plugins that I would really like but I much prefer using Essentials Eco.
     
  5. Offline

    Redyugi

    This is a developers tool, not for server admins. Ask the plugin creators if they can use this to support other economy plugins.
     
  6. Offline

    Auroraah

    I know it's a developers tool, but this has come in place of FayConomy, which was a perfectly fine plugin. tbh, I can't see the point in this. I know my way around a java file and basic programming of them but I just can't make any sense of this one. :)
     
  7. Offline

    jeffadkins51

    Not to be disrespectful/plurish your work or anything, but this seems like a pretty simple plugin yes?
     
  8. Offline

    TAT

    I'm getting some strange problems, don't know if I'm just to tired to see what the problem is or what it is.
    http://pastebin.com/82NhCRfb

    EDIT: Got it to work now
     
  9. Offline

    Sleaker

    please convert this into a library instead of having every plugin author compile it inside of their source.
     
  10. Offline

    chriswong

    Maven support would be nice. Adding a pom.xml file shouldn't be too hard.
     
  11. Offline

    Television

    In your original post, you fail to mention that the "easy", recommended method of bundling this library in with your source code would also force the GNU Affero License upon every plugin that does so. Correct me if I'm wrong.
     
  12. I just can't seem to find my mistake, but it wont load any Economy plugin:

    Here is my Economy class:


    Code:
    public class RCEconomy {
    
        public static Methods Methods;
        public static Method Economy;
    
        /*
         * Initializes the economy methods
         */
        public static void initialize() {
            Methods = new Methods("iConomy");
        }
    
        /*
         * Loads the economy method.
         *
         * @param plugin The plugin that was enabled.
         */
        public static void onEnable(Plugin plugin) {
            // Initialize according to what economy plugin is being enabled
            if (!RCEconomy.Methods.hasMethod()) {
                if (RCEconomy.Methods.setMethod(plugin)) {
                    RCEconomy.Economy = RCEconomy.Methods.getMethod();
                    RCLogger.info(RCEconomy.Economy.getName() + " version "
                            + RCEconomy.Economy.getVersion() + " loaded.");
                }
            }
        }
    And this class is loaded by the pluginListener:

    Code:
    public class RCPluginListener extends ServerListener {
    
        private final RCSkills plugin;
    
        public RCPluginListener(RCSkills instance) {
            plugin = instance;
            RCEconomy.initialize();
        }
    
        @Override
        public void onPluginEnable(PluginEnableEvent event) {
            if (event.getPlugin() != plugin) {
                // Try to load again!
                RCPermissions.onEnable(event.getPlugin());
                RCEconomy.onEnable(event.getPlugin());
            }
        }
    No matter what I do I just wont load the Economy plugin -.-".
    Permissions loads fine however.
     
  13. Offline

    AOD_Batman

    My plugin MobBounty now includes Register. Though I have someone having an issue with it that I can seem to figure out why. They are using iConomy 5 and I've updated to the latest API. Here is the error:

    Code:
    Could not pass event ENTITY_DEATH to MobBounty
    java.lang.NoSuchMethodError: com.nijikokun.register.payment.methods.iCo5$iCoAccount.<init>(Lcom/iConomy/system/Account;)V
        at com.nijikokun.register.payment.methods.iCo5.getAccount(iCo5.java:47)
        at net.mcbat.MobBounty.Listeners.MobBountyEntityListener.onEntityDeath(MobBountyEntityListener.java:192)
        at org.bukkit.plugin.java.JavaPluginLoader$48.execute(JavaPluginLoader.java:577)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
        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:537)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:867)
        at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:401)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    Code for MobBounty can be found here: http://www.github.com/IchigoKyger/MobBounty
     
  14. Offline

    Acrobot

    @AOD_Batman
    If two plugins are running unmodified Register, THIS happens. Is there any way to prevent this, @Nijikokun ?
     
  15. Offline

    AOD_Batman

    You wouldn't by chance know a way to modify it so this doesn't happen?
     
  16. Offline

    Codisimus

    all my plugins run from the original Register.jar and there are no conflicts
     
  17. Offline

    Acrobot

    @Codisimus
    See, there is no conflict if there is a register.jar and you don't use default ones.

    @AOD_Batman
    I think it may work:
    change the package from default one to something like:
    com.Nijikokun.doNotCrashPlease.Register etc
     
  18. Offline

    Codisimus

    I just move the Register.jar into the /lib folder and then access it from there
     
  19. Offline

    Bashoogers

    How to install this :l
     
  20. Offline

    Codisimus

    My plugin users are reporting the Bank Account are not working properly, I think this is bc BOSEconomy BankAccounts are much different than iConomy ones. BOSEconomy has Bank Accounts that don't belong to one person but have many owners.
     
  21. Offline

    Nijikokun

    Wait, someone get on irc and explain what is happening with the modified / unmodified, none of those errors should happen
     
  22. Offline

    AOD_Batman

    Thanks! I just released an update renaming the pack to net.mcbat.Register so this shouldn't cause any package conflicting with other plugins.

    If two plugins are installed on a server that uses the Register API and both plugins use the default package name: com.nijikokun.register.payment. Then it will cause the error posted above. Now there is two ways to fix this.

    1. Rename the com.nijikokun.register.payment package to be in your own personal domain.

    2. Compile the Register API into a JAR and bundle it with your plugin.
     
  23. Offline

    Dark_Balor

    Hi

    One of my user had this exception using Register :
    Code:
    org.bukkit.command.CommandException: Unhandled exception executing command 'gp'
    in plugin VirtualChest v4.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:12
    8)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:2
    81)
    at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:718)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:684)
    
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:677)
    at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:217)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:401)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:311)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NoSuchMethodError: com.nijikokun.register.payment.methods.i
    Co5$iCoAccount.<init>(Lcom/iConomy/system/Account;)V
    at com.nijikokun.register.payment.methods.iCo5.getAccount(iCo5.java:47)
    at com.Balor.bukkit.GiftPost.GiftPostWorker.economyCheck(GiftPostWorker.
    java:690)
    at com.Balor.commands.Buy.execute(Buy.java:75)
    at com.Balor.bukkit.GiftPost.GiftPost.onCommand(GiftPost.java:248)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 12 more
    I'm using Register version 1.8, as an external libraries put in the folder lib with a classpath in the manifest of my plugin.
     
  24. Offline

    Nijikokun

    I'll quote this in the FAQ / Topic
     
  25. Offline

    Nijikokun

    @snowleo @Dark_Balor @AOD_Batman @Acrobot @fullwall @ChrizC @aPunch @Codismus @TAT

    Released 1.9 (info)

    about licensing
    I don't care what yours is or what mine says, as long as you attribute me in some way, I'm fine. Just don't go saying you wrote it. That's all that I care about.

    @Sleaker

    There is a jar file in the /dist/ folder you can use as a dependency rather than use it in your source code.
     
    ChrizC likes this.
  26. Offline

    Codisimus

    It's Codisimus but no worries I watch this thread anyway
    Thanks for the Update.
     
  27. Offline

    TAT

    @Nijikokun
    I have you in my credits file and you are now on the credits in my OP.
     
  28. Offline

    Nijikokun

    Thank you :3!

    Sorry ><

    Fixed in the latest version & for older versions fixed with 935

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

    Dark_Balor

    Good to know, thanks for the notification :)
    And Of course I give you all credits for your great work :)
     
  30. Offline

    GSValore

    I am using BOSEconomy and noticed that a plugin (ATM) wasn't working properly with bank accounts. After looking through the code, I noticed a few issues with the BOSE.java portion.

    When checking for an existing account, it uses the isBankOwner(); this means the members of a bank are never checked, just the owners. Suggest changing it to include a check against isBankMember() if one or the other fails as they are mutually exclusive checks.

    In the methods to modify a bank account (found in BOSEBankAccount inner class), the 'this.name' field is used repeatedly for all the BOSEconomy bank methods. The name field refers to the name of the user, BOSEconomy banks are money pools and use the name of the bank, not the name of the user. The method calls should be changed to this.bank instead.

    Due to those small differences, users are being treated as banks by the code when adding or subtracting amounts. It's a trivial change at least and should alleviate the problem.

    I'm glad there is an API for this, since the economy choice is a matter of preference. So thank you for writing it, Nijikokun.
     
    Codisimus likes this.
Thread Status:
Not open for further replies.

Share This Page