Animators and coilhead animations
This commit is contained in:
@@ -750,6 +750,12 @@ export class ModRuntime {
|
||||
mob.level.entity_event(mob, "swing");
|
||||
mob.do_hurt_target(entity);
|
||||
},
|
||||
get_client_data: (field) => structuredClone(mob.client_data[field]) as never,
|
||||
set_client_data(field, value) {
|
||||
if (typeof field !== "string" || field === "") throw new Error("a client data field needs a name");
|
||||
const { [field]: _, ...rest } = mob.client_data;
|
||||
mob.client_data = value === undefined ? rest : { ...rest, [field]: structuredClone(value) };
|
||||
},
|
||||
};
|
||||
return Object.defineProperties(living_ref(mob), Object.getOwnPropertyDescriptors(extra)) as MobRef;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user