Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal authored Oct 2, 2023
1 parent 4292adc commit 8fee690
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Glad you asked!
- **[Context resolver factories](common/src/main/java/revxrsal/commands/process/ContextResolverFactory.java)** and **[value resolver factories](common/src/main/java/revxrsal/commands/process/ValueResolverFactory.java)**
- **[Simple and powerful auto completions API](common/src/main/java/revxrsal/commands/autocomplete/AutoCompleter.java)**
- **[Built-in command cooldown handler](common/src/main/java/revxrsal/commands/annotation/Cooldown.java)**
- **First-class Kotlin support**: Lamp provides top-tier support for Kotlin features, such as:
- Default parameters (with `@Optional`)
- Suspend functions
- Auxiliary Kotlin extensions

## Getting Started

Expand Down Expand Up @@ -98,8 +102,6 @@ dependencies {

compileJava { // Preserve parameter names in the bytecode
options.compilerArgs += ["-parameters"]
options.fork = true
options.forkOptions.executable = "javac"
}

compileKotlin { // optional: if you're using Kotlin
Expand All @@ -122,14 +124,14 @@ dependencies {
implementation("com.github.Revxrsal.Lamp:[module]:[verison]")
}

compileJava { // Preserve parameter names in the bytecode
options.compilerArgs += ["-parameters"]
options.fork = true
options.forkOptions.executable = "javac"
tasks.withType<JavaCompile> { // Preserve parameter names in the bytecode
options.compilerArgs.add("-parameters")
}

compileKotlin { // optional: if you're using Kotlin
kotlinOptions.javaParameters = true
tasks.withType<KotlinJvmCompile> { // optional: if you're using Kotlin
compilerOptions {
javaParameters = true
}
}
```
</details>
Expand All @@ -148,6 +150,20 @@ compileKotlin { // optional: if you're using Kotlin
- `cli` for building console applications

## Examples
Creating a command handler
```java
public final class BansPlugin extends JavaPlugin {

@Override
public void onEnable() {
// Create a command handler here
BukkitCommandHandler handler = BukkitCommandHandler.create(this);
handler.register(new BansCommand());
// (Optional) Register colorful tooltips (Works on 1.13+ only)
handler.registerBrigadier();
}
}
```

**`/epicbans ban <player> <days> <reason>`**

Expand Down

0 comments on commit 8fee690

Please sign in to comment.