1. Dependencies
To use LiteCommands you need to add Panda Repository to your repositories and LiteCommands to your dependencies in your project.
Depending on the build system you are using, add the following code to your project:
maven { url = uri("https://repo.panda-lang.org/releases") }
maven { url "https://repo.panda-lang.org/releases" }
<repository>
<id>reposilite-repository-releases</id>
<name>Reposilite Repository</name>
<url>https://repo.panda-lang.org/releases</url>
</repository>
implementation("dev.rollczi:{platform}:3.9.1")
implementation "dev.rollczi:{platform}:3.9.1"
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{platform}</artifactId>
<version>3.9.1</version>
</dependency>
INFO
LiteCommands requires Java 8 or higer.
READ THIS!
Replace {platform}
with the platform you want to use (See platforms).
Parameters compile flag optional
To use all features of LiteCommands, you need to add -parameters
flag to your compiler:
tasks.compileJava {
options.compilerArgs.add("-parameters")
}
tasks.withType(JavaCompile) {
options.compilerArgs.add("-parameters")
}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
Why -parameters
flag?
Parameters are used to automatically get the name of the parameter in the methods. Without this flag, you would have to define the name of the parameter in the @Arg
annotation.
So instead of @Arg("player") Player player
, you can write just @Arg Player player
.