[fix] Setting names in CoordsLog to be more clear

This commit is contained in:
liv 2021-01-11 13:44:48 -05:00 committed by GitHub
parent 40f0c444db
commit d1ecb21675
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 7 deletions

View File

@ -17,9 +17,9 @@ object CoordsLog : Module(
description = "Automatically logs your coords, based on actions",
category = Category.MISC
) {
private val saveOnDeath = setting("SaveOnDeath", true)
private val autoLog = setting("AutoLog", false)
private val delay = setting("Delay", 15, 1..60, 1)
private val saveOnDeath by setting("SaveOnDeath", true)
private val logEveryX by setting("LogEveryX", false)
private val delay by setting("DelayMinutes", 15, 1..60, 1)
private var previousCoord: String? = null
private var savedDeath = false
@ -27,16 +27,16 @@ object CoordsLog : Module(
init {
safeListener<TickEvent.ClientTickEvent> {
if (autoLog.value && timer.tick(delay.value.toLong())) {
if (logEveryX && timer.tick(delay.toLong())) {
val currentCoord = player.positionVector.toBlockPos().asString()
if (currentCoord != previousCoord) {
WaypointManager.add("autoLogger")
WaypointManager.add("CoordsLog")
previousCoord = currentCoord
}
}
if (saveOnDeath.value) {
if (saveOnDeath) {
savedDeath = if (player.isDead || player.health <= 0.0f) {
if (!savedDeath) {
val deathPoint = WaypointManager.add("Death - " + InfoCalculator.getServerType()).pos
@ -50,4 +50,4 @@ object CoordsLog : Module(
}
}
}
}