send help

This commit is contained in:
DBotThePony 2024-01-09 18:23:38 +07:00
parent 80155ba7bc
commit c45f5f6029
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -342,7 +342,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
optional.invalidate()
if (SERVER_IS_LIVE)
level?.once { setChanged() }
level?.once { if (!this@MatteryBlockEntity.isRemoved) setChanged() }
}
}
@ -354,7 +354,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
optional = LazyOptional.of { capability }
if (SERVER_IS_LIVE)
level?.once { setChanged() }
level?.once { if (!this@MatteryBlockEntity.isRemoved) setChanged() }
}
}
}
@ -365,7 +365,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
optional.invalidate()
if (SERVER_IS_LIVE)
level?.once { setChanged() }
level?.once { if (!this@MatteryBlockEntity.isRemoved) setChanged() }
}
}
@ -377,7 +377,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
optional = LazyOptional.of { capability }
if (SERVER_IS_LIVE)
level?.once { setChanged() }
level?.once { if (!this@MatteryBlockEntity.isRemoved) setChanged() }
}
}
}
@ -491,9 +491,11 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
if (isRemoved) markSynchronizerClean()
if (level?.isClientSide == false && (_subCache == null || (_subCache ?: throw ConcurrentModificationException()).players.isNotEmpty())) {
ru.dbotthepony.mc.otm.onceServer {
onceServer {
if (!isRemoved) {
synchronizeToPlayers(true)
}
}
} else {
markSynchronizerClean()
}
@ -527,11 +529,13 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
}
} else {
level.once {
if (!isRemoved) {
for (side in _sides.values) {
side.updateTracked()
}
}
}
}
waitForServerLevel.forEach { it.invoke() }
} else {
@ -675,8 +679,10 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
if (!blockEntities.add(blockEntity)) return
onceServer {
if (!blockEntity.isRemoved && blockEntity in blockEntities) {
blockEntity.synchronizeToPlayers(false)
}
}
if (blockEntity.synchronizer.hasObservers && blockEntity.tickList.ticks == 0) {
blockEntitiesWithObservers.add(blockEntity)