Lamp
Lamp copied to clipboard
Nested subcommands and exception handling do not work on Bukkit/Velocity (others not tested)
I used Kotlin/Java to write it, but it didn’t work (is there something wrong with my operation or project configuration?)
The code here is for Bukkit, and the same is true for Velocity. Java:
@Override
public void onEnable() {
Lamp<BukkitCommandActor> lamp = BukkitLamp
.builder(this)
.exceptionHandler(new BukkitExceptionHandler())
.build();
lamp.register(new MyCommand());
}
@Override
public void onDisable() {
}
@Command("hello")
public class MyCommand {
@Subcommand("test1")
public void test1() {
}
@Subcommand("test2")
public static class Test2 {
@Subcommand("test3")
public void test3() {
}
}
}
Kotlin:
override fun onEnable() {
val lamp = BukkitLamp
.builder(this)
.exceptionHandler(BukkitExceptionHandler())
.build()
lamp.register(MyCommand())
}
override fun onDisable() {
}
@Command("hello")
class MyCommand {
@Subcommand("test1")
fun test1() {
}
@Subcommand("test2")
class Test2 {
@Subcommand("test3")
fun test3() {
}
}
}
In the end, I only got test1, but not test2 and test3.
(I checked the docs)
In addition, the exception handling of unknown instructions does not work properly, including some types of exception handling (only tested onInvalidBoolean and onInvalidInteger), but onEmptyEntitySelector onSenderNotConsole, etc. can work normally.
Version:
val lampVersion = "4.0.0-rc.12"
dependencies {
// ...
implementation("io.github.revxrsal:lamp.common:$lampVersion")
implementation("io.github.revxrsal:lamp.bukkit:$lampVersion")
implementation("io.github.revxrsal:lamp.brigadier:$lampVersion")
}