[help] Constuctor Undefined

Discussion in 'Plugin Development' started by eagledude4, Mar 10, 2011.

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

    eagledude4

    Code:
    public class commands extends JavaPlugin {
    
    Gives me this warning:
    
    "The constructor JavaPlugin(PluginLoader, Server, PluginDescriptionFile, File, File, 
     ClassLoader) is undefined"
    
    I'm using bukkit 452.
     
  2. Offline

    Edward Hand

    I'm assuming you have more code than just the one line you presented there.

    Are you, perhaps, using "The Stupidly Long Plugin Constructor" (or TSLPC), which is warned against at the very top of every single page on the site?
     
  3. Offline

    eagledude4

    No, this is an eclipse warning, not the server console. I followed this tut http://forums.bukkit.org/threads/basic-bukkit-plugin-tutorial.1339/ and am using that constructor.

    Can I get away without using it at all?

    If you need to see the whole code:

    Code:
    package com.bukkit.eagledude4.commands;
    
    import java.io.File;
    import java.util.ArrayList;
    import java.util.HashMap;
    import org.bukkit.Server;
    import org.bukkit.block.Block;
    import org.bukkit.entity.Player;
    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 commands extends JavaPlugin {
        private final commandsPlayerListener playerListener = new commandsPlayerListener(this);
        public commands(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
            super(pluginLoader, instance, desc, folder, plugin, cLoader);
        }
    
        public void onEnable() {
        PluginManager pm = getServer().getPluginManager();
        PluginDescriptionFile pdfFile = this.getDescription();
            pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, this.playerListener, Event.Priority.Normal, this);
            System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
        }
    
        public void onDisable() {
        }
    }
    
    
     
Thread Status:
Not open for further replies.

Share This Page