Skip to content

Commit 4fd21ce

Browse files
committed
fix onSelect and onDeselect not recognising child classes of collection settings
1 parent f93ea7c commit 4fd21ce

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/kotlin/com/lambda/config/settings/collections/CollectionSetting.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ open class CollectionSetting<R : Any>(
118118
}
119119

120120
companion object {
121-
fun <T : Any> Setting<CollectionSetting<T>, MutableCollection<T>>.onSelect(block: SafeContext.(T) -> Unit) = apply {
121+
fun <T : CollectionSetting<R>, R : Any> Setting<T, MutableCollection<R>>.onSelect(block: SafeContext.(R) -> Unit) = apply {
122122
core.selectListeners.add(block)
123123
}
124124

125-
fun <T : Any> Setting<CollectionSetting<T>, MutableCollection<T>>.onDeselect(block: SafeContext.(T) -> Unit) = apply {
125+
fun <T : CollectionSetting<R>, R : Any> Setting<T, MutableCollection<R>>.onDeselect(block: SafeContext.(R) -> Unit) = apply {
126126
core.deselectListeners.add(block)
127127
}
128128

src/main/kotlin/com/lambda/module/modules/render/BlockESP.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
package com.lambda.module.modules.render
1919

2020
import com.lambda.Lambda.mc
21-
import com.lambda.config.serializer.BlockCodec
21+
import com.lambda.config.settings.collections.CollectionSetting.Companion.onDeselect
22+
import com.lambda.config.settings.collections.CollectionSetting.Companion.onSelect
2223
import com.lambda.context.SafeContext
2324
import com.lambda.graphics.renderer.esp.ChunkedESP.Companion.newChunkedESP
2425
import com.lambda.graphics.renderer.esp.DirectionMask

0 commit comments

Comments
 (0)