From 20f31c62d237e00321cb96f9c3852ff056b7fe28 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 5 Dec 2023 20:34:04 -0700 Subject: [PATCH] some patches :D --- ...-Adventure-message-to-PlayerAdvancementDoneEvent.patch | 8 ++++++-- .../server/Add-Channel-initialization-listeners.patch | 0 .../server/Add-EntityBlockStorage-clearEntities.patch | 0 .../{unapplied => }/server/Add-bypass-host-check.patch | 0 .../server/Add-more-WanderingTrader-API.patch | 0 .../server/Added-PlayerBedFailEnterEvent.patch | 0 .../server/Added-PlayerDeepSleepEvent.patch | 0 .../server/Entity-load-save-limit-per-chunk.patch | 0 ...anchor-respawn-acting-as-a-bed-respawn-from-the-.patch | 0 ...ement-methods-to-convert-between-Component-and-B.patch | 0 .../Introduce-beacon-activation-deactivation-events.patch | 0 patches/{unapplied => }/server/More-World-API.patch | 0 ...end-empty-commands-if-tab-completion-is-disabled.patch | 0 .../server/Set-area-affect-cloud-rotation.patch | 0 .../server/add-RespawnFlags-to-PlayerRespawnEvent.patch | 0 .../server/add-consumeFuel-to-FurnaceBurnEvent.patch | 0 .../add-get-set-drop-chance-to-EntityEquipment.patch | 0 .../server/add-isDeeplySleeping-to-HumanEntity.patch | 0 .../server/fix-PigZombieAngerEvent-cancellation.patch | 0 .../server/fix-PlayerItemHeldEvent-firing-twice.patch | 0 20 files changed, 6 insertions(+), 2 deletions(-) rename patches/{unapplied => }/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch (82%) rename patches/{unapplied => }/server/Add-Channel-initialization-listeners.patch (100%) rename patches/{unapplied => }/server/Add-EntityBlockStorage-clearEntities.patch (100%) rename patches/{unapplied => }/server/Add-bypass-host-check.patch (100%) rename patches/{unapplied => }/server/Add-more-WanderingTrader-API.patch (100%) rename patches/{unapplied => }/server/Added-PlayerBedFailEnterEvent.patch (100%) rename patches/{unapplied => }/server/Added-PlayerDeepSleepEvent.patch (100%) rename patches/{unapplied => }/server/Entity-load-save-limit-per-chunk.patch (100%) rename patches/{unapplied => }/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch (100%) rename patches/{unapplied => }/server/Implement-methods-to-convert-between-Component-and-B.patch (100%) rename patches/{unapplied => }/server/Introduce-beacon-activation-deactivation-events.patch (100%) rename patches/{unapplied => }/server/More-World-API.patch (100%) rename patches/{unapplied => }/server/Send-empty-commands-if-tab-completion-is-disabled.patch (100%) rename patches/{unapplied => }/server/Set-area-affect-cloud-rotation.patch (100%) rename patches/{unapplied => }/server/add-RespawnFlags-to-PlayerRespawnEvent.patch (100%) rename patches/{unapplied => }/server/add-consumeFuel-to-FurnaceBurnEvent.patch (100%) rename patches/{unapplied => }/server/add-get-set-drop-chance-to-EntityEquipment.patch (100%) rename patches/{unapplied => }/server/add-isDeeplySleeping-to-HumanEntity.patch (100%) rename patches/{unapplied => }/server/fix-PigZombieAngerEvent-cancellation.patch (100%) rename patches/{unapplied => }/server/fix-PlayerItemHeldEvent-firing-twice.patch (100%) diff --git a/patches/unapplied/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch b/patches/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch similarity index 82% rename from patches/unapplied/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch rename to patches/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch index d25b1fc741..0340317d7e 100644 --- a/patches/unapplied/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch +++ b/patches/server/Add-Adventure-message-to-PlayerAdvancementDoneEvent.patch @@ -14,14 +14,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!flag1 && advancementprogress.isDone()) { - this.player.level().getCraftServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.toBukkit())); // CraftBukkit + // Paper start - Add Adventure message to PlayerAdvancementDoneEvent -+ final net.kyori.adventure.text.Component message = advancement.value().display().flatMap(info -> java.util.Optional.ofNullable(info.shouldAnnounceChat() ? io.papermc.paper.adventure.PaperAdventure.asAdventure(Component.translatable("chat.type.advancement." + info.getFrame().getName(), this.player.getDisplayName(), Advancement.name(advancement))) : null)).orElse(null); ++ final net.kyori.adventure.text.Component message = advancement.value().display().flatMap(info -> { ++ return java.util.Optional.ofNullable( ++ info.shouldAnnounceChat() ? io.papermc.paper.adventure.PaperAdventure.asAdventure(info.getType().createAnnouncement(advancement, this.player)) : null ++ ); ++ }).orElse(null); + final org.bukkit.event.player.PlayerAdvancementDoneEvent event = new org.bukkit.event.player.PlayerAdvancementDoneEvent(this.player.getBukkitEntity(), advancement.toBukkit(), message); + this.player.level().getCraftServer().getPluginManager().callEvent(event); // CraftBukkit + // Paper end advancement.value().rewards().grant(this.player); advancement.value().display().ifPresent((advancementdisplay) -> { - if (advancementdisplay.shouldAnnounceChat() && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) { -- this.playerList.broadcastSystemMessage(Component.translatable("chat.type.advancement." + advancementdisplay.getFrame().getName(), this.player.getDisplayName(), Advancement.name(advancement)), false); +- this.playerList.broadcastSystemMessage(advancementdisplay.getType().createAnnouncement(advancement, this.player), false); + // Paper start - Add Adventure message to PlayerAdvancementDoneEvent + if (event.message() != null && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) { + this.playerList.broadcastSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.message()), false); diff --git a/patches/unapplied/server/Add-Channel-initialization-listeners.patch b/patches/server/Add-Channel-initialization-listeners.patch similarity index 100% rename from patches/unapplied/server/Add-Channel-initialization-listeners.patch rename to patches/server/Add-Channel-initialization-listeners.patch diff --git a/patches/unapplied/server/Add-EntityBlockStorage-clearEntities.patch b/patches/server/Add-EntityBlockStorage-clearEntities.patch similarity index 100% rename from patches/unapplied/server/Add-EntityBlockStorage-clearEntities.patch rename to patches/server/Add-EntityBlockStorage-clearEntities.patch diff --git a/patches/unapplied/server/Add-bypass-host-check.patch b/patches/server/Add-bypass-host-check.patch similarity index 100% rename from patches/unapplied/server/Add-bypass-host-check.patch rename to patches/server/Add-bypass-host-check.patch diff --git a/patches/unapplied/server/Add-more-WanderingTrader-API.patch b/patches/server/Add-more-WanderingTrader-API.patch similarity index 100% rename from patches/unapplied/server/Add-more-WanderingTrader-API.patch rename to patches/server/Add-more-WanderingTrader-API.patch diff --git a/patches/unapplied/server/Added-PlayerBedFailEnterEvent.patch b/patches/server/Added-PlayerBedFailEnterEvent.patch similarity index 100% rename from patches/unapplied/server/Added-PlayerBedFailEnterEvent.patch rename to patches/server/Added-PlayerBedFailEnterEvent.patch diff --git a/patches/unapplied/server/Added-PlayerDeepSleepEvent.patch b/patches/server/Added-PlayerDeepSleepEvent.patch similarity index 100% rename from patches/unapplied/server/Added-PlayerDeepSleepEvent.patch rename to patches/server/Added-PlayerDeepSleepEvent.patch diff --git a/patches/unapplied/server/Entity-load-save-limit-per-chunk.patch b/patches/server/Entity-load-save-limit-per-chunk.patch similarity index 100% rename from patches/unapplied/server/Entity-load-save-limit-per-chunk.patch rename to patches/server/Entity-load-save-limit-per-chunk.patch diff --git a/patches/unapplied/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch b/patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch similarity index 100% rename from patches/unapplied/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch rename to patches/server/Fix-anchor-respawn-acting-as-a-bed-respawn-from-the-.patch diff --git a/patches/unapplied/server/Implement-methods-to-convert-between-Component-and-B.patch b/patches/server/Implement-methods-to-convert-between-Component-and-B.patch similarity index 100% rename from patches/unapplied/server/Implement-methods-to-convert-between-Component-and-B.patch rename to patches/server/Implement-methods-to-convert-between-Component-and-B.patch diff --git a/patches/unapplied/server/Introduce-beacon-activation-deactivation-events.patch b/patches/server/Introduce-beacon-activation-deactivation-events.patch similarity index 100% rename from patches/unapplied/server/Introduce-beacon-activation-deactivation-events.patch rename to patches/server/Introduce-beacon-activation-deactivation-events.patch diff --git a/patches/unapplied/server/More-World-API.patch b/patches/server/More-World-API.patch similarity index 100% rename from patches/unapplied/server/More-World-API.patch rename to patches/server/More-World-API.patch diff --git a/patches/unapplied/server/Send-empty-commands-if-tab-completion-is-disabled.patch b/patches/server/Send-empty-commands-if-tab-completion-is-disabled.patch similarity index 100% rename from patches/unapplied/server/Send-empty-commands-if-tab-completion-is-disabled.patch rename to patches/server/Send-empty-commands-if-tab-completion-is-disabled.patch diff --git a/patches/unapplied/server/Set-area-affect-cloud-rotation.patch b/patches/server/Set-area-affect-cloud-rotation.patch similarity index 100% rename from patches/unapplied/server/Set-area-affect-cloud-rotation.patch rename to patches/server/Set-area-affect-cloud-rotation.patch diff --git a/patches/unapplied/server/add-RespawnFlags-to-PlayerRespawnEvent.patch b/patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch similarity index 100% rename from patches/unapplied/server/add-RespawnFlags-to-PlayerRespawnEvent.patch rename to patches/server/add-RespawnFlags-to-PlayerRespawnEvent.patch diff --git a/patches/unapplied/server/add-consumeFuel-to-FurnaceBurnEvent.patch b/patches/server/add-consumeFuel-to-FurnaceBurnEvent.patch similarity index 100% rename from patches/unapplied/server/add-consumeFuel-to-FurnaceBurnEvent.patch rename to patches/server/add-consumeFuel-to-FurnaceBurnEvent.patch diff --git a/patches/unapplied/server/add-get-set-drop-chance-to-EntityEquipment.patch b/patches/server/add-get-set-drop-chance-to-EntityEquipment.patch similarity index 100% rename from patches/unapplied/server/add-get-set-drop-chance-to-EntityEquipment.patch rename to patches/server/add-get-set-drop-chance-to-EntityEquipment.patch diff --git a/patches/unapplied/server/add-isDeeplySleeping-to-HumanEntity.patch b/patches/server/add-isDeeplySleeping-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/add-isDeeplySleeping-to-HumanEntity.patch rename to patches/server/add-isDeeplySleeping-to-HumanEntity.patch diff --git a/patches/unapplied/server/fix-PigZombieAngerEvent-cancellation.patch b/patches/server/fix-PigZombieAngerEvent-cancellation.patch similarity index 100% rename from patches/unapplied/server/fix-PigZombieAngerEvent-cancellation.patch rename to patches/server/fix-PigZombieAngerEvent-cancellation.patch diff --git a/patches/unapplied/server/fix-PlayerItemHeldEvent-firing-twice.patch b/patches/server/fix-PlayerItemHeldEvent-firing-twice.patch similarity index 100% rename from patches/unapplied/server/fix-PlayerItemHeldEvent-firing-twice.patch rename to patches/server/fix-PlayerItemHeldEvent-firing-twice.patch