Paper/Spigot-Server-Patches/0264-PlayerAdvancementCriterionGrantEvent.patch
Minecrell e15167251b Add extended PaperServerListPingEvent (#980)
* Drop original implementation for old player sample API

* Add extended PaperServerListPingEvent

Add a new event that extends the original ServerListPingEvent
and allows full control of the response sent to the client.

* Implement deprecated player sample API
2018-03-22 23:19:59 -04:00

27 lines
1.1 KiB
Diff

From e6ed90358568cc2422eab0f489fd2e1be0b2ea7c 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 6896b7095..8913e2744 100644
--- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
+++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java
@@ -196,6 +196,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;
--
2.16.2