mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
15 lines
651 B
Diff
15 lines
651 B
Diff
--- a/net/minecraft/stats/StatsCounter.java
|
|
+++ b/net/minecraft/stats/StatsCounter.java
|
|
@@ -14,6 +_,12 @@
|
|
|
|
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), i);
|
|
+ if (cancellable != null && cancellable.isCancelled()) {
|
|
+ return;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
this.setValue(player, stat, i);
|
|
}
|
|
|