Paper/nms-patches/StatisticManager.patch

16 Zeilen
693 B
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/StatisticManager.java
+++ b/net/minecraft/server/StatisticManager.java
2017-05-14 04:00:00 +02:00
@@ -10,6 +10,12 @@
public StatisticManager() {}
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