update blockentity backlog phrasing

This commit is contained in:
DBotThePony 2024-01-09 00:47:37 +07:00
parent e009ed33a3
commit dda015c5ef
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -17,6 +17,8 @@ import ru.dbotthepony.mc.otm.android.feature.ItemEntityDataPacket
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.client.minecraft
import ru.dbotthepony.mc.otm.client.onceClient
import ru.dbotthepony.mc.otm.core.collect.map
import ru.dbotthepony.mc.otm.core.collect.reduce
import ru.dbotthepony.mc.otm.item.QuantumBatteryItem
import ru.dbotthepony.mc.otm.matter.MatterManager
import java.util.*
@ -69,12 +71,11 @@ class BlockEntitySyncPacket(val position: BlockPos, val buffer: ByteArray, val v
val blockEntity = level.getBlockEntity(position)
if (blockEntity == null) {
LOGGER.warn("Putting BlockEntitySyncPacket received for $position into backlog because there is literally no block entity there! This is CERTAINLY a bug in one of optimizing mods you have or server has installed! This might cause memory leak.")
backlog.computeIfAbsent(level) { Object2ObjectOpenHashMap() }
val list = backlog.computeIfAbsent(level) { Object2ObjectOpenHashMap() }
.computeIfAbsent(position, Object2ObjectFunction { ArrayList() })
.add(this)
list.add(this)
LOGGER.warn("Putting BlockEntitySyncPacket received for $position into backlog (size: ${list.iterator().map { it.validBytes }.reduce(0, Int::plus) } bytes) because there is literally no block entity there! This might cause memory leak.")
return
} else if (blockEntity !is MatteryBlockEntity) {
LOGGER.warn("Dropping BlockEntitySyncPacket received for $position, because there is $blockEntity which is not MatteryBlockEntity!")