AbstractNetworkedInput.with accepts GetterSetter
This commit is contained in:
parent
6c4d8d492b
commit
fdad25cb17
@ -1,6 +1,7 @@
|
||||
package ru.dbotthepony.mc.otm.menu.input
|
||||
|
||||
import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.core.GetterSetter
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryMenu
|
||||
import kotlin.reflect.KMutableProperty0
|
||||
|
||||
@ -27,6 +28,12 @@ abstract class AbstractNetworkedInput<V> {
|
||||
return this
|
||||
}
|
||||
|
||||
fun with(state: GetterSetter<V>): AbstractNetworkedInput<V> {
|
||||
withConsumer(state::accept)
|
||||
withSupplier(state::get)
|
||||
return this
|
||||
}
|
||||
|
||||
fun clear(): AbstractNetworkedInput<V> {
|
||||
supplier = null
|
||||
consumer = null
|
||||
|
Loading…
Reference in New Issue
Block a user