PaperMC/paper-server/nms-patches/net/minecraft/server/AdvancementDataPlayer.patch
CraftBukkit/Spigot f8db65033c Update to Minecraft 1.19.1
By: md_5 <git@md-5.net>
2022-07-28 04:00:00 +10:00

23 lines
1.8 KiB
Diff

--- a/net/minecraft/server/AdvancementDataPlayer.java
+++ b/net/minecraft/server/AdvancementDataPlayer.java
@@ -179,7 +179,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.file);
+ // CraftBukkit start
+ if (entry.getKey().getNamespace().equals("minecraft")) {
+ AdvancementDataPlayer.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.file);
+ }
+ // CraftBukkit end
} else {
this.startProgress(advancement, (AdvancementProgress) entry.getValue());
}
@@ -274,6 +278,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);