From 2da70e777fdae19f4228cd2ce175de690322a731 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 25 Mar 2023 12:22:42 +0700 Subject: [PATCH] Use type specific methods --- .../mc/otm/block/entity/MatteryDeviceBlockEntity.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryDeviceBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryDeviceBlockEntity.kt index a30caeb8a..21fedbda6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryDeviceBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryDeviceBlockEntity.kt @@ -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")