Use type specific methods

This commit is contained in:
DBotThePony 2023-03-25 12:22:42 +07:00
parent 6cc5659c43
commit 2da70e777f
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -201,8 +201,8 @@ abstract class MatteryDeviceBlockEntity(blockEntityType: BlockEntityType<*>, blo
}
})
var automatePull by synchronizer.bool()
var automatePush by synchronizer.bool()
var automatePull by synchronizer.bool().property
var automatePush by synchronizer.bool().property
init {
savetables.enum(::energyFlow, "energy_${side}_flow", FlowDirection::valueOf)
@ -336,7 +336,7 @@ abstract class MatteryDeviceBlockEntity(blockEntityType: BlockEntityType<*>, blo
})
var automatePull by synchronizer.bool(setter = { value, access, _ ->
if (access.read() != value) {
if (access.readBoolean() != value) {
access.write(value)
if (value) {
@ -344,10 +344,10 @@ abstract class MatteryDeviceBlockEntity(blockEntityType: BlockEntityType<*>, blo
outerSlotPush = 0
}
}
})
}).property
var automatePush by synchronizer.bool(setter = { value, access, _ ->
if (access.read() != value) {
if (access.readBoolean() != value) {
access.write(value)
if (value) {
@ -355,7 +355,7 @@ abstract class MatteryDeviceBlockEntity(blockEntityType: BlockEntityType<*>, blo
outerSlotPush = 0
}
}
})
}).property
init {
savetables.bool(::automatePull, "itemhandler_${side}_automatePull")