Sounds on shared and server
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user