File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
eternalcore-core/src/main/java/com/eternalcode/core/feature/fireball Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .eternalcode .core .feature .fireball ;
2
+
3
+ import com .eternalcode .annotations .scan .command .DescriptionDocs ;
4
+ import dev .rollczi .litecommands .annotations .argument .Arg ;
5
+ import dev .rollczi .litecommands .annotations .command .Command ;
6
+ import dev .rollczi .litecommands .annotations .context .Sender ;
7
+ import dev .rollczi .litecommands .annotations .execute .Execute ;
8
+ import dev .rollczi .litecommands .annotations .permission .Permission ;
9
+ import org .bukkit .entity .Fireball ;
10
+ import org .bukkit .entity .Player ;
11
+
12
+ import java .util .Optional ;
13
+
14
+ @ Command (name = "fireball" )
15
+ @ Permission ("eternalcore.fireball" )
16
+ public class FireballCommand {
17
+
18
+ private static final double DEFAULT_SPEED = 2.0D ;
19
+
20
+ @ Execute
21
+ @ DescriptionDocs (description = "Launch a fireball in the direction you are looking" , arguments = "[speed]" )
22
+ void execute (@ Sender Player sender , @ Arg Optional <Double > speed ) {
23
+ double fireballSpeed = speed .orElse (DEFAULT_SPEED );
24
+ sender .launchProjectile (Fireball .class , sender .getLocation ().getDirection ().multiply (fireballSpeed ));
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments