Fix block entity synchers sometimes not ticking

This commit is contained in:
DBotThePony 2024-08-31 10:48:33 +07:00
parent d38c780fdd
commit 577ea070db
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -70,8 +70,6 @@ import kotlin.collections.ArrayList
* Absolute barebone (lol) block entity class in Overdrive that Matters, providing bare minimum (lulmao, minecraft engine) functionality
*/
abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(p_155228_, p_155229_, p_155230_), INeighbourChangeListener {
private var isSynchronizing = false
private val sidelessCaps = Reference2ObjectOpenHashMap<BlockCapability<*, *>, Any>()
private val sidedCaps = Array(RelativeSide.entries.size) {
Reference2ObjectOpenHashMap<BlockCapability<*, *>, ControllableCapability<*>>()
@ -470,6 +468,8 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
blockEntities.forEach {
it.synchers[player] = it.syncher.Remote()
}
checkShouldTick()
}
} else if (player in players && player.hasDisconnected()) {
unsubscribe(player)
@ -513,6 +513,8 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
blockEntity.synchers[it] = blockEntity.syncher.Remote()
}
}
checkShouldTick()
}
}