From 622a2976d97775df8650d92be44cdb67ca4012ca Mon Sep 17 00:00:00 2001 From: t00thpick1 Date: Tue, 14 Jan 2014 23:42:40 -0500 Subject: [Bleeding] Fix Achievements and Statistics API. Fixes BUKKIT-5305 --- src/main/java/net/minecraft/server/StatisticManager.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/net/minecraft/server') diff --git a/src/main/java/net/minecraft/server/StatisticManager.java b/src/main/java/net/minecraft/server/StatisticManager.java index ba8e2134..86d186a5 100644 --- a/src/main/java/net/minecraft/server/StatisticManager.java +++ b/src/main/java/net/minecraft/server/StatisticManager.java @@ -20,6 +20,12 @@ public class StatisticManager { public void b(EntityHuman entityhuman, Statistic statistic, int i) { if (!statistic.d() || this.b((Achievement) statistic)) { + // CraftBukkit start + org.bukkit.event.Cancellable cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.handleStatisticsIncrease(entityhuman, statistic, a(statistic), i); + if (cancellable != null && cancellable.isCancelled()) { + return; + } + // CraftBukkit end this.a(entityhuman, statistic, this.a(statistic) + i); } } -- cgit v1.2.3