Burp delay, burp after eating food fills hunger bar completely

This commit is contained in:
William Blake Galbreath
2025-01-11 22:01:13 -08:00
committed by granny
parent ceb9e70170
commit 1acf069964
7 changed files with 63 additions and 105 deletions

View File

@@ -1,6 +1,12 @@
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
@@ -205,6 +_,13 @@
@@ -200,11 +_,19 @@
private int currentImpulseContextResetGraceTime;
public boolean affectsSpawning = true; // Paper - Affects Spawning API
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
+ public int burpDelay = 0; // Purpur - Burp delay
// CraftBukkit start
public boolean fauxSleeping;
public int oldLevel = -1;
@@ -14,6 +20,19 @@
@Override
public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() {
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
@@ -262,6 +_,12 @@
@Override
public void tick() {
+ // Purpur start - Burp delay
+ if (this.burpDelay > 0 && --this.burpDelay == 0) {
+ this.level().playSound(null, getX(), getY(), getZ(), SoundEvents.PLAYER_BURP, SoundSource.PLAYERS, 1.0F, this.level().random.nextFloat() * 0.1F + 0.9F);
+ }
+ // Purpur end - Burp delay
+
this.noPhysics = this.isSpectator();
if (this.isSpectator() || this.isPassenger()) {
this.setOnGround(false);
@@ -340,6 +_,17 @@
this.turtleHelmetTick();
}