From d8e79d87197ab04053bcd5e002f80615d1f1cf1c Mon Sep 17 00:00:00 2001 From: ionut Date: Thu, 30 Apr 2026 00:50:12 +0300 Subject: [PATCH] almost fully fixing cables fixes 1 edge-case, but the east bug is still goofed --- src/main/kotlin/org/neoflock/neocomputers/block/CableBlock.kt | 1 + src/main/kotlin/org/neoflock/neocomputers/block/DeviceBlock.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/neoflock/neocomputers/block/CableBlock.kt b/src/main/kotlin/org/neoflock/neocomputers/block/CableBlock.kt index 4cbf459..83f0a5e 100644 --- a/src/main/kotlin/org/neoflock/neocomputers/block/CableBlock.kt +++ b/src/main/kotlin/org/neoflock/neocomputers/block/CableBlock.kt @@ -152,6 +152,7 @@ class CableBlock() : DeviceBlock(Properties.of()), EntityBlock { // val ent = level.getBlockEntity(blockPos.relative(dir)) // level.setBlockAndUpdate(blockPos, blockState.setValue(getPropByDirection(dir), (ent is NodeBlockEntity || ent is CableEntity))) // } + super.neighborChanged(state, level, pos, neighborBlock, neighborPos, movedByPiston) val diff = pos.subtract(neighborPos) val dir = Direction.fromDelta(diff.x, diff.y, diff.z)!!.opposite val ent = level.getBlockEntity(neighborPos) diff --git a/src/main/kotlin/org/neoflock/neocomputers/block/DeviceBlock.kt b/src/main/kotlin/org/neoflock/neocomputers/block/DeviceBlock.kt index 227d6fd..6066fab 100644 --- a/src/main/kotlin/org/neoflock/neocomputers/block/DeviceBlock.kt +++ b/src/main/kotlin/org/neoflock/neocomputers/block/DeviceBlock.kt @@ -33,7 +33,7 @@ abstract class DeviceBlockEntity(type: BlockEntityType<*>, pos: BlockPos, state: val connetionsInDir = MutableList(Direction.entries.size) { null } var alreadySetup = false var receivedServerState = false - var connectionsAreDirty = false + var connectionsAreDirty = true abstract fun getDeviceNodes(): List @@ -191,6 +191,7 @@ abstract class DeviceBlock(properties: Properties = Properties.of()): BaseBlock( val ent = level.getBlockEntity(pos) if(ent is DeviceBlockEntity) { ent.initNetworking() + ent.connectionsAreDirty = true } }