This commit is contained in:
DBotThePony 2024-01-09 18:26:02 +07:00
commit d4dc6b09c3
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,8 +491,10 @@ 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 {
synchronizeToPlayers(true)
onceServer {
if (!isRemoved) {
synchronizeToPlayers(true)
}
}
} else {
markSynchronizerClean()
@ -527,8 +529,10 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
}
} else {
level.once {
for (side in _sides.values) {
side.updateTracked()
if (!isRemoved) {
for (side in _sides.values) {
side.updateTracked()
}
}
}
}
@ -671,7 +675,9 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
if (!blockEntities.add(blockEntity)) return
onceServer {
blockEntity.synchronizeToPlayers(false)
if (!blockEntity.isRemoved && blockEntity in blockEntities) {
blockEntity.synchronizeToPlayers(false)
}
}
if (blockEntity.synchronizer.hasObservers && blockEntity.tickList.ticks == 0) {