Dependencies acting weird

Discussion in 'Plugin Development' started by LRFLEW, Aug 18, 2011.

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

    LRFLEW

    I made a plugin (from the code from Nijikokun's Register) and called it Register (as the name in the plugin.yml file and as the jar) with soft dependencies with the compatible economy plugins. With my plugin that I'm working on hooks into it, when I try to add Register as a hard dependency (as "depend: [Register]" in the plugin.yml file), but when I try to load it, I get this error:
    Code:
    [SEVERE] Could not load 'plugins/eShop.jar' in folder 'plugins': Register
    org.bukkit.plugin.UnknownDependencyException: Register
    	at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133)
    	at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:213)
    	at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136)
    	at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:143)
    	at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:110)
    	at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:51)
    	at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:133)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:337)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    If I don't declare it as a dependency, both plugins work perfectly, however I want to declare it as a dependency as I'm going to add some actions to the hook during enable, and I need it to load after Register. Any idea what's going on?
     
  2. Offline

    nisovin

    I'm pretty sure Register isn't actually a plugin, so it can't be added as a dependency. It doesn't get loaded the way plugins do.
     
  3. Offline

    LRFLEW

    somebody didn't read the entire post :p

    I made a plugin and used his code as the base. I added a class extending JavaPlugin and added it as main to plugin.yml like I'm suppose to

    whoops, I did use brackets, but forgot to write it as it is in the file :p. (if that was the problem, the stack trace would read differently)
    It reads exactly as
    Code:
    depend: [Register]
    I still have the problem, to enfesize

    I still don't have an answer

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

    Coryf88

    Can you post the entire contents of your plugin.yml files for eShop.jar and Register.jar?
     
  5. Offline

    LRFLEW

    Register.jar:
    Code:
    name: Register
    version: 0.1
    main: com.nijikokun.register.Register
    description: >
                 This is an implementation of Nijikokun's Register
                 designed for easy implementation by LRFLEW
    author: Nijikokun
    website: http://forums.bukkit.org/threads/16849/
    softdepend: [iConomy, BOSEconomy, Currency]
    eShop.jar:
    Code:
    name: eShop
    main: com.LRFLEW.bukkit.eShop.EShop
    version: b.2
    website: http://lrflew.ismywebsite.com/
    author: LRFLEW
    depend: [Register]
    description: >
                 a command based iConomy shop
    commands:
      shop:
        description: eShop command
        usage: |
               /<command> buy [Item Id|Name[:DATA]] [Ammount]
               /<command> sell [Item Id|Name[:DATA]] [Ammount]
               /<command> check [Item Id|Name[:DATA]]
    
    permissions:
      eShop:
        description: give access to entire shop
        default: true
        children:
          eShop.buy: true
          eShop.sell: true
      eShop.buy:
        description: give access to /shop buy
        children:
          eShop.check: true
      eShop.sell:
        description: give access to /shop sell
        children:
          eShop.check: true
      eShop.check:
        description: give access to /shop check
    If you want to see the register jar I use, it's in the "dist" folder in https://github.com/LRFLEW/Register.

    I will upload the shop jar soon

    Somebody? Anybody? I need an answer to this

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  6. You shot it in the foot. like plexico burres.
     
  7. Offline

    EdTheLoon

    You don't need to add Register as a dependency as Register is added to your source code.
     
  8. Offline

    LRFLEW

    That isn't helpful, so I'm guessing you have no clue. Otherwise, MAKE SENSE!

    SOMEBODY didn't read the entire post :p
     
  9. Offline

    EdTheLoon

    What I meant is you don't need to add Register as a dependency in your plugin.yml. If you did then that would mean that every server using your plugin would need to have Register installed as a plugin which is not what was intended by Nijikokun. I believe what is meant when he said using it as a dependency library is that you add it as a library within your project that is compiled into your .jar file when you build your project. My main point here is that you don't need to add Register as a dependency in your plugin.yml because Register is not a plugin. I did read the entire post, I just wasn't very clear in my first post :)

    Edit: Also, I don't understand why you need to make Register a plugin?
    Edit2: I've just temporarily changed the plugin.yml of a plugin on my server to depend on Register and it worked fine...
    Edit3: If I remove Register.jar then it get's the error you've posted. Which leads me to ask, have you added Register.jar to your plugin folder?
     
  10. Offline

    LRFLEW

    I did, but I'll try messing with it

    EDIT: nope, still get the error.

    EDIT2: can you help me test it with this

    The reason I'm making it it's own plugin is that I'm playing with dependencies, and giving the one plugin soft dependencies and playing with how hooking works.

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

    EdTheLoon

    Worked fine:

    Code:
    04:20:04 [WARNING] [Register] No Meathod Found.  Plugins may not work
    04:20:04 [INFO] Register version 0.1 is enabled and avaiable for hooking!
    04:20:04 [SEVERE] [eShop] plugins/eShop/item.price.txt has been created you now need to fill up the file with each line reading the numbers for: "ID [DATA] BUY SELL"
    04:20:04 [WARNING] [eShop] plugins/eShop/item.local.txt has been created you now should fill up the file with each line reading: "NAME ID [DATA]"
    04:20:04 [WARNING] [eShop] plugins/eShop/plguin.local.txt has been created. you can change the messages the player sees by editing that file
    04:20:04 [INFO] eShop version b.2 is enabled!
    And yes it's 04:20 in the morning; I have work tomorrow so I'll be off now. Good luck :)
     
  12. Offline

    LRFLEW

    hm............

    then what the F is wrong on my end? :p

    WHOA new development:

    It gives me an error when loading eShop.jar finding Register.jar, but it can find it if I rename it ZeShop.jar

    maybe it's a loading order thing? Does it make a difference if it's happening on Mac OS Lion?

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

    EdTheLoon

    I don't think that should make any difference as the depend : [Register] just tells Bukkit to load the plugin once Register is enabled. My test ran fine on Ubuntu
     
  14. Offline

    LRFLEW

    hm, this sounds like this may need to be a ticket in leaky :p. I don't know why it doesn't work for me, yet it does for you :p. I could always label it as "_Register.jar" and claim that it's standard for libraries like that :p
     
    tips48 likes this.
Thread Status:
Not open for further replies.

Share This Page