Plugin wont load.

Discussion in 'Plugin Development' started by CraftCreeper6, May 31, 2014.

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

    CraftCreeper6

    Hello! So this is my first time using dependency's in a plugin and I was wondering why this wont load. The dependency's are:
    Lib's Disguises
    ProtocolLib
    I get this stacktrace when loading:
    Code:
    [20:07:06 ERROR]: Could not load 'plugins\TwistedKits.jar' in folder 'plugins
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: me/
    raryaddict/disguise/disguisetypes/Disguise
            // I kept the to important things.
    Caused by: java.lang.ClassNotFoundException: me.libraryaddict.disguise.disgui
    ypes.Disguise
    I did add external jars in my plugin :)
    Any help appreciated! :D
     
  2. Offline

    Obnoxious_Ninja

    Can you post relevant code?
     
  3. Offline

    aaomidi

    Lrn2ReadErrors:
    It says the main argument you defined in your plugin.yml was wrong.
    me/raryaddict/disguise/disguisetypes/Disguise
    doesnt exist.

    Why would you need relevant code for that error may I ask?

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

    CraftCreeper6

    Obnoxious_Ninja
    For whatever reason: :p
    Code:java
    1. DisguiseAPI.disguiseToAll(p, new MobDisguise(DisguiseType.BAT));
    2.  


    aaomidi
    I did not do that in my plugin.yml this is my plugin.yml:
    Code:
    name: TwistedKits
    main: me.CraftCreeper6.main.Main
    author: CraftCreeper6
    version: 1.0
    description: Pfff
     
    commands:
        werewolf:
          description: Kit Werewolf!
        vampire:
          description: Kit Vampire!
     
  5. Offline

    Obnoxious_Ninja

    You could answer the way you did, but a definitive solution can't be given without looking a whatever the problem points to. Yes, we know plugin.yml has a problem, but we can't offer solutions yet.
     
  6. Offline

    aaomidi

    Then that plugin doesnt exist on your server.
    Also ew for static calls.
     
  7. Offline

    CraftCreeper6

  8. Offline

    fireblast709

    CraftCreeper6 for dependencies, add
    Code:
    depend: [<plugin>, <other plugin>]
    in your plugin.yml
     
    aaomidi and Obnoxious_Ninja like this.
  9. Offline

    aaomidi

    Either the API you used on the server is out of date, or the API you used when coding the plugin.

    True, this too xD

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

    CraftCreeper6

    fireblast709
    aaomidi
    I added the dependecy thing :p
    What API should I be using? Are there any links you can send me?
     
  11. Offline

    aaomidi

    For the jar you added to the project when coding, use the same .jar on the server.
     
  12. Offline

    Obnoxious_Ninja

    The bukkit API, and whatever version your plugin is for. Make sure they're the same

    Ninja'd from me
     
  13. Offline

    CraftCreeper6

    aaomidi
    I did.

    Obnoxious_Ninja
    aaomidi
    Got a stacktrace:
    Code:
    [20:24:53 ERROR]: Could not load 'plugins\TwistedKits.jar' in folder 'plugins'
    org.bukkit.plugin.UnknownDependencyException: LibsDisguise
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:196) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.ja
    va:255) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.reload(CraftServer.java:62
    8) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.Bukkit.reload(Bukkit.java:279) [craftbukkit.jar:git-Bukkit
    -1.7.2-R0.2-b2974jnks]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:19
    6) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServe
    r.java:542) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchServerCommand(Craf
    tServer.java:529) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.DedicatedServer.aw(DedicatedServer.java:
    286) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:2
    51) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:5
    45) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java
    :457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:6
    17) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    EDIT: Nvm fixed it! Thanks all! :D

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

    Obnoxious_Ninja

    Okee dokee.

    Good luck developing!
     
  15. Offline

    CraftCreeper6

    Obnoxious_Ninja
    How would I turn the player back into themself?
    I have tried:
    Code:java
    1. DisguiseAPI.disguiseToAll(p, new PlayerDisguise(p.getName()));
     
  16. Offline

    Konkz

    Do DisguiseAPI. and look at all the possible options.
     
    Obnoxious_Ninja likes this.
  17. Offline

    aaomidi

    Or read their javadocs.
     
  18. Offline

    CraftCreeper6

  19. Offline

    Obnoxious_Ninja

  20. Offline

    CraftCreeper6

    Obnoxious_Ninja
    In a way, yes. How would I do this as this API hates me alot :p
     
  21. Offline

    Konkz

    Invisibility is not part of the API, it serves to make you look like a mob. Loop through active effects
    and remove them. The code snippet you provided will undisguise player p.
     
  22. Offline

    CraftCreeper6

    Konkz
    I added:
    Code:java
    1. p.getActivePotionEffects().clear();

    But then I do not start with a potion effect :/
     
  23. Offline

    Konkz

    Because you clear it.

    What are you trying to do? Undisguise the player and give him invisibility?
     
  24. Offline

    CraftCreeper6

    Konkz
    libraryaddict
    It no longer disguises me at all :/ & no, I am trying to remove the potion effect after 10 seconds. I put the p.getAcvtivePotionEffects().clear(); in the scheduler.
     
  25. Offline

    Konkz

    If it does not disguise you then you messed something up.
    PHP:
    if player is disguised {
    change disguise to what you want
    } else {
    disguise player to what you want
    }
    I use DisguiseCraft so I don't know a lot about LibDisguise
     
  26. Offline

    CraftCreeper6

    Konkz
    How does DisguiseCraft work then? I gave it a try but it only seems to be accessible in the main class onEnable.
     
  27. Offline

    Konkz

    Make an instance of it in the main class

    PHP:
    private static DisguiseCraftAPI dcAPI;
     
    public 
    void onEnable() {
    dcAPI DisguiseCraft.getAPI(); // Making an instance of it onEnable
    }
     
    public 
    DisguiseCraft getDisCraftAPI() {
    return 
    dcAPI// Create a getter so we can get instance of this in other classes
    }
    Then in your other classes do

    PHP:
     MyMainClass.getDisCraftAPI().undisguisePlayer(bukkitPlayer);
    and
    PHP:
    if (MyMainClass.getDisCraftAPI().isDisguised(bukkitPlayer)) {
       
    MyMainClass.getDisCraftAPI().changePlayerDisguise(bukkitPlayer, new Disguise(MyMainClass.getDisCraftAPI().newEntityID(), "wither"DisguiseType.Skeleton));
    }
    else {
      
    MyMainClass.getDisCraftAPI().disguisePlayer(bukkitPlayer, new Disguise(getDisCraftAPI().newEntityID(), DisguiseType.Zombie));
    }
     
  28. Offline

    CraftCreeper6

    Konkz
    DisguiseType cannot be resolved to a variable
    Code:
    Main.getDisCraftAPI().disguisePlayer(p, new Disguise(Main.getDisCraftAPI().newEntityID(), DisguiseType.Bat));
     
  29. Offline

    Konkz

    Don't just copy my code, which is first and second make sure you import it and save.
    Code:
    import pgDev.bukkit.DisguiseCraft.disguise.DisguiseType;
     
  30. Offline

    CraftCreeper6

    Konkz
    I didn't... :p If you look I added: Main.getDisCraftAPI().disguisePlayer(p, new Disguise(Main.getDisCraftAPI().newEntityID(), DisguiseType.Bat));
    As you forgot it :p And Okay. I will import that.

    Konkz
    NVM I fixed it :)
    EDIT:
    Doesn't load:
    Code:
    [22:59:47 ERROR]: Could not load 'plugins\DisguiseCraft.jar' in folder 'plugins'
     
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: net/mi
    necraft/server/v1_6_R3/Packet
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:184) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:308) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:231) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.ja
    va:255) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.reload(CraftServer.java:62
    8) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.Bukkit.reload(Bukkit.java:279) [craftbukkit.jar:git-Bukkit
    -1.7.2-R0.2-b2974jnks]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:19
    6) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchCommand(CraftServe
    r.java:542) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.craftbukkit.v1_7_R1.CraftServer.dispatchServerCommand(Craf
    tServer.java:529) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.DedicatedServer.aw(DedicatedServer.java:
    286) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:2
    51) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:5
    45) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java
    :457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:6
    17) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/v1_6_R3/Packet
            at java.lang.Class.forName0(Native Method) ~[?:1.7.0_45]
            at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_45]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:173) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            ... 14 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_6_R3.Packet
     
            at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader
    .java:70) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:53) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_45]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_45]
            at java.lang.Class.forName0(Native Method) ~[?:1.7.0_45]
            at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_45]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:173) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
            ... 14 more
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
Thread Status:
Not open for further replies.

Share This Page