aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0190-PlayerAdvancementCriterionGrantEvent.patch
blob: e919ba303208109c473da31ad775d0f481df439f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 19 Jan 2018 08:15:29 -0600
Subject: [PATCH] PlayerAdvancementCriterionGrantEvent


diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
index d832cc2f3cc1ee73299a7f07eb2ccc3d392d5cf8..7d37626277823d5db05189c20bb1ebf91aa2a286 100644
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
@@ -297,6 +297,12 @@ public class AdvancementDataPlayer {
         boolean flag1 = advancementprogress.isDone();
 
         if (advancementprogress.a(s)) {
+            // Paper start
+            if (!new com.destroystokyo.paper.event.player.PlayerAdvancementCriterionGrantEvent(this.player.getBukkitEntity(), advancement.bukkit, s).callEvent()) {
+                advancementprogress.b(s);
+                return false;
+            }
+            // Paper end
             this.d(advancement);
             this.j.add(advancement);
             flag = true;