mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user