Can not figure out Plugin already initialized! Error

Discussion in 'Plugin Development' started by chriztopia, Feb 17, 2014.

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

    chriztopia

    So I know that you can not extend JavaPlugin more than once. I have been away for awhile and I can not figure out what is causing this error.

    The Error

    Player Interact:
    http://paste.ubuntu.com/6952388/

    Main Class:
    http://paste.ubuntu.com/6952387/
     
  2. Offline

    RawCode

    Control+C "Plugin already initialized!"

    Control+V for seach over bukkit source code

    Code:
        synchronized void initialize(JavaPlugin javaPlugin) {
            Validate.notNull(javaPlugin, "Initializing plugin cannot be null");
            Validate.isTrue(javaPlugin.getClass().getClassLoader() == this, "Cannot initialize plugin outside of this class loader");
            if (this.plugin != null || this.pluginInit != null) {
                throw new IllegalArgumentException("Plugin already initialized!", pluginState);
            }
    
            pluginState = new IllegalStateException("Initial initialization");
            this.pluginInit = javaPlugin;
    
            javaPlugin.init(loader, loader.server, description, dataFolder, file, this);
        }
    
    Now you can figureout why this happening with a bit more tracing and debugging (one more message to track).
     
Thread Status:
Not open for further replies.

Share This Page