almost fully fixing cables

fixes 1 edge-case, but the east bug is still goofed
This commit is contained in:
2026-04-30 00:50:12 +03:00
parent 5dbd0b8734
commit d8e79d8719
2 changed files with 3 additions and 1 deletions

View File

@@ -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)

View File

@@ -33,7 +33,7 @@ abstract class DeviceBlockEntity(type: BlockEntityType<*>, pos: BlockPos, state:
val connetionsInDir = MutableList<DeviceNode?>(Direction.entries.size) { null }
var alreadySetup = false
var receivedServerState = false
var connectionsAreDirty = false
var connectionsAreDirty = true
abstract fun getDeviceNodes(): List<DeviceNode>
@@ -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
}
}