Fix attaching stabilizers not instantly updating black hole properties on client

This commit is contained in:
DBotThePony 2022-10-02 21:33:19 +07:00
parent c240f9cc1a
commit ffc56ada1a
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -95,8 +95,18 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro
sleepTicks = 4
}
private fun updateMass() {
mass = mass
}
private val stabilizers = LinkedList<GravitationStabilizerBlockEntity>()
private var stabilizerClientCount by synchronizer.int()
private var stabilizerClientCount by synchronizer.int(setter = setter@{ value, field, setByRemote ->
field.write(value)
if (setByRemote) {
updateMass()
}
})
fun stabilizerAttached(stabilizer: GravitationStabilizerBlockEntity) {
if (stabilizer in stabilizers)