Help with coding (an error has appeared - i haven't even started)

Discussion in 'Plugin Development' started by rymate1234, Mar 8, 2011.

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

    rymate1234

    Ok, so i'm using http://forums.bukkit.org/threads/current-template.964/ as my plugin template, but this line has an error
    Code:
           super(pluginLoader, instance, desc, folder, plugin, cLoader);
    Yes, I added the bukkit.jar

    The error i have is
    Code:
    cannot find symbol
      symbol:   constructor JavaPlugin(org.bukkit.plugin.PluginLoader,org.bukkit.Server,org.bukkit.plugin.PluginDescriptionFile,java.io.File,java.io.File,java.lang.ClassLoader)
      location: class org.bukkit.plugin.java.JavaPlugin
     
  2. Offline

    Daniel Heppner

    Could you upload your entire source code? I'm making my first plugin too, but mine actually works, so I think I can help. :)
     
  3. Offline

    rymate1234

    Here's my main class (the only class with an error)
    Code:
    package com.bukkit.rymate1234.StopFireSpread;
    
    import java.io.*;
    import java.util.HashMap;
    
    import org.bukkit.Server;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Event;
    import org.bukkit.event.Event.Priority;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginLoader;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    /**
     * StopFireSpread for Bukkit
     *
     * @author rymate1234
     */
    public class StopFireSpread extends JavaPlugin {
        private final StopFireSpreadPlayerListener playerListener = new StopFireSpreadPlayerListener(this);
        private final StopFireSpreadBlockListener blockListener = new StopFireSpreadBlockListener(this);
        private final HashMap<Player, Boolean> debugees = new HashMap<Player, Boolean>();
    
        public StopFireSpread(PluginLoader pluginLoader, Server instance,
                PluginDescriptionFile desc, File folder, File plugin,
                ClassLoader cLoader) throws IOException {
            super(pluginLoader, instance, desc, folder, plugin, cLoader);
            // TODO: Place any custom initialisation code here
    
            // NOTE: Event registration should be done in onEnable not here as all events are unregistered when a plugin is disabled
    
        }
      
        public void onEnable() {
            // TODO: Place any custom enable code here including the registration of any events
    
            // Register our events
            PluginManager pm = getServer().getPluginManager();
        //Create BlockPlaced listener
            pm.registerEvent(Event.Type.BLOCK_PLACED, blockListener, Event.Priority.Highest, this);
    
            // EXAMPLE: Custom code, here we just output some info so we can check all is well
            PluginDescriptionFile pdfFile = this.getDescription();
            System.out.println( pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" );
        }
        public void onDisable() {
            // TODO: Place any custom disable code here
    
            // NOTE: All registered events are automatically unregistered when a plugin is disabled
    
            // EXAMPLE: Custom code, here we just output some info so we can check all is well
            System.out.println("Nooooo! You disabled me!!!");
        }
        public boolean isDebugging(final Player player) {
            if (debugees.containsKey(player)) {
                return debugees.get(player);
            } else {
                return false;
            }
        }
    
        public void setDebugging(final Player player, final boolean value) {
            debugees.put(player, value);
        }
    }
    
     
  4. Offline

    darknesschaos

    Code:
    public StopFireSpread(PluginLoader pluginLoader, Server instance,
                PluginDescriptionFile desc, File folder, File plugin,
                ClassLoader cLoader) throws IOException {
            super(pluginLoader, instance, desc, folder, plugin, cLoader);
            // TODO: Place any custom initialisation code here
    
            // NOTE: Event registration should be done in onEnable not here as all events are unregistered when a plugin is disabled
    
        }
    
    That bit needs to go, it was removed forever ago and is not supported.
    And afaik you don't need that debugging code.
     
  5. Offline

    rymate1234

  6. Offline

    darknesschaos

    always happy to help.
     
  7. Offline

    Nohup

    yes, the SLPC is dead, long live the 0-args constructor!
     
  8. Offline

    Daniel Heppner

    Sorry I couldn't reply. I didn't see an alert.
     
  9. Offline

    plutgamer

    thx
    i m a supa newb with bukkit[​IMG]
    ps. the [​IMG] is a lie
     
Thread Status:
Not open for further replies.

Share This Page