Setting up

This page describes how you can add Lamp to your own projects, using Gradle or Maven.

Adding Lamp dependency

To add Lamp to your project, add the following (depending on your project structure):

<dependencies>
  <!-- Required for all platforms -->
  <dependency>
      <groupId>io.github.revxrsal</groupId>
      <artifactId>lamp.common</artifactId> 
      <version>[VERSION]</version>
  </dependency>

  <!-- Add your specific platform module here -->
  <dependency>
      <groupId>io.github.revxrsal</groupId>
      <artifactId>lamp.[PLATFORM]</artifactId>
      <version>[VERSION]</version>
  </dependency>  
</dependencies>

Latest version:

Where [PLATFORM] is any of the following:

  • bukkit: Contains integrations for the Bukkit platform

  • bungee: Contains integrations for the BungeeCord API

  • brigadier: Contains integrations for Mojang's Brigadier API

  • sponge: Contains integrations for the Sponge platform (version 8+)

  • paper: Contains extra features for the PaperMC API

  • velocity: Contains integrations for the VelocityPowered API

  • minestom: Contains integrations for the Minestom platform

  • fabric: Contains integrations for the Fabric modding API

  • jda: Contains integrations for the Java Discord API

  • cli: A minimal implementation of the Lamp APIs for command-line applications

Optional: Preserve parameter names

Lamp identifies parameters by their names and uses them to generate relevant command metadata. By default, Java does not preserve parameter names reflectively. You need to add the following to your project:

<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.0</version>
    <configuration>
      <compilerArgs>
        <!-- Preserves parameter names -->
        <arg>-parameters</arg>
      </compilerArgs>
    </configuration>
  </plugin>
</plugins>

For Kotlin

Here’s how you can set the Kotlin compiler option javaParameters = true in three different build systems, using the tab format you specified:

<build>
    <plugins>
        <plugin>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-plugin</artifactId>
            <!-- ... your configuration here ... -->
            <configuration>
                <args>
                    <arg>-java-parameters</arg>
                </args>
            </configuration>
        </plugin>
    </plugins>
</build>

Last updated

Was this helpful?