2
2
3
3
import me .zeroeightsix .kami .command .Command ;
4
4
import me .zeroeightsix .kami .command .syntax .ChunkBuilder ;
5
+ import me .zeroeightsix .kami .command .syntax .parsers .DependantParser ;
5
6
import me .zeroeightsix .kami .command .syntax .parsers .ModuleParser ;
6
7
import me .zeroeightsix .kami .module .Module ;
7
8
import me .zeroeightsix .kami .module .ModuleManager ;
9
+ import me .zeroeightsix .kami .setting .Setting ;
10
+ import me .zeroeightsix .kami .setting .Settings ;
11
+ import me .zeroeightsix .kami .setting .builder .SettingBuilder ;
8
12
import me .zeroeightsix .kami .util .Wrapper ;
9
13
10
14
/**
11
15
* Created by 086 on 12/11/2017.
12
16
*/
13
17
public class BindCommand extends Command {
14
18
19
+ public static Setting <Boolean > modifiersEnabled = SettingBuilder .register (Settings .b ("modifiersEnabled" ), "binds" );
20
+
15
21
public BindCommand () {
16
22
super ("bind" , new ChunkBuilder ()
17
- .append ("module" , true , new ModuleParser ())
18
- .append ("key" , true )
23
+ .append ("[ module]|modifiers " , true , new ModuleParser ())
24
+ .append ("[ key]|[on|off] " , true )
19
25
.build ()
20
26
);
21
27
}
@@ -27,8 +33,26 @@ public void call(String[] args) {
27
33
return ;
28
34
}
29
35
30
- String rkey = args [1 ];
31
36
String module = args [0 ];
37
+ String rkey = args [1 ];
38
+
39
+ if (module .equalsIgnoreCase ("modifiers" )) {
40
+ if (rkey == null ) {
41
+ sendChatMessage ("Expected: on or off" );
42
+ return ;
43
+ }
44
+
45
+ if (rkey .equalsIgnoreCase ("on" )) {
46
+ modifiersEnabled .setValue (true );
47
+ sendChatMessage ("Turned modifiers on." );
48
+ } else if (rkey .equalsIgnoreCase ("off" )) {
49
+ modifiersEnabled .setValue (false );
50
+ sendChatMessage ("Turned modifiers off." );
51
+ } else {
52
+ sendChatMessage ("Expected: on or off" );
53
+ }
54
+ return ;
55
+ }
32
56
33
57
Module m = ModuleManager .getModuleByName (module );
34
58
0 commit comments