From f5b99917e653cfbfebaa002aec005f4194cd3c22 Mon Sep 17 00:00:00 2001 From: granny Date: Mon, 30 Jun 2025 12:06:18 -0700 Subject: [PATCH] Updated Upstream (Paper) Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@57c202e0 Allow adventure nbt codec to parse all tags PaperMC/Paper@4d854e66 Disable MC-163962 fix by default PaperMC/Paper@dda39a0f 1.21.7-rc2 PaperMC/Paper@7f609243 Configuration API (#12301) PaperMC/Paper@371a4225 Remove a bunch more experimental annotations (#12712) PaperMC/Paper@a9f74cbf Readd dropped diff during 1.21.6 --- gradle.properties | 2 +- .../net/minecraft/server/commands/GiveCommand.java.patch | 2 +- .../minecraft/world/item/trading/MerchantOffer.java.patch | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4151905b8..ba584a3f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group = org.purpurmc.purpur version = 1.21.7-R0.1-SNAPSHOT mcVersion = 1.21.7-rc2 -paperCommit = ab1b472c5663f4123632770db8ea509b9be49e20 +paperCommit = a9f74cbf6e740c76ad812abde855434abc9526a0 org.gradle.configuration-cache = true org.gradle.caching = true diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/server/commands/GiveCommand.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/server/commands/GiveCommand.java.patch index 983f2b9cd..e7a366475 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/server/commands/GiveCommand.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/server/commands/GiveCommand.java.patch @@ -6,5 +6,5 @@ boolean flag = serverPlayer.getInventory().add(itemStack1); + if (org.purpurmc.purpur.PurpurConfig.disableGiveCommandDrops) continue; // Purpur - add config option for toggling give command dropping if (flag && itemStack1.isEmpty()) { - ItemEntity itemEntity = serverPlayer.drop(itemStack, false); + ItemEntity itemEntity = serverPlayer.drop(itemStack, false, false, false, null); // Paper - do not fire PlayerDropItemEvent for /give command if (itemEntity != null) { diff --git a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/trading/MerchantOffer.java.patch b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/trading/MerchantOffer.java.patch index 6a3b114a8..d173c48d1 100644 --- a/purpur-server/minecraft-patches/sources/net/minecraft/world/item/trading/MerchantOffer.java.patch +++ b/purpur-server/minecraft-patches/sources/net/minecraft/world/item/trading/MerchantOffer.java.patch @@ -1,16 +1,17 @@ --- a/net/minecraft/world/item/trading/MerchantOffer.java +++ b/net/minecraft/world/item/trading/MerchantOffer.java -@@ -143,7 +_,12 @@ +@@ -143,8 +_,13 @@ } public void updateDemand() { -- this.demand = Math.max(0, this.demand + this.uses - (this.maxUses - this.uses)); // Paper - Fix MC-163962 + // Purpur start - Configurable minimum demand for trades + this.updateDemand(0); + } + public void updateDemand(int minimumDemand) { -+ this.demand = Math.max(minimumDemand, this.demand + this.uses - (this.maxUses - this.uses)); // Paper - Fix MC-163962 + // Purpur end - Configurable minimum demand for trades + this.demand = this.demand + this.uses - (this.maxUses - this.uses); +- if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.preventNegativeVillagerDemand) this.demand = Math.max(0, this.demand); // Paper - Fix MC-163962 ++ if (io.papermc.paper.configuration.GlobalConfiguration.get().misc.preventNegativeVillagerDemand) this.demand = Math.max(minimumDemand, this.demand); // Paper - Fix MC-163962 // Purpur - Configurable minimum demand for trades } public ItemStack assemble() {