mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2026-02-06 12:17:13 +01:00
fix /papi command showing error, add /placeholderapi alias
This commit is contained in:
@@ -71,7 +71,7 @@ public final class PlaceholderCommandRouter extends AbstractCommand {
|
|||||||
|
|
||||||
public PlaceholderCommandRouter(@NotNull final PlaceholderAPIPlugin plugin) {
|
public PlaceholderCommandRouter(@NotNull final PlaceholderAPIPlugin plugin) {
|
||||||
super("papi", "papi");
|
super("papi", "papi");
|
||||||
// addAliases("placeholderapi");
|
addAliases("placeholderapi");
|
||||||
setAllowsExtraArguments(true);
|
setAllowsExtraArguments(true);
|
||||||
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
@@ -132,10 +132,10 @@ public final class PlaceholderCommandRouter extends AbstractCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected @Nullable CompletableFuture<Void> execute(@NotNull final CommandContext context) {
|
protected @Nullable CompletableFuture<Void> execute(@NotNull final CommandContext context) {
|
||||||
final String[] args = context.getInputString().replace("papi ", "").split(" ");
|
final String[] args = context.getInputString().replace("papi", "").replace("placeholderapi", "").trim().split(" ");
|
||||||
final CommandSender sender = context.sender();
|
final CommandSender sender = context.sender();
|
||||||
|
|
||||||
if (args.length == 0) {
|
if (args.length == 0 || args[0].isBlank()) {
|
||||||
final PlaceholderCommand fallback = commands.get("version");
|
final PlaceholderCommand fallback = commands.get("version");
|
||||||
if (fallback != null) {
|
if (fallback != null) {
|
||||||
fallback.evaluate(plugin, sender, "", Collections.emptyList());
|
fallback.evaluate(plugin, sender, "", Collections.emptyList());
|
||||||
|
|||||||
Reference in New Issue
Block a user