New Problem

Discussion in 'Plugin Development' started by RightLegRed, Jan 15, 2011.

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

    Archelaus

    Sorry about spamming this forum with my threads. But I've almost got this working. But I hit another problem. I fixed the last one I had, but I got this one right after. After running the serversoftware:


    Code:
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:82)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:115)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:80)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:37)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:177)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:80)
            ... 8 more
    Caused by: java.lang.NoSuchMethodError: org.bukkit.plugin.java.JavaPlugin.<init>
    (Lorg/bukkit/plugin/PluginLoader;Lorg/bukkit/Server;Lorg/bukkit/plugin/PluginDes
    criptionFile;Ljava/io/File;Ljava/lang/ClassLoader;)V
            at bukkit.RightLegRed.Civilizations.Civilizations.<init>(Civilizations.j
    ava:26)
            ... 13 more
    

    Here's my plugin source. Please, help. I really want to start developing plugins.

    http://www.2shared.com/file/9F-_CY-M/src.html

    Bump​

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

    apexearth

    Code:
        public Civilizations(PluginLoader pluginLoader, Server instance,
                PluginDescriptionFile desc, File folder, File plugin,
                ClassLoader cLoader) {
            super(pluginLoader, instance, desc, folder, cLoader);
    Your super has less vars than your main.

    You left out plugin.

    Code:
        public Civilizations(PluginLoader pluginLoader, Server instance,
                PluginDescriptionFile desc, File folder, File plugin,
                ClassLoader cLoader) {
            super(pluginLoader, instance, desc, folder, plugin, cLoader);
    It said that method didn't exist because a method accepting the parameters you gave it did not exist.
     
  3. Offline

    Archelaus

    When doing that, I recieve the following error:

    Code:
    The constructor JavaPlugin(PluginLoader, Server, PluginDescriptionFile, File, File, ClassLoader) is undefined    Civilizations.java    /Civilizations/src/bukkit/RightLegRed/Civilizations    line 28    Java Problem
    
     
  4. Offline

    apexearth

    Make sure you have the most recent build of bukkit.

    There used to be no Folder parameter but a day or so ago they added that in. So, if you have an old bukkit jar then the code won't work.

    http://bamboo.lukegb.com/browse/
     
  5. Offline

    Archelaus

    I have the newest CraftBukkit and Bukkit. If anyone wants to look into my Source and see why it doesn't work, please do. I need a bit of help. Thanks

    Source
     
  6. Offline

    Insain

    well here is a issue
    Your PLugin.yml is wrong and your directory setting is all wrong

    change the yml to this
    Code:
    name: Civilizations
    
    main:com.bukkit.RightLegRed.Civilizations.Civilizations
    
    Version: 1.0.0.0
    and make your directoy like this com\bukkit\RightLegRed.Civilizations.Civilizations
    --- merged: Jan 16, 2011 7:42 PM ---
    and it should work its tring to call processes from a none exsistance path
    --- merged: Jan 16, 2011 7:43 PM ---
    also after doing that the New Consructor should work fine
     
  7. Offline

    Archelaus


    I've done so. It gave me an error due to a capital v in version. But now no errors are being given but I am experiencing the same problem. Nothing is being done.

    Here's new source
     

    Attached Files:

    • src.zip
      File size:
      2.8 KB
      Views:
      3
  8. Offline

    Insain

    what are you tyrying to make it do
    it compiled fine
     
  9. Offline

    Archelaus

    Try applying it to a server and then place a block. When a block is placed, it should give the player a message.
     
  10. Offline

    Insain

    ok ill look in to it its becuase your trying to return a non string on the message
     
  11. Offline

    Archelaus

    Wouldn't that return a error message?
     
  12. Offline

    Insain

    ok here you go it displays Block placed now altho there is a bug it repeats twice i have to leave so ill let you toy with it i also loaded the compiled version for you to check out as well
    --- merged: Jan 16, 2011 11:08 PM ---
    the issue seemed to be with players.sendMessage(); for some reson it was not working properly so i cnaged it to
    event.getPlayer().sendMessage(block.getType().name());
     

    Attached Files:

  13. Offline

    Archelaus

    I think you're my new best friend :D

    Could you tell me what was wrong?
     
  14. Offline

    nossr50

    Line 27 of your playerListener
    Here name() is an enum, you want it to be a string for sendMessage I believe
    Code:
    player.sendMessage(block.getType().name());
    Change this to
    Code:
    player.sendMessage(block.getType().name().toString());
     
  15. Offline

    Insain

    i belive that works to either way he has a working version now :)_.

    issue being tho is with player.send it wasnt working when i changed it to and event insted it worked in the format he had odd i guess

    and for referance
    player.sendMessage(block.getType().name()); was not working
    but event.getPlayer().sendMessage(block.getType().name()); did hah not sure why
    --- merged: Jan 16, 2011 11:31 PM ---
    You know what its funny i helped you get your script straightened out and i fixed my issue with getting Server to Message player on join hah
     
Thread Status:
Not open for further replies.

Share This Page