Minor changes to naming.
This commit is contained in:
parent
a7f9b4358a
commit
ae93d9a5e4
@ -18,12 +18,9 @@ import org.bukkit.FireworkEffect.Builder;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.inventory.meta.FireworkMeta;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Georgiy
|
||||
*/
|
||||
public class DiscoParty {
|
||||
|
||||
private DiscoSheep parent;
|
||||
@ -426,34 +423,17 @@ public class DiscoParty {
|
||||
playSounds();
|
||||
duration -= period;
|
||||
this.scheduleUpdate();
|
||||
if (state < 10000) {
|
||||
this.state++;
|
||||
} else {
|
||||
state = 1; // prevent overflow
|
||||
}
|
||||
this.state = (this.state + 1) % 10000;
|
||||
} else {
|
||||
this.stopDisco();
|
||||
}
|
||||
}
|
||||
|
||||
void scheduleUpdate() {
|
||||
updater = new DiscoUpdater(this);
|
||||
updater = new DiscoUpdater();
|
||||
updater.runTaskLater(parent, this.period);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
void startDisco(int duration, int sheepAmount, int radius, int period, boolean fireworks) {
|
||||
if (this.duration > 0) {
|
||||
stopDisco();
|
||||
}
|
||||
this.spawnAll(sheepAmount, radius);
|
||||
this.doFireworks = fireworks;
|
||||
this.period = period;
|
||||
this.duration = duration;
|
||||
this.scheduleUpdate();
|
||||
parent.getPartyMap().put(this.player.getName(), this);
|
||||
}
|
||||
|
||||
void startDisco() {
|
||||
this.spawnAll(sheep, radius);
|
||||
this.scheduleUpdate();
|
||||
@ -474,4 +454,12 @@ public class DiscoParty {
|
||||
// stop listening
|
||||
HandlerList.unregisterAll(this.partyEvents);
|
||||
}
|
||||
|
||||
class DiscoUpdater extends BukkitRunnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -115,15 +115,15 @@ public final class DiscoSheep extends JavaPlugin {
|
||||
this.stopAllParties(); // or else the parties will continue FOREVER
|
||||
}
|
||||
|
||||
int toTicks(double seconds) {
|
||||
static int toTicks(double seconds) {
|
||||
return (int) Math.round(seconds * 20.0);
|
||||
}
|
||||
|
||||
double toSeconds(int ticks) {
|
||||
static double toSeconds(int ticks) {
|
||||
return (double) Math.round(ticks / 20.0);
|
||||
}
|
||||
|
||||
int toSeconds_i(int ticks) {
|
||||
static int toSeconds_i(int ticks) {
|
||||
return (int) Math.round(ticks / 20.0);
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ public final class DiscoSheep extends JavaPlugin {
|
||||
|
||||
}
|
||||
|
||||
boolean zeroGuests(DiscoParty party) {
|
||||
boolean clearGuests(DiscoParty party) {
|
||||
party.getGuestNumbers().clear();
|
||||
return true;
|
||||
}
|
||||
|
@ -3,8 +3,8 @@ package ca.gibstick.discosheep;
|
||||
import java.util.Arrays;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class DiscoSheepCommandExecutor implements CommandExecutor {
|
||||
@ -153,7 +153,7 @@ public class DiscoSheepCommandExecutor implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (parseNextArg(args, i, "none")) {
|
||||
return parent.zeroGuests(mainParty);
|
||||
return parent.clearGuests(mainParty);
|
||||
}
|
||||
|
||||
String[] guests = getNextArgs(args, i + 1);
|
||||
|
@ -1,17 +0,0 @@
|
||||
package ca.gibstick.discosheep;
|
||||
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class DiscoUpdater extends BukkitRunnable {
|
||||
|
||||
private DiscoParty parent;
|
||||
|
||||
public DiscoUpdater(DiscoParty parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
parent.update();
|
||||
}
|
||||
}
|
@ -12,10 +12,6 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Mauve
|
||||
*/
|
||||
public class GlobalEvents implements Listener {
|
||||
|
||||
DiscoSheep parent;
|
||||
|
Loading…
Reference in New Issue
Block a user