mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-23 16:59:24 +00:00
29 lines
1.1 KiB
Diff
29 lines
1.1 KiB
Diff
--- a/net/minecraft/stats/ServerStatsCounter.java
|
|
+++ b/net/minecraft/stats/ServerStatsCounter.java
|
|
@@ -109,12 +_,6 @@
|
|
this.dirty.add(stat);
|
|
}
|
|
|
|
- private Set<Stat<?>> getDirty() {
|
|
- Set<Stat<?>> set = Sets.newHashSet(this.dirty);
|
|
- this.dirty.clear();
|
|
- return set;
|
|
- }
|
|
-
|
|
public void parse(DataFixer fixerUpper, JsonElement json) {
|
|
Dynamic<JsonElement> dynamic = new Dynamic<>(JsonOps.INSTANCE, json);
|
|
dynamic = DataFixTypes.STATS.updateToCurrentVersion(fixerUpper, dynamic, NbtUtils.getDataVersion(dynamic, 1343));
|
|
@@ -140,9 +_,11 @@
|
|
public void sendStats(ServerPlayer player) {
|
|
Object2IntMap<Stat<?>> map = new Object2IntOpenHashMap<>();
|
|
|
|
- for (Stat<?> stat : this.getDirty()) {
|
|
+ for (Stat<?> stat : this.dirty) { // DivineMC - SparklyPaper: Skip dirty stats copy when requesting player stats
|
|
map.put(stat, this.getValue(stat));
|
|
}
|
|
+
|
|
+ this.dirty.clear(); // DivineMC - SparklyPaper: Clear dirty stats after copying
|
|
|
|
player.connection.send(new ClientboundAwardStatsPacket(map));
|
|
}
|