PaperMC/paper-server/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch

24 lines
1.9 KiB
Diff
Raw Normal View History

--- a/net/minecraft/server/AdvancementDataPlayer.java
+++ b/net/minecraft/server/AdvancementDataPlayer.java
@@ -144,7 +144,11 @@
Advancement advancement = advancementdataworld.getAdvancement((MinecraftKey) entry.getKey());
if (advancement == null) {
- AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.playerSavePath);
+ // CraftBukkit start
+ if (entry.getKey().getNamespace().equals("minecraft")) {
+ AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.playerSavePath);
+ }
+ // CraftBukkit end
} else {
this.startProgress(advancement, (AdvancementProgress) entry.getValue());
this.progressChanged.add(advancement);
@@ -227,6 +231,7 @@
this.progressChanged.add(advancement);
flag = true;
if (!flag1 && advancementprogress.isDone()) {
+ this.player.level().getCraftServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.bukkit)); // CraftBukkit
advancement.getRewards().grant(this.player);
if (advancement.getDisplay() != null && advancement.getDisplay().shouldAnnounceChat() && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) {
this.playerList.broadcastSystemMessage(IChatBaseComponent.translatable("chat.type.advancement." + advancement.getDisplay().getFrame().getName(), this.player.getDisplayName(), advancement.getChatComponent()), false);