PaperMC/nms-patches/StatisticManager.patch

16 lines
669 B
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/StatisticManager.java
+++ b/net/minecraft/server/StatisticManager.java
2018-07-15 02:00:00 +02:00
@@ -13,6 +13,12 @@
}
2018-07-15 02:00:00 +02:00
public void b(EntityHuman entityhuman, Statistic<?> statistic, int i) {
2017-05-14 04:00:00 +02:00
+ // CraftBukkit start - fire Statistic events
+ org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(entityhuman, statistic, this.getStatisticValue(statistic), i);
+ if (cancellable != null && cancellable.isCancelled()) {
+ return;
+ }
+ // CraftBukkit end
this.setStatistic(entityhuman, statistic, this.getStatisticValue(statistic) + i);
}
2015-02-26 23:41:06 +01:00