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
+3
View File
@@ -15,6 +15,7 @@ import type { Season } from "@/common/worldgen/biomes.ts";
import { type Collisions, type FluidInCell, physics } from "@/common/physics.ts";
import type { EntityData, EntityEvent, EntityInfo } from "@/common/protocol.ts";
import type { ServerPlayer } from "../player.ts";
import type { PlayOptions } from "@/common/mod_api/shared.ts";
import type { LivingEntity } from "./living_entity.ts";
// this far below the bottom of the world, entities have fallen out of it
@@ -102,6 +103,8 @@ export interface EntityLevel {
take_item(item: Entity, by: string): void;
// sent to clients tracking the entity, for the renderer: "hurt" flashes it red, "death" starts falling over
entity_event(entity: Entity, event: EntityEvent): void;
// a sound following it, for the players tracking it within its range, see EntityRef.play_sound
play_sound(entity: Entity, sound: string, options: PlayOptions): void;
// it died, after dropping its things
on_death(entity: Entity, source: DamageSource): void;
// what it drops when it dies, from its type's loot table