From 693384826a9c328ce08a4db99a6b068e0030c8b5 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Sat, 6 Sep 2025 02:32:53 -0400 Subject: [PATCH] Fix purpur food burp when full condition According to Purpur docs, the `burp-when-full` provides a option to play burp after completely filling the food level. Thus, it should go back to vanilla behavior if the option is disabled. Fix https://github.com/Winds-Studio/Leaf/issues/488 --- ...93-Fix-Pufferfish-and-Purpur-patches.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/leaf-server/minecraft-patches/features/0093-Fix-Pufferfish-and-Purpur-patches.patch b/leaf-server/minecraft-patches/features/0093-Fix-Pufferfish-and-Purpur-patches.patch index 3e7738c0..27c56437 100644 --- a/leaf-server/minecraft-patches/features/0093-Fix-Pufferfish-and-Purpur-patches.patch +++ b/leaf-server/minecraft-patches/features/0093-Fix-Pufferfish-and-Purpur-patches.patch @@ -305,6 +305,29 @@ index 5daa37fc0e44d3c4f3755ec3d3d89213f6670de1..c98a15653e388e7d8301ac4f6baa1109 } else if (maxProjectileChunkLoadsConfig.perProjectile.resetMovementAfterReachLimit) { this.setDeltaMovement(0, this.getDeltaMovement().y, 0); } +diff --git a/net/minecraft/world/food/FoodProperties.java b/net/minecraft/world/food/FoodProperties.java +index 20f702c8266eb54a8835861188eb937f4732e078..b6a1b7e8546402ae7640a45878c074439edeace0 100644 +--- a/net/minecraft/world/food/FoodProperties.java ++++ b/net/minecraft/world/food/FoodProperties.java +@@ -43,9 +43,15 @@ public record FoodProperties(int nutrition, float saturation, boolean canAlwaysE + if (entity instanceof Player player) { + player.getFoodData().eat(this, stack, (net.minecraft.server.level.ServerPlayer) player); // CraftBukkit + // Purpur start - Burp delay - moved to Player#tick() +- //level.playSound( +- // null, player.getX(), player.getY(), player.getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 0.5F, Mth.randomBetween(random, 0.9F, 1.0F) +- //); ++ // Leaf start - Fix Pufferfish and Purpur patches - vanilla food burp ++ // According to Purpur docs, the `burp-when-full` provides an option to play burp after completely filling the food level. ++ // Thus, it should go back to vanilla behavior if the option is disabled. ++ if (!player.level().purpurConfig.playerBurpWhenFull) { ++ level.playSound( ++ null, player.getX(), player.getY(), player.getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 0.5F, Mth.randomBetween(random, 0.9F, 1.0F) ++ ); ++ } ++ // Leaf end - Fix Pufferfish and Purpur patches - vanilla food burp + // Purpur end - Burp delay - moved to Player#tick() + } + } diff --git a/org/purpurmc/purpur/PurpurWorldConfig.java b/org/purpurmc/purpur/PurpurWorldConfig.java index a03e166b490952534e8050654c1afa975795f731..88a2ad8e3b30cb9f447eb4001d33c7799339b6a0 100644 --- a/org/purpurmc/purpur/PurpurWorldConfig.java