Don't spam regular log, instead spam debug one
This commit is contained in:
parent
027d9747bd
commit
0321e1fa00
@ -7,6 +7,7 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap
|
|||||||
import it.unimi.dsi.fastutil.objects.ObjectArraySet
|
import it.unimi.dsi.fastutil.objects.ObjectArraySet
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet
|
import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet
|
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet
|
||||||
|
import it.unimi.dsi.fastutil.objects.Reference2IntArrayMap
|
||||||
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap
|
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap
|
||||||
import net.minecraft.core.BlockPos
|
import net.minecraft.core.BlockPos
|
||||||
import net.minecraft.core.Direction
|
import net.minecraft.core.Direction
|
||||||
@ -662,9 +663,18 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
|
|||||||
veto.add(player)
|
veto.add(player)
|
||||||
recheckPlayer(player)
|
recheckPlayer(player)
|
||||||
} else if (player !in veto) {
|
} else if (player !in veto) {
|
||||||
LOGGER.warn("$player got subscribed to ${ChunkPos(chunkPos)} multiple times without unsubscribing, forcefully resubscribing")
|
LOGGER.debug("{} got subscribed to {} without prior unsubscribing, forcefully resubscribing", player, ChunkPos(chunkPos))
|
||||||
|
player2ResubCount[player] = player2ResubCount.getInt(player) + 1
|
||||||
unsubscribe(player)
|
unsubscribe(player)
|
||||||
subscribe(player)
|
subscribe(player)
|
||||||
|
|
||||||
|
onceServer(20) {
|
||||||
|
val rem = player2ResubCount.removeInt(player)
|
||||||
|
|
||||||
|
if (rem > 0) {
|
||||||
|
LOGGER.warn("$player got subscribed to $rem chunks without prior unsubscribing, details in debug log")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -737,6 +747,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
|
|||||||
|
|
||||||
private val playerMap = WeakHashMap<ServerLevel, Long2ObjectOpenHashMap<ChunkSubscribers>>()
|
private val playerMap = WeakHashMap<ServerLevel, Long2ObjectOpenHashMap<ChunkSubscribers>>()
|
||||||
private val tickingMap = WeakHashMap<ServerLevel, WeakHashSet<ChunkSubscribers>>()
|
private val tickingMap = WeakHashMap<ServerLevel, WeakHashSet<ChunkSubscribers>>()
|
||||||
|
private val player2ResubCount = Reference2IntArrayMap<ServerPlayer>()
|
||||||
|
|
||||||
private val vec2Dir = Int2ObjectOpenHashMap<Direction>()
|
private val vec2Dir = Int2ObjectOpenHashMap<Direction>()
|
||||||
private val LOGGER = LogManager.getLogger()
|
private val LOGGER = LogManager.getLogger()
|
||||||
|
Loading…
Reference in New Issue
Block a user