/*
 * CommandBook
 * Copyright (C) 2011 sk89q <http://www.sk89q.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package com.sk89q.jinglenote;

import com.sk89q.jinglenote.JingleSequencer.Note;

public abstract class JingleNotePlayer implements Runnable {

    protected final String player;
    protected JingleSequencer sequencer;

    /**
     * Constructs a new JingleNotePlayer
     * 
     * @param player The player who is hearing this's name.
     * @param seq The JingleSequencer to play.
     */
    public JingleNotePlayer(String player, JingleSequencer seq) {
        this.player = player;
        sequencer = seq;
    }

    @Override
    public void run() {

        if(sequencer == null)
            return;
        try {
            try {
                sequencer.run(this);
            } catch (Throwable t) {
                t.printStackTrace();
            }

            Thread.sleep(500);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } finally {
            sequencer.stop();
            sequencer = null;
        }
    }

    public String getPlayer() {
        return player;
    }

    public void stop() {
        if (sequencer != null) {
            sequencer.stop();
        }
    }

    public abstract void play(Note note);
}
@@ -794,16 +794,49 @@
 er.Note;
+%0Aimport org.bukkit.plugin.Plugin;
 %0A%0Apublic
@@ -887,24 +887,51 @@
 Runnable %7B%0A%0A
+    private Plugin plugin;%0A
     protecte
@@ -1195,16 +1195,31 @@
 ePlayer(
+Plugin plugin, 
 String p
@@ -1244,24 +1244,54 @@
 ncer seq) %7B%0A
+        this.plugin = plugin;%0A
         this
@@ -1453,32 +1453,32 @@
           try %7B%0A
-
                 
@@ -1491,16 +1491,24 @@
 cer.run(
+plugin, 
 this);%0A 

Fix another error in JingleNote