diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt index 27718dd70..fd6ae1e0f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryBlockEntity.kt @@ -454,13 +454,6 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc _sides[blockRotation.dir2Side(dir)]!!.updateTracked() } - protected fun onceServer(action: (ServerLevel) -> Unit) { - val level = level - if (level is ServerLevel) { - tickList.once { action.invoke(level) } - } - } - override fun setChanged() { super.setChanged() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/cable/EnergyCableBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/cable/EnergyCableBlockEntity.kt index d7c3b5018..aeeb47cf8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/cable/EnergyCableBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/cable/EnergyCableBlockEntity.kt @@ -17,6 +17,7 @@ import ru.dbotthepony.mc.otm.core.math.BlockRotation import ru.dbotthepony.mc.otm.core.math.Decimal import ru.dbotthepony.mc.otm.core.math.RelativeSide import ru.dbotthepony.mc.otm.graph.GraphNode +import ru.dbotthepony.mc.otm.onceServer import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.util.Collections import java.util.EnumMap @@ -53,11 +54,11 @@ class EnergyCableBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matte node.graph.livelyNodes.add(node) } - ru.dbotthepony.mc.otm.onceServer { + onceServer { updateBlockState(blockRotation.side2Dir(side), true) } } else { - ru.dbotthepony.mc.otm.onceServer { + onceServer { updateBlockState(blockRotation.side2Dir(side), false) } }