Skip to content

Commit

Permalink
fix: excluded values in Configurable.values
Browse files Browse the repository at this point in the history
  • Loading branch information
opZywl committed Feb 1, 2025
1 parent 79fcd5d commit 3119de2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/net/ccbluex/liquidbounce/config/Value.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ sealed class Value<T>(
/**
* The owner of this value.
*/
var owner: Value<*>? = null
var owner: Configurable? = null

/**
* Whether this value should be excluded from public configuration (text config)
Expand All @@ -36,7 +36,12 @@ sealed class Value<T>(
fun subjective() = apply { subjective = true }

var excluded: Boolean = false
private set
private set(value) {
if (value) {
owner?.get()?.remove(this)
}
field = value
}

fun exclude() = apply { excluded = true }

Expand Down

0 comments on commit 3119de2

Please sign in to comment.