Skip to content

Commit 3c78af7

Browse files
committed
test gatepass
1 parent b1c4525 commit 3c78af7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import { FormCancelationReason } from '@minecraft/server-ui';
22
import * as bricklib from './bricklib/index.js';
3+
import * as gatepass from './gatepass/index.js';
4+
5+
/* load plugins */
6+
bricklib.plugin.loadPlugin('gatepass');
7+
38

49
const mgr = new bricklib.command.CommandManager();
510
bricklib.command.enableCustomChatCmds(mgr, '\\');
611

712

813

914
mgr.registerCommand([ 'hello', 'hi' ], (src, args) => {
15+
gatepass.assertPermission('basic.hello', src);
1016
src.sendMessage(src.name + '\n' + args.join('\n') + '\nEND OF ARGS');
1117
return 0;
1218
});
@@ -23,6 +29,7 @@ const def = {
2329
};
2430

2531
mgr.registerCommand(...bricklib.args.makeCommand(def, (args, src) => {
32+
gatepass.assertPermission('chat.echo', src);
2633
src.sendMessage(args.text.join(' '));
2734
return 0;
2835
}));
@@ -37,6 +44,7 @@ nextTick(() => {
3744

3845

3946
mgr.registerCommand([ 'form' ], (src) => {
47+
gatepass.assertPermission('dev.bricklib.form-cmd', src);
4048
src.sendMessage('please close chats');
4149
nextTick(() => showForm('action-frm', src));
4250
return 0;

0 commit comments

Comments
 (0)