Paper/Spigot-Server-Patches/0193-PlayerAdvancementCriterionGrantEvent.patch

24 lines
1.1 KiB
Diff
Raw Normal View History

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 ca661f3933dad81150654551de4679fe2baeb138..c41e1384724ab150f43dc43fe2a453c9b1262e48 100644
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
2019-04-28 19:59:47 +02:00
@@ -276,6 +276,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.i.add(advancement);
flag = true;