mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2025-03-11 22:29:32 +01:00
Implement a default command exception handler to show stacktrace
This commit is contained in:
parent
120b51e9e6
commit
dc9a386af1
@ -57,6 +57,7 @@ public class MVCommandManager extends PaperCommandManager {
|
||||
|
||||
MVCommandConditions.load(this, worldManager, worldNameChecker);
|
||||
this.enableUnstableAPI("help");
|
||||
this.setDefaultExceptionHandler(new MVDefaultExceptionHandler());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,19 @@
|
||||
package org.mvplugins.multiverse.core.commandtools;
|
||||
|
||||
import co.aikar.commands.BaseCommand;
|
||||
import co.aikar.commands.CommandIssuer;
|
||||
import co.aikar.commands.ExceptionHandler;
|
||||
import co.aikar.commands.RegisteredCommand;
|
||||
import com.dumptruckman.minecraft.util.Logging;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MVDefaultExceptionHandler implements ExceptionHandler {
|
||||
@Override
|
||||
public boolean execute(BaseCommand command, RegisteredCommand registeredCommand, CommandIssuer sender, List<String> args, Throwable t) {
|
||||
Logging.severe("Failed to execute command /%s %s %s",
|
||||
registeredCommand.getCommand(), registeredCommand.getPrefSubCommand(), String.join(" ", args));
|
||||
t.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user