forked from JaylyDev/ScriptAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtests.ts
More file actions
29 lines (27 loc) · 817 Bytes
/
tests.ts
File metadata and controls
29 lines (27 loc) · 817 Bytes
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
import { FullbrightToggle } from "./index";
import { IPlayerUISession, registerEditorExtension } from "@minecraft/server-editor";
export function createMenu(uiSession: IPlayerUISession) {
if (!uiSession.scratchStorage) {
throw new Error('Core UI initialization order incorrect');
}
const edit = uiSession.createMenu({
name: 'FullBright',
displayStringId: 'FullBright',
});
edit.show();
return edit;
};
registerEditorExtension('nightVision', (uiSession) => {
uiSession.scratchStorage = {};
// Initialize tool rail.
uiSession.toolRail.show();
// Add selection functionality
new FullbrightToggle(uiSession, createMenu(uiSession));
return [
{
teardown() {
this.uiSession.log.debug("Shutting down FullbrightToggle behavior\n");
}
}
];
}, () => {});