Skip to content

Commit

Permalink
Fixed plugin command not showing plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
3arthqu4ke committed Aug 13, 2024
1 parent d4d12ae commit 4902169
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package me.earth.headlessmc.api.command;

import me.earth.headlessmc.api.HeadlessMc;

public class CopyContext extends CommandContextImpl {
public CopyContext(HeadlessMc ctx, boolean baseContext) {
super(ctx);
CommandContext before = baseContext ? ctx.getCommandLine().getBaseContext() : ctx.getCommandLine().getCommandContext();
for (Command command : before) {
add(command);
}
}

// TODO: actually we should always expose this
@Override
public void add(Command command) {
super.add(command);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public void execute(String line, String... args) throws CommandException {
ctx.log(new Table<HeadlessMcPlugin>()
.withColumn("name", HasName::getName)
.withColumn("description", HasDescription::getDescription)
.addAll(ctx.getPluginManager().getPlugins())
.build());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package me.earth.headlessmc.launcher.plugin;

import lombok.Getter;
import me.earth.headlessmc.launcher.Launcher;

import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;

@Getter
public class PluginManager {
private final List<HeadlessMcPlugin> plugins = new ArrayList<>();

Expand Down

0 comments on commit 4902169

Please sign in to comment.