Sounds on shared and server

This commit is contained in:
2026-11-22 07:44:13 -03:00
parent 47934b272c
commit 8e587f6446
16 changed files with 386 additions and 30 deletions
+5
View File
@@ -202,6 +202,11 @@ export class ServerPlayer extends LivingEntity {
return this.inventory.get_item(this.selected_slot);
}
// whether a sound at x y z heard as far as range reaches their ears
hears(x: number, y: number, z: number, range: number) {
return Math.hypot(x - this.x, y - (this.y + this.eye_height), z - this.z) < range;
}
// the short box and low eyes while swimming, so drowning, reach and what they're in the way of match
set_swimming(swimming: boolean) {
this.swimming = swimming;