Really easy question

Discussion in 'Plugin Development' started by Uhehesh, Mar 21, 2011.

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

    Uhehesh

    I have very simple project with this files and directories:

    META-INF
    zplugin
    - zpluginBlockListener.class
    - zpluginPlayerListener.class
    - zplugin.class
    plugin.yml

    I am trying to put "main: zplugin" into plugin.yml, but is doesn't work.
    What should I put to plugin.yml to make it to work?
     
  2. Offline

    Sammy

    Code:
    name: zplugin
    
    main: *.zplugin
    * = the folders aka package where the zplugin.class is located

    In this case if the zplugin.jar is on the zplugin folder if should be like this:

    Code:
    [CODE]name: zplugin
    
    main: zplugin.zplugin
     
  3. Offline

    Uhehesh

    Thanks for reply.

    I have tried many solutions but nothing helps.
    I've uploaded packages structure screenshot.
     

    Attached Files:

  4. Offline

    Sammy

    Let me see your yml file
     
  5. Offline

    Uhehesh

    It's very simple.

    name: zplugin
    main: src.zplugin.zplugin
    version: 1
     
  6. Offline

    furt

    Try refactoring your package name to use me.uhehesh.zplugin
    and for main: me.uhehesh.zplugin.zplugin
     
  7. Offline

    Uhehesh

    It doesn't work.
     

    Attached Files:

  8. Offline

    furt

    what is the error
     
  9. Offline

    Uhehesh

    Ok.
    I've just forgot to export source files.

    But now I have another exception - java.lang.NoSuchMethodException: me.uhehesh.zplugin.zplugin.<init>().
    WTF?!
     
  10. Offline

    furt

    pastebin your main class
     
  11. Offline

    Uhehesh

    Here it is.

    zplugin.java:
    Code:
    package me.uhehesh.zplugin;
    import java.io.File;
    import java.util.HashMap;
    import org.bukkit.Server;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Event.Priority;
    import org.bukkit.event.Event;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginLoader;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.plugin.PluginManager;
    
    public class zplugin extends JavaPlugin {
        private final zpluginPlayerListener playerListener = new zpluginPlayerListener(this);
        private final zpluginBlockListener blockListener = new zpluginBlockListener(this);
        private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
    
        public zplugin(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File plugin, ClassLoader cLoader) {
            // super(pluginLoader, instance, desc, plugin, cLoader);
    
            // init code
        }
    
        public void onEnable() {
            PluginManager pm = getServer().getPluginManager();
    
            System.out.println("Plugin is enabled now.");
        }
    
        public void onDisable() {
            System.out.println("Plugin is disabled now.");
        }
    }
    
     
  12. Offline

    furt

    remove
    Code:
    public zplugin(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File plugin, ClassLoader cLoader) {
            // super(pluginLoader, instance, desc, plugin, cLoader);
    
            // init code
        }
    
    This is the error, the constructor is no longer used
     
  13. Offline

    Uhehesh

    Thanks a lot, that works!
     
  14. Offline

    petteyg359

    src is not included in the jar. Get rid of it.
     
  15. Offline

    furt

    your welcome
     
  16. Offline

    Uhehesh

    Hello. I have another question but I don't want to create new topic.

    When player presses "Q", his selected object falls.
    How to make object fall using Bukkit API? And is it possible?

    Ok, I understand now.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
Thread Status:
Not open for further replies.

Share This Page