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 }));
|
||||
|
||||
@@ -126,11 +126,6 @@ export class ServerPlayer extends LivingEntity {
|
||||
return false;
|
||||
}
|
||||
|
||||
// there's no air bar to show yet, so players don't drown
|
||||
override get can_breathe_underwater() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// their client moves them, this only burns, falls out of the world and counts effects and hurt time down. while
|
||||
// knocked back it moves them like a mob that isn't walking anywhere, landing hands them back to their client
|
||||
override tick() {
|
||||
|
||||
Reference in New Issue
Block a user