blob: 8c5216bd1884e614a2486997c49c2d6074c31ce8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
--- a/net/minecraft/stats/StatsCounter.java
+++ b/net/minecraft/stats/StatsCounter.java
@@ -16,6 +16,12 @@
public void increment(Player player, Stat<?> stat, int i) {
int j = (int) Math.min((long) this.getValue(stat) + (long) i, 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);
}
|