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 } }