mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
30e4583dbe
By: Initial Source <noreply+automated@papermc.io>
15 lines
659 B
Diff
15 lines
659 B
Diff
--- a/net/minecraft/stats/StatsCounter.java
|
|
+++ b/net/minecraft/stats/StatsCounter.java
|
|
@@ -16,6 +16,12 @@
|
|
public void increment(Player player, Stat<?> stat, int value) {
|
|
int j = (int) Math.min((long) this.getValue(stat) + (long) value, 2147483647L);
|
|
|
|
+ // CraftBukkit start - fire Statistic events
|
|
+ org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(player, stat, this.getValue(stat), j);
|
|
+ if (cancellable != null && cancellable.isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.setValue(player, stat, j);
|
|
}
|
|
|