Skip to content

Commit

Permalink
added dynamic help menu
Browse files Browse the repository at this point in the history
  • Loading branch information
thevalleyy committed Apr 25, 2024
1 parent 5f289c3 commit c9b36f9
Show file tree
Hide file tree
Showing 4 changed files with 229 additions and 96 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package tk.thevalleyy.customcommands;

import com.moandjiezana.toml.Toml;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -36,7 +37,6 @@ public Toml loadConfig(Path path) {
CustomCommands.logger.error(e.getMessage());
return null;
}

}

// load config variables
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/tk/thevalleyy/customcommands/CustomCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
version = BuildConstants.VERSION,
description = "A plugin that allows you to create custom commands.",
url = "https://github.com/thevalleyy/CustomCommands",
authors = {"thevalleyy"}
)
authors = {"thevalleyy"})

public class CustomCommands {
private boolean isConfigLoaded = false;
private final ProxyServer proxy;
Expand All @@ -38,7 +38,8 @@ public class CustomCommands {

// Construction
@Inject
public CustomCommands(ProxyServer proxy, Logger logger, @DataDirectory final Path folder) throws IOException {
public CustomCommands(ProxyServer proxy, Logger logger, @DataDirectory final Path folder)
throws IOException {

this.proxy = proxy;
this.logger = logger;
Expand All @@ -58,7 +59,6 @@ public CustomCommands(ProxyServer proxy, Logger logger, @DataDirectory final Pat
// logger.info("CustomCommands has been enabled. (" + BuildConstants.VERSION + ")");
}


// Initialization
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
Expand All @@ -68,7 +68,8 @@ public void onProxyInitialization(ProxyInitializeEvent event) {

CommandManager commandManager = proxy.getCommandManager();

CommandMeta commandMeta = commandManager.metaBuilder("customcommands").aliases("cc").plugin(this).build();
CommandMeta commandMeta =
commandManager.metaBuilder("customcommands").aliases("cc").plugin(this).build();
BrigadierCommand setMainCommand = MainCommand.createBrigadierCommand(proxy);

commandManager.register(commandMeta, setMainCommand);
Expand Down
Loading

0 comments on commit c9b36f9

Please sign in to comment.