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

    AlbireoX

    Wow, really nice plugin Nijiko. 5 stars!
     
  2. Offline

    Acrobot

  3. Offline

    DrAgonmoray

    @Nijikokun
    Any idea why I am getting these errors when I start up my plugin using register?
    Code:
    :46:28 [SEVERE] Could not load 'plugins\RandomSigns.jar' in folder 'plugins':
    java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:199)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:122)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:118)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:89)
        at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:51)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:132)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.Error: Unresolved compilation problems:
        The import com.nijiko cannot be resolved
        The import com.nijiko cannot be resolved
        iConomy cannot be resolved to a type
        iConomy cannot be resolved to a type
        iConomy cannot be resolved to a type
        iConomy cannot be resolved to a type
        iConomy cannot be resolved to a type
        iConomy cannot be resolved to a type
        iConomy cannot be resolved to a type
        iConomy cannot be resolved to a type
        iConomy cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
        Account cannot be resolved to a type
    
        at com.nijikokun.register.payment.methods.iCo4.<init>(iCo4.java:3)
        at com.nijikokun.register.payment.Methods._init(Methods.java:43)
        at com.nijikokun.register.payment.Methods.<init>(Methods.java:26)
        at net.livecraft.DrAgonmoray.RandomSigns.RSPluginListener.<init>(RSPluginListener.java:13)
        at net.livecraft.DrAgonmoray.RandomSigns.RandomSigns.<init>(RandomSigns.java:14)
    Edit:

    Nevermind, apparently I have to use the economy libraries. Now it works. :D
     
  4. Offline

    Nijikokun

    Acrobot likes this.
  5. Offline

    riuthamus

    Epic! Thanks for all your help.
     
  6. Offline

    beatcomet

    Can anyone explain how to use it pleas?
     
  7. Offline

    Dimochka

    Is it possible to make Register support optional so that you may not install Register.jar if you don't want to? How?

    I don't understand the package name clashing issue.

    If I choose the source code sharing way, I will have to update package names whenever I update Register source in my project, right?

    If I choose the other way, do I have to compile Register.jar into my plugin jar? Will it guarantee that no clashes will occur if there's another plugin installed which also has Register.jar built in?

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

    ashtheking

    Nice. Could you try and support my plugin. PM me if your interested.
     
  9. Offline

    narrowtux

    Is there a way you could add events to this?
    Just a few basic ones, like when players money changes.
     
    Dimochka likes this.
  10. Offline

    wouter0100

    I got this error:
    When i try to start up.
    I have tested on CB 1000 with iConomy.
    line 15 = this.Methods = new Methods();
    line 77 = pm.registerEvent(Event.Type.PLUGIN_ENABLE, new AutoVIPServerListener(this), Priority.Monitor, this);
     
  11. Offline

    _ralts

    Great! But that doesn't fit well with the AGPL, which forces everyone who uses your library to use the AGPL too.

    I think it would be better with the FreeBSD license, which says exactly that.
     
  12. Offline

    Nijikokun

  13. Offline

    Dimochka

    I have another problem. A certain plugin stores a list of players in lower-case. I need to find their Register accounts, but economy methods have case-sensitive account lookup. Currently I have to iterate through matchPlayer results (which performs a case-insensitive search for existing players) and see if they have Register account, but I'm not sure if this matchPlayer does give result if player is offline. Any hints on how to do this better?
     
  14. Offline

    Nijikokun

    @snowleo @Dark_Balor @AOD_Batman @Acrobot @fullwall @ChrizC @aPunch @Codisimus @TAT @_ralts @wouter0100 @ashtheking @narrowtux

    Updated Register, supports iConomy 6, MultiCurrency (Thanks @Acrobot), BOSE7 & 6, and more!

    Added commenting and switched over to AOL license and attributed everyone who has contributed to the project as per AOL licensing agreements.

    https://github.com/iConomy/Register

    Commits:
    https://github.com/iConomy/Register/commits/master

    Distrobution:
    https://github.com/iConomy/Register/raw/master/dist/Register.jar
     
    ashtheking and Acrobot like this.
  15. Offline

    8thDimension

    +1 Nijikokun

    Really helpful :D
     
  16. Offline

    ashtheking

    You might want to update your post then, @Nijikokun
     
  17. Offline

    Nijikokun

  18. Offline

    SwearWord

    This didn't work for me until I the try/catch block at class.forName

    I'll double check later, thanks for this, physically currency is done beautifully.
     
  19. Offline

    Dark_Balor

    If you are interested, I added the Register API in my maven-repo (public) http://www.gestdown.info:8888/artifactory/

    You just have to add in your pom.xml
    Code:
            <repository>
              <snapshots>
                <enabled>false</enabled>
              </snapshots>
              <id>central</id>
              <name>libs-release</name>
              <url>http://www.gestdown.info:8888/artifactory/libs-release</url>
            </repository>
    
    To have access to it. I'm trying to keep it up-to-date :)
     
  20. Offline

    desht

    Nice plugin, will be using it. But I noticed a bunch of compiler warnings from the various iConomy methods (I'm using Eclipse):

    Code:
    The static field iConomy.Banks should be accessed in a static way	iCo5.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 44	Java Problem
    The static method format(double) from the type iConomy should be accessed in a static way	iCo5.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 36	Java Problem
    The static method format(double) from the type iConomy should be accessed in a static way	iCo6.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 35	Java Problem
    The static method getAccount(String) from the type iConomy should be accessed in a static way	iCo5.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 56	Java Problem
    The static method getBank() from the type iConomy should be accessed in a static way	iCo4.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 33	Java Problem
    The static method getBank() from the type iConomy should be accessed in a static way	iCo4.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 45	Java Problem
    The static method getBank() from the type iConomy should be accessed in a static way	iCo4.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 53	Java Problem
    The static method getBank(String) from the type iConomy should be accessed in a static way	iCo5.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 52	Java Problem
    The static method getBank(String) from the type iConomy should be accessed in a static way	iCo5.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 60	Java Problem
    The static method hasAccount(String) from the type iConomy should be accessed in a static way	iCo5.java	/ChessCraft/src/com/nijikokun/register/payment/methods	line 48	Java Problem
    
    Just to confirm, assuming I go with option 1 above, should I rename only com.nijikokun.register.payment, or also com.nijikokun.register.payment.methods?

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

    hatstand

    Both of them can cause the package conflicts, so it would be a good idea to do both.
     
  22. Offline

    MiHo

    It would be great if it would be build by maven, so developers does not have to care about updates and only need to add a dependency to their poms. (Currently i have to use that with a personal fork)
     
  23. Offline

    Danton1983

    i am totally lost most plugins you throw a jar file in ur plugin folder, no jar file. is there an install guide anywhere for this?
     
  24. Offline

    ltguide

    This is not a plugin for end-users. This is a library for plugin developers to add economy support to their plugins.
     
  25. Offline

    cholo71796

    @Danton1983
    As @Itguide said, this is not a plugin- you'll find plugins in releases/submissions/WIP forums
     
  26. Offline

    Hoddie54

    Any way to grab a list of all players with accounts?
     
  27. Offline

    LRFLEW

    I know iConomy rounds all money amounts to two decimal places (so 0.33333... will just be 0.33). Does all the plugins that this supports do that too? If not, is there a way to easily tell what the smallest value storable is?
     
  28. Offline

    Southpaw018

    Hey, all. I'm still relatively new to Java, and I have a feeling my issue is related to that :)

    Here's some oddness: I can't get a test plugin to load with Register. At all. Nothing happens, nothing shows in the server logs. I've traced it to this line in my ServerListener:

    Code:
        public TestServerListener(Test plugin) {
            this.plugin = plugin;
            Methods = new Methods(); //<-- with this line commented out, it loads
        }
    I'm including Register as an external jar on the build path. Is that it? I tried importing the source code, but Eclipse threw like 100 errors. If I do need to include the source instead of using the jar, do I also need to include the various economy jar files on the build path to resolve the errors?
     
  29. Offline

    ltguide

    This is what I have...
    reference register.jar as external jar
    Export with custom manifest.mf:
    Code:
    Manifest-Version: 1.0
    Class-Path: ../lib/Register.jar
    then i have some code that makes sure register.jar is in the server's /lib folder

    Code:JAVA
    1. try {
    2. Class.forName("com.nijikokun.register.payment.Method");
    3. }
    4. //set useEconomy = false
    5. //copy register.jar from resources to /lib
    6. //inform user they need to restart or economy won't work
    7. }

    here it is live: github
     
  30. Offline

    hatstand

    If you include the source, you'll need to update all the package names to avoid conflicts (and thus crashes), and yes, include all the economy files from the lib folder.

    Also, there's an example of how to set up the listener, and register the events here
     
Thread Status:
Not open for further replies.

Share This Page