Misc fixes for DiscoUpdater

This commit is contained in:
Charlie Wang 2013-06-30 14:09:30 -04:00
parent 61dcce06dd
commit 8533b007e3

View File

@ -1,35 +1,39 @@
public class DiscoUpdater extends BukkitRunnable{ package gibstick.bukkit.discosheep;
private final int defaultDuration = 1000;// ticks
private final int defaultFrequency = 20;// ticks per state change
int frequency=0,duration=0;
private DiscoSheep parent; import gibstick.bukkit.DiscoSheep.DiscoSheep;
import org.bukkit.scheduler.BukkitRunnable;
public DiscoUpdater(DiscoSheep parent){
this.parent = parent; public class DiscoUpdater extends BukkitRunnable {
} private final int defaultDuration = 1000;// ticks
private final int defaultFrequency = 20;// ticks per state change
public void stop(){ int frequency = 0, duration = 0;
this.duration = 0; private DiscoSheep parent;
parent.cleanUp();
} public DiscoUpdater(DiscoSheep parent) {
this.parent = parent;
public void start(int duration, int frequency){ }
this.frequency = this.defaultFrequency;
this.durtion = this.defaultDuration; public void stop() {
parent.scheduleUpdate(); this.duration = 0;
} parent.cleanUp();
}
public void run(){
if(duration > 0){ public void start(int duration, int frequency) {
cycleSheepColours(); this.frequency = this.defaultFrequency;
playSounds(); this.duration = this.defaultDuration;
duration -= frequency; parent.scheduleUpdate();
parent.scheduleUpdate(this); }
} else {
this.stop(); @Override
} public void run() {
} if (duration > 0) {
} parent.cycleSheepColours();
parent.playSounds();
duration -= frequency;
parent.scheduleUpdate();
} else {
this.stop();
}
}
}