update blockentity backlog phrasing
This commit is contained in:
parent
e009ed33a3
commit
dda015c5ef
@ -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!")
|
||||
|
Loading…
Reference in New Issue
Block a user