File tree Expand file tree Collapse file tree 4 files changed +41
-2
lines changed
bukkit/src/main/java/dev/rollczi/example/bukkit
fabric/src/main/java/dev/rollczi/example/fabric/server Expand file tree Collapse file tree 4 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 16
16
import dev .rollczi .example .bukkit .command .currency .CurrencyBalanceCommand ;
17
17
import dev .rollczi .example .bukkit .command .currency .CurrencyCommand ;
18
18
import dev .rollczi .example .bukkit .command .currency .CurrencyService ;
19
+ import dev .rollczi .example .bukkit .command .currency .DoubleSlashCommand ;
19
20
import dev .rollczi .example .bukkit .handler .ExampleInvalidUsageHandler ;
20
21
import dev .rollczi .example .bukkit .handler .ExampleMissingPermissionsHandler ;
21
22
import dev .rollczi .example .bukkit .user .User ;
@@ -72,7 +73,8 @@ public void onEnable() {
72
73
new CurrencyCommand (currencyService ),
73
74
new CurrencyBalanceCommand (currencyService ),
74
75
new CatCommand (),
75
- new UserCommand ()
76
+ new UserCommand (),
77
+ new DoubleSlashCommand ()
76
78
)
77
79
78
80
// Custom annotation validators
Original file line number Diff line number Diff line change
1
+ package dev .rollczi .example .bukkit .command .currency ;
2
+
3
+ import dev .rollczi .litecommands .annotations .command .Command ;
4
+ import dev .rollczi .litecommands .annotations .context .Sender ;
5
+ import dev .rollczi .litecommands .annotations .execute .Execute ;
6
+ import org .bukkit .command .CommandSender ;
7
+
8
+ @ Command (name = "/slash" )
9
+ public class DoubleSlashCommand {
10
+
11
+ @ Execute
12
+ void executeSlash (@ Sender CommandSender sender ) {
13
+ sender .sendMessage ("Double slash command! Hi " + sender .getName () + "!" );
14
+ }
15
+
16
+ }
Original file line number Diff line number Diff line change 1
1
package dev .rollczi .example .fabric .server ;
2
2
3
+ import dev .rollczi .example .fabric .server .command .DoubleSlashCommand ;
3
4
import dev .rollczi .example .fabric .server .command .ExampleCommand ;
4
5
import dev .rollczi .litecommands .fabric .LiteFabricFactory ;
5
6
import dev .rollczi .litecommands .luckperms .LuckPermsPermissionResolver ;
@@ -10,7 +11,10 @@ public class ServerExampleFabric implements DedicatedServerModInitializer {
10
11
public void onInitializeServer () {
11
12
LiteFabricFactory .server ()
12
13
.permissionResolver (LuckPermsPermissionResolver .lazy ())
13
- .commands (new ExampleCommand ())
14
+ .commands (
15
+ new ExampleCommand (),
16
+ new DoubleSlashCommand ()
17
+ )
14
18
.build ();
15
19
}
16
20
}
Original file line number Diff line number Diff line change
1
+ package dev .rollczi .example .fabric .server .command ;
2
+
3
+ import dev .rollczi .litecommands .annotations .command .Command ;
4
+ import dev .rollczi .litecommands .annotations .context .Sender ;
5
+ import dev .rollczi .litecommands .annotations .execute .Execute ;
6
+ import net .minecraft .server .command .ServerCommandSource ;
7
+ import net .minecraft .text .Text ;
8
+
9
+ @ Command (name = "/slash" )
10
+ public class DoubleSlashCommand {
11
+
12
+ @ Execute
13
+ void executeSlash (@ Sender ServerCommandSource sender ) {
14
+ sender .sendMessage (Text .of ("Double slash command! Hi " + sender .getName () + "!" ));
15
+ }
16
+
17
+ }
You can’t perform that action at this time.
0 commit comments