Basin
This commit is contained in:
@@ -246,6 +246,20 @@ export class GameServer {
|
||||
on_entity_death: (entity, source) => {
|
||||
if (entity instanceof ServerPlayer) this.#kill(entity, source);
|
||||
},
|
||||
stands_on: (entity, x, y, z) => {
|
||||
const id = this.world.get_block_id(x, y, z);
|
||||
const components = this.mods.components_with(id, "on_entity_stand");
|
||||
if (components.length === 0) return;
|
||||
const block = this.mods.block_ref(x, y, z, id);
|
||||
for (const { mod, id: component_id, component, params } of components) {
|
||||
if (entity.removed) return;
|
||||
run_guarded(
|
||||
mod,
|
||||
`${component_id} on_entity_stand`,
|
||||
() => component.on_entity_stand!(block, params, entity_ref(entity)),
|
||||
);
|
||||
}
|
||||
},
|
||||
entity_loot: (entity, source) => {
|
||||
const table = EverythingRegistry.get<EntityJson>("entities", entity.type)?.loot_table;
|
||||
if (!table) return [];
|
||||
|
||||
Reference in New Issue
Block a user