2024-12-11 22:26:55 +01:00
|
|
|
--- a/net/minecraft/stats/StatsCounter.java
|
|
|
|
+++ b/net/minecraft/stats/StatsCounter.java
|
2024-12-17 22:19:33 +01:00
|
|
|
@@ -14,6 +_,12 @@
|
2024-12-11 22:26:55 +01:00
|
|
|
|
2024-12-17 22:19:33 +01:00
|
|
|
public void increment(Player player, Stat<?> stat, int amount) {
|
|
|
|
int i = (int)Math.min((long)this.getValue(stat) + amount, 2147483647L);
|
2024-12-11 22:26:55 +01:00
|
|
|
+ // CraftBukkit start - fire Statistic events
|
2024-12-17 22:19:33 +01:00
|
|
|
+ org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(player, stat, this.getValue(stat), i);
|
2024-12-11 22:26:55 +01:00
|
|
|
+ if (cancellable != null && cancellable.isCancelled()) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2024-12-17 22:19:33 +01:00
|
|
|
this.setValue(player, stat, i);
|
2024-12-11 22:26:55 +01:00
|
|
|
}
|
|
|
|
|