debug: totalMined打印stats map的size/挖掘条目数/总和

This commit is contained in:
AxTps committed 2026-10-06 20:32:15 +08:00
1 parent 72fbc95874
commit 8576395126
1 file changed
+5 -3
@@ -34,12 +34,14 @@ public final class BoardSyncManager {
/** 读取某玩家的挖掘总数(遍历该玩家的 stats,累加 BLOCK_MINED 类型条目)。 */ /** 读取某玩家的挖掘总数(遍历该玩家的 stats,累加 BLOCK_MINED 类型条目)。 */
private static int totalMined(ServerStatsCounter counter) { private static int totalMined(ServerStatsCounter counter) {
int sum = 0; int sum = 0;
for (var entry : counter.stats.object2IntEntrySet()) { int cnt = 0;
Stat<?> stat = entry.getKey(); for (Stat<?> stat : counter.stats.keySet()) {
if (stat.getType() == Stats.BLOCK_MINED) { if (stat.getType() == Stats.BLOCK_MINED) {
sum += entry.getIntValue(); cnt++;
sum += counter.getValue(stat);
} }
} }
com.github.zly2006.carpetslsaddition.ServerMain.LOGGER.info("[SLSA-BOARD] totalMined: mapSize={} minedTypes={} sum={}", counter.stats.size(), cnt, sum);
return sum; return sum;
} }
/** 读取某玩家的死亡次数。 */ /** 读取某玩家的死亡次数。 */