mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
SPIGOT-1341: Cancelled cake interact decreases client hunger
This commit is contained in:
1 parent
8db0dbfc44
commit
45038571f9
4 files changed
+16
-9
No files matched your search
@@ -1304,12 +1304,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
injectScaledMaxHealth(set, true);
|
||||
|
||||
getHandle().getDataWatcher().set(EntityLiving.HEALTH, (float) getScaledHealth());
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel()));
|
||||
sendHealthUpdate();
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateAttributes(getHandle().getId(), set));
|
||||
|
||||
getHandle().maxHealthCache = getMaxHealth();
|
||||
}
|
||||
|
||||
public void sendHealthUpdate() {
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutUpdateHealth(getScaledHealth(), getHandle().getFoodData().getFoodLevel(), getHandle().getFoodData().getSaturationLevel()));
|
||||
}
|
||||
|
||||
public void injectScaledMaxHealth(Collection collection, boolean force) {
|
||||
if (!scaledHealth && !force) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user