-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathentity.d.ts
55 lines (46 loc) · 1.53 KB
/
entity.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import type { MtToolCapabilities } from "./item";
import { MtNodeBox } from "./node";
import type { MtObjRef, MtObjProperties } from "./object";
import type { MtVec3 } from "./vector";
export interface MtPointedThing {
type: "nothing" | "node" | "object";
under?: MtVec3;
above?: MtVec3;
ref?: MtObjRef;
}
export type MtEntityStaticData = string;
export interface MtEntityOnActivate {
(this: MtObjRef, staticdata: MtEntityStaticData, dtime_s: number): void;
}
export interface MtEntityOnStep {
(this: MtObjRef, dtime: number): void;
}
export interface MtEntityOnPunch {
(this: MtObjRef, puncher: MtObjRef | undefined, time_from_last_punch: number, tool_capabilities: MtToolCapabilities, dir: MtVec3): void;
}
export interface MtEntityOnRightClick {
(this: MtObjRef, clicker: MtObjRef | undefined): void;
}
export interface MtEntityGetStaticDataCallback {
(this: MtObjRef): MtEntityStaticData;
}
export interface MtEntityDef extends MtObjProperties {
/** @deprecated
* Everything in object properties is read directly from here
*/
initial_properties: Partial<MtObjProperties>;
on_activate: MtEntityOnActivate;
on_step: MtEntityOnStep;
on_punch: MtEntityOnPunch;
on_rightclick: MtEntityOnRightClick;
/**
* Called sometimes; the string returned is passed to on_activate when
* the entity is re-activated from static state
*/
get_staticdata: MtEntityGetStaticDataCallback;
[_custom: string]: any;
/**
* Also you can define arbitrary member variables here (see item definition for
-- more info)
*/
}