mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-04 18:12:09 +01:00
16 lines
659 B
Diff
16 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);
|
||
|
}
|
||
|
|