diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/RedstoneControl.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/RedstoneControl.kt index 2fbd9561a..bc4adde43 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/RedstoneControl.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/RedstoneControl.kt @@ -65,9 +65,11 @@ class RedstoneControl(private val valueChanges: (new: Boolean, old: Boolean) -> class SynchronizedRedstoneControl( synchronizer: FieldSynchronizer, + fieldNamePrefix: String?, private val valueChanges: (new: Boolean, old: Boolean) -> Unit, - fieldNamePrefix: String? = null ) : AbstractRedstoneControl() { + constructor(synchronizer: FieldSynchronizer, valueChanges: (new: Boolean, old: Boolean) -> Unit) : this(synchronizer, null, valueChanges) + override var redstoneSetting: RedstoneSetting by synchronizer.enum(RedstoneSetting.LOW, setter = { value, access, setByRemote -> if (setByRemote) { access.write(value) @@ -80,7 +82,7 @@ class SynchronizedRedstoneControl( valueChanges.invoke(state, old) } } - }) + }, name = if (fieldNamePrefix != null) "${fieldNamePrefix}_redstoneSetting" else null) override var redstoneSignal: Int by synchronizer.int(0, setter = { value, access, setByRemote -> if (setByRemote) { @@ -94,5 +96,5 @@ class SynchronizedRedstoneControl( valueChanges.invoke(state, old) } } - }) + }, name = if (fieldNamePrefix != null) "${fieldNamePrefix}_redstoneSignal" else null) }