Skip to content

Commit

Permalink
feat(command): version command addVersionNode method
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Mar 29, 2022
1 parent ecef59d commit 13fe78a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Expand Up @@ -26,6 +26,10 @@ public class VersionCommand {

public static final Function<Class<?>, CommandNode<CommandSourceStack>> NODE_BUILDER = (modClass) -> literal("version").executes(HANDLER_BUILDER.apply(modClass)).build();

public static void addVersionNode(CommandNode<CommandSourceStack> node, Class<?> modClass) {
node.addChild(NODE_BUILDER.apply(modClass));
}

public static int getModVersion(CommandContext<CommandSourceStack> ctx, String mainVersion, String fullVersion, String modName) {
MutableComponent message = TextUtils.EmptyText();

Expand Down
Expand Up @@ -14,7 +14,7 @@ public final class AHServerCommands {
public static final CommandNode<CommandSourceStack> NODE = literal(ArnicaLib.MOD_ID).build();

public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
NODE.addChild(VersionCommand.NODE_BUILDER.apply(ArnicaLib.class));
VersionCommand.addVersionNode(NODE, ArnicaLib.class);
NODE.addChild(literal("test").executes((ctx) -> {
return Command.SINGLE_SUCCESS;
}).build());
Expand Down

0 comments on commit 13fe78a

Please sign in to comment.