3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 07:10:10 +01:00
Paper/nms-patches/StatisticManager.patch

16 Zeilen
725 B
Diff

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