Undergarden mod !

This commit is contained in:
2026-09-30 17:30:14 -03:00
parent cbc9edfd60
commit 0052faa24d
21 changed files with 545 additions and 46 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
import { CHUNK_SIZE } from "$/common/constants.ts";
import { is_within_view } from "$/common/chunk_streaming.ts";
import type { ItemStack } from "$/common/inventory.ts";
import type { EntityInfo, ServerMessage } from "$/common/protocol.ts";
import type { EntityEvent, EntityInfo, ServerMessage } from "$/common/protocol.ts";
import type { ServerPlayer } from "../player.ts";
import type { ServerWorld } from "../world.ts";
import type { DamageSource, Entity, EntityLevel, SavedEntity } from "./entity.ts";
@@ -131,7 +131,7 @@ export class EntityManager implements EntityLevel {
}
// players aren't tracked like entities, everyone else knows about them
entity_event(entity: Entity, event: "hurt" | "death") {
entity_event(entity: Entity, event: EntityEvent) {
const is_player = this.#host.players().includes(entity as ServerPlayer);
for (const [player, tracked] of this.#tracked) {
if (is_player ? player !== entity : tracked.has(entity.id)) {