File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 11import { FormCancelationReason } from '@minecraft/server-ui' ;
22import * 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
49const mgr = new bricklib . command . CommandManager ( ) ;
510bricklib . command . enableCustomChatCmds ( mgr , '\\' ) ;
611
712
813
914mgr . 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
2531mgr . 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
3946mgr . 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 ;
You can’t perform that action at this time.
0 commit comments