aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNassim Jahnke <[email protected]>2024-12-17 22:19:33 +0100
committerNassim Jahnke <[email protected]>2024-12-17 22:19:33 +0100
commitc55ad7092c017818459fc60b7b07d247cef05353 (patch)
tree3753e5a981d46ecee32c80d952f8f0126e14849e
parent972266605eeedbda16a8f37fa8744fee538a833a (diff)
downloadPaper-c55ad7092c017818459fc60b7b07d247cef05353.tar.gz
Paper-c55ad7092c017818459fc60b7b07d247cef05353.zip
Fix stats event call
-rw-r--r--paper-server/patches/sources/net/minecraft/stats/StatsCounter.java.patch10
1 files changed, 5 insertions, 5 deletions
diff --git a/paper-server/patches/sources/net/minecraft/stats/StatsCounter.java.patch b/paper-server/patches/sources/net/minecraft/stats/StatsCounter.java.patch
index 5c300c2297..a1a5baa229 100644
--- a/paper-server/patches/sources/net/minecraft/stats/StatsCounter.java.patch
+++ b/paper-server/patches/sources/net/minecraft/stats/StatsCounter.java.patch
@@ -1,15 +1,15 @@
--- a/net/minecraft/stats/StatsCounter.java
+++ b/net/minecraft/stats/StatsCounter.java
-@@ -18,6 +_,12 @@
- }
+@@ -14,6 +_,12 @@
- public void setValue(Player player, Stat<?> stat, int value) {
+ public void increment(Player player, Stat<?> stat, int amount) {
+ int i = (int)Math.min((long)this.getValue(stat) + amount, 2147483647L);
+ // CraftBukkit start - fire Statistic events
-+ org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(player, stat, this.getValue(stat), value);
++ org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(player, stat, this.getValue(stat), i);
+ if (cancellable != null && cancellable.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
- this.stats.put(stat, value);
+ this.setValue(player, stat, i);
}