t
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package rip.tilly.bedwars.runnables;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
@ -8,11 +7,17 @@ import rip.tilly.bedwars.BedWars;
|
||||
import rip.tilly.bedwars.game.Game;
|
||||
import rip.tilly.bedwars.game.GameState;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class GameRunnable extends BukkitRunnable {
|
||||
|
||||
private final BedWars plugin = BedWars.getInstance();
|
||||
private final Game game;
|
||||
private BedWars plugin = BedWars.getInstance();
|
||||
|
||||
private Game game;
|
||||
|
||||
private int amount;
|
||||
|
||||
public GameRunnable(Game game) {
|
||||
this.game = game;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
@ -25,9 +30,13 @@ public class GameRunnable extends BukkitRunnable {
|
||||
this.game.broadcastWithSound("&eStarting match in &d" + this.game.getCountdown() + " &eseconds...", Sound.NOTE_PLING);
|
||||
this.game.broadcastTitle("&d&lStarting Match In...", "&e" + this.game.getCountdown());
|
||||
}
|
||||
|
||||
break;
|
||||
case FIGHTING:
|
||||
this.amount++;
|
||||
this.game.incrementDuration();
|
||||
this.game.tick(this.amount);
|
||||
|
||||
break;
|
||||
case ENDING:
|
||||
if (this.game.decrementCountdown() == 0) {
|
||||
@ -45,6 +54,7 @@ public class GameRunnable extends BukkitRunnable {
|
||||
this.plugin.getGameManager().removeGame(this.game);
|
||||
this.cancel();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user