9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-28 11:29:11 +00:00
Files
Leaf/leaf-archived-patches/unapplied/server/minecraft-patches/features/0111-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch
Dreeam 236010caba Cooking Tutorial
1. Wet the drys
2. Dry the wets
3. Wet the drys
4. Dry the wets
5. Wet the drys
6. Now dust the wets
2025-03-28 03:11:27 -04:00

42 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Mon, 13 Jan 2025 14:32:08 -0300
Subject: [PATCH] SparklyPaper: Skip dirty stats copy when requesting player
stats
diff --git a/net/minecraft/stats/ServerStatsCounter.java b/net/minecraft/stats/ServerStatsCounter.java
index b26dbe807e5cb0a42f6c06b933397902310e5616..ce89060bd01b253af7577fd0e6c03fc95f046b91 100644
--- a/net/minecraft/stats/ServerStatsCounter.java
+++ b/net/minecraft/stats/ServerStatsCounter.java
@@ -81,11 +81,15 @@ public class ServerStatsCounter extends StatsCounter {
this.dirty.add(stat);
}
+ // SparklyPaper start - Skip dirty stats copy when requesting player stats
+ /*
private Set<Stat<?>> getDirty() {
Set<Stat<?>> set = Sets.newHashSet(this.dirty);
this.dirty.clear();
return set;
}
+ */
+ // SparklyPaper end
public void parseLocal(DataFixer fixerUpper, String json) {
try {
@@ -194,10 +198,12 @@ public class ServerStatsCounter extends StatsCounter {
public void sendStats(ServerPlayer player) {
Object2IntMap<Stat<?>> map = new Object2IntOpenHashMap<>();
- for (Stat<?> stat : this.getDirty()) {
+ for (Stat<?> stat : this.dirty) { // SparklyPaper - Skip dirty stats copy when requesting player stats
map.put(stat, this.getValue(stat));
}
+ this.dirty.clear(); // SparklyPaper - Skip dirty stats copy when requesting player stats
+
player.connection.send(new ClientboundAwardStatsPacket(map));
}
}