Added counterToZero

This commit is contained in:
bluefireoly
2020-09-13 15:10:51 +02:00
parent fac071228f
commit eb6313b452
2 changed files with 5 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ class GamePhase(
) {
if (counterMessage != null) {
val currentCounter = it.counterDown
val currentCounter = it.counterDownToOne
if (currentCounter?.isCounterValue == true)
broadcast(counterMessage.invoke(currentCounter))
}

View File

@@ -22,7 +22,8 @@ class KRunnableHolder {
abstract class KSpigotRunnable(
var counterUp: Long? = null,
var counterDown: Long? = null
var counterDownToOne: Long? = null,
var counterDownToZero: Long? = null,
) : BukkitRunnable()
/**
@@ -58,7 +59,8 @@ fun KSpigot.task(
var ranOut = false
if (howOften != null) {
counterDown = howOften - curCounter
counterDownToOne = howOften - curCounter
counterDownToZero = counterDownToOne?.minus(1)
curCounter++
if (curCounter >= howOften)