Breathing !
This commit is contained in:
@@ -1544,10 +1544,12 @@ export class GameServer {
|
||||
if (player.health > player.max_health) player.health = player.max_health;
|
||||
const { food, saturation } = player.vitals;
|
||||
const { health, max_health } = player;
|
||||
// in bubbles' halves like hunger, so it's only sent when a bubble changes, not every tick under water
|
||||
const air = Math.max(0, Math.ceil(player.air / player.max_air * 20));
|
||||
sync(
|
||||
"vitals",
|
||||
[health, max_health, food, saturation],
|
||||
() => ({ type: "vitals", health, max_health, food, saturation }),
|
||||
[health, max_health, food, saturation, air],
|
||||
() => ({ type: "vitals", health, max_health, food, saturation, air }),
|
||||
);
|
||||
const attack_speed = player.attribute(ATTRIBUTES.attack_speed);
|
||||
sync("attack_speed", attack_speed, () => ({ type: "attack_speed", value: attack_speed }));
|
||||
|
||||
Reference in New Issue
Block a user