All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.skillw.asahi.internal.util.Clock.kt Maven / Gradle / Ivy

There is a newer version: 1.6.7-beta-6
Show newest version
package com.skillw.asahi.internal.util

import com.skillw.pouvoir.internal.feature.database.PouvoirContainer
import taboolib.common.LifeCycle
import taboolib.common.platform.Awake
import taboolib.common.platform.function.submit
import taboolib.common5.Coerce

object Clock {
    var currentTick: Long = 0
        @Synchronized
        get
        private set

    @Awake(LifeCycle.ACTIVE)
    fun start() {
        currentTick = Coerce.toLong(PouvoirContainer["COMMON", "CLOCK_TICKS"])
        submit(async = true, period = 1) {
            currentTick++
        }
    }

    @Awake(LifeCycle.DISABLE)
    fun disable() {
        PouvoirContainer["COMMON", "CLOCK_TICKS"] = currentTick.toString()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy