Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to team.unnamed #41

Merged
merged 6 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

10 changes: 4 additions & 6 deletions Universal/pom.xml → api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>team.unnamed</groupId>
<artifactId>commandflow</artifactId>
<groupId>me.fixeddev</groupId>
<version>0.6.0</version>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<version>${version.universal}</version>
<artifactId>commandflow-universal</artifactId>
<artifactId>commandflow-api</artifactId>
<packaging>jar</packaging>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

public interface Authorizer {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

import me.fixeddev.commandflow.command.Command;
import me.fixeddev.commandflow.part.CommandPart;
import team.unnamed.commandflow.command.Command;
import team.unnamed.commandflow.part.CommandPart;

import java.util.Collections;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

import me.fixeddev.commandflow.command.Command;
import me.fixeddev.commandflow.command.modifiers.FallbackCommandModifiers;
import me.fixeddev.commandflow.executor.Executor;
import me.fixeddev.commandflow.exception.CommandException;
import me.fixeddev.commandflow.input.InputTokenizer;
import me.fixeddev.commandflow.translator.Translator;
import me.fixeddev.commandflow.usage.UsageBuilder;
import team.unnamed.commandflow.command.Command;
import team.unnamed.commandflow.command.modifiers.FallbackCommandModifiers;
import team.unnamed.commandflow.executor.Executor;
import team.unnamed.commandflow.exception.CommandException;
import team.unnamed.commandflow.input.InputTokenizer;
import team.unnamed.commandflow.translator.Translator;
import team.unnamed.commandflow.usage.UsageBuilder;
import team.unnamed.commandflow.command.Action;

import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -149,7 +150,7 @@ public interface CommandManager {
/**
* Executes a command based on the provided {@link CommandContext}.
* <p>
* If the executed {@link Command}'s {@link me.fixeddev.commandflow.command.Action} returns a false value then this method gets the usage for the executed Command
* If the executed {@link Command}'s {@link Action} returns a false value then this method gets the usage for the executed Command
*
* @param commandContext The {@link CommandContext} used to execute the command.
* @return A boolean indicating if a command was executed or not
Expand All @@ -160,7 +161,7 @@ public interface CommandManager {
/**
* Calls {@link CommandManager#parse(Namespace, List)} and executes the command with the {@link CommandContext} returned by the method.
* <p>
* If the executed {@link Command}'s {@link me.fixeddev.commandflow.command.Action} returns a false value then this method gets the usage for the executed Command
* If the executed {@link Command}'s {@link Action} returns a false value then this method gets the usage for the executed Command
*
* @param accessor The {@link Namespace} used to inject things into the Command parsing/execution phase
* @param arguments A {@link List} of arguments including the command used to parse the actual command used and the parameters of that command
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

import me.fixeddev.commandflow.command.Command;
import me.fixeddev.commandflow.part.CommandPart;
import team.unnamed.commandflow.command.Command;
import team.unnamed.commandflow.part.CommandPart;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

/**
* This interface is used to handle errors that occur during the execution of a command, by the usage of error handlers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

public interface Namespace {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

import java.util.Map;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

import me.fixeddev.commandflow.exception.CommandException;
import team.unnamed.commandflow.exception.CommandException;

import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

import me.fixeddev.commandflow.command.Command;
import me.fixeddev.commandflow.part.CommandPart;
import team.unnamed.commandflow.command.Command;
import team.unnamed.commandflow.part.CommandPart;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package me.fixeddev.commandflow;

import me.fixeddev.commandflow.command.Command;
import me.fixeddev.commandflow.command.modifiers.CommandModifiers;
import me.fixeddev.commandflow.command.modifiers.FallbackCommandModifiers;
import me.fixeddev.commandflow.command.modifiers.ModifierPhase;
import me.fixeddev.commandflow.exception.ArgumentException;
import me.fixeddev.commandflow.exception.ArgumentParseException;
import me.fixeddev.commandflow.exception.CommandException;
import me.fixeddev.commandflow.exception.CommandUsage;
import me.fixeddev.commandflow.exception.NoPermissionsException;
import me.fixeddev.commandflow.exception.StopParseException;
import me.fixeddev.commandflow.executor.DefaultExecutor;
import me.fixeddev.commandflow.executor.Executor;
import me.fixeddev.commandflow.input.InputTokenizer;
import me.fixeddev.commandflow.input.StringSpaceTokenizer;
import me.fixeddev.commandflow.part.CommandPart;
import me.fixeddev.commandflow.stack.ArgumentStack;
import me.fixeddev.commandflow.stack.SimpleArgumentStack;
import me.fixeddev.commandflow.translator.DefaultMapTranslationProvider;
import me.fixeddev.commandflow.translator.DefaultTranslator;
import me.fixeddev.commandflow.translator.Translator;
import me.fixeddev.commandflow.usage.DefaultUsageBuilder;
import me.fixeddev.commandflow.usage.UsageBuilder;
package team.unnamed.commandflow;

import team.unnamed.commandflow.command.Command;
import team.unnamed.commandflow.command.modifiers.CommandModifiers;
import team.unnamed.commandflow.command.modifiers.FallbackCommandModifiers;
import team.unnamed.commandflow.command.modifiers.ModifierPhase;
import team.unnamed.commandflow.exception.ArgumentException;
import team.unnamed.commandflow.exception.ArgumentParseException;
import team.unnamed.commandflow.exception.CommandException;
import team.unnamed.commandflow.exception.CommandUsage;
import team.unnamed.commandflow.exception.NoPermissionsException;
import team.unnamed.commandflow.exception.StopParseException;
import team.unnamed.commandflow.executor.DefaultExecutor;
import team.unnamed.commandflow.executor.Executor;
import team.unnamed.commandflow.input.InputTokenizer;
import team.unnamed.commandflow.input.StringSpaceTokenizer;
import team.unnamed.commandflow.part.CommandPart;
import team.unnamed.commandflow.stack.ArgumentStack;
import team.unnamed.commandflow.stack.SimpleArgumentStack;
import team.unnamed.commandflow.translator.DefaultMapTranslationProvider;
import team.unnamed.commandflow.translator.DefaultTranslator;
import team.unnamed.commandflow.translator.Translator;
import team.unnamed.commandflow.usage.DefaultUsageBuilder;
import team.unnamed.commandflow.usage.UsageBuilder;

import java.util.Collections;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.fixeddev.commandflow;
package team.unnamed.commandflow;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package me.fixeddev.commandflow.annotated;
package team.unnamed.commandflow.annotated;

import me.fixeddev.commandflow.annotated.builder.AnnotatedCommandBuilder;
import me.fixeddev.commandflow.annotated.part.PartInjector;
import me.fixeddev.commandflow.command.Command;
import team.unnamed.commandflow.annotated.builder.AnnotatedCommandBuilder;
import team.unnamed.commandflow.annotated.part.PartInjector;
import team.unnamed.commandflow.command.Command;
import net.kyori.adventure.text.Component;
import team.unnamed.commandflow.annotated.annotation.Handler;
import team.unnamed.commandflow.annotated.annotation.SubCommandClasses;
import team.unnamed.commandflow.part.defaults.SubCommandPart;

import java.util.List;
import java.util.function.Function;
Expand All @@ -19,15 +22,15 @@ public interface AnnotatedCommandTreeBuilder {
* The {@link Command} instances created from annotated methods should be public instance methods(not static ones) that return boolean or void,
* not being inherited from other classes.
* <p>
* The {@link me.fixeddev.commandflow.annotated.annotation.Command} annotation is used to indicate whether a method or a class is a Command,
* The {@link team.unnamed.commandflow.annotated.annotation.Command} annotation is used to indicate whether a method or a class is a Command,
* if a class has this annotation, that means that every command in that class is his subcommand, with the main command being
* a command with empty name.
* <p>
* The {@link me.fixeddev.commandflow.annotated.annotation.Handler} annotation is used to indicate that a method of a class with subcommands is the one that
* handles the sub commands, actualy being a {@link me.fixeddev.commandflow.part.defaults.SubCommandPart.SubCommandHandler} but created with
* The {@link Handler} annotation is used to indicate that a method of a class with subcommands is the one that
* handles the sub commands, actualy being a {@link SubCommandPart.SubCommandHandler} but created with
* an annotated method.
* <p>
* The {@link me.fixeddev.commandflow.annotated.annotation.SubCommandClasses} annotation is used to indicate that the given classes are actually subcommands
* The {@link SubCommandClasses} annotation is used to indicate that the given classes are actually subcommands
* of the given {@link CommandClass}, these sub command classes will be instantiated using a {@link SubCommandInstanceCreator} and
* parsed with this same method, the returned commands will be added as subcommands for the provided {@link CommandClass}.
* This allows multiple levels of subcommands without a lot of hassle.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package me.fixeddev.commandflow.annotated;

import me.fixeddev.commandflow.annotated.annotation.*;
import me.fixeddev.commandflow.annotated.builder.AnnotatedCommandBuilder;
import me.fixeddev.commandflow.annotated.builder.CommandDataNode;
import me.fixeddev.commandflow.annotated.builder.CommandModifiersNode;
import me.fixeddev.commandflow.annotated.builder.CommandPartsNode;
import me.fixeddev.commandflow.annotated.builder.SubCommandsNode;
import me.fixeddev.commandflow.annotated.part.PartInjector;
import me.fixeddev.commandflow.command.Action;
import me.fixeddev.commandflow.command.Command;
import me.fixeddev.commandflow.part.defaults.SubCommandPart;
package team.unnamed.commandflow.annotated;

import team.unnamed.commandflow.annotated.builder.AnnotatedCommandBuilder;
import team.unnamed.commandflow.annotated.builder.CommandDataNode;
import team.unnamed.commandflow.annotated.builder.CommandModifiersNode;
import team.unnamed.commandflow.annotated.builder.CommandPartsNode;
import team.unnamed.commandflow.annotated.builder.SubCommandsNode;
import team.unnamed.commandflow.annotated.part.PartInjector;
import team.unnamed.commandflow.command.Action;
import team.unnamed.commandflow.command.Command;
import team.unnamed.commandflow.part.defaults.SubCommandPart;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.NotNull;
import team.unnamed.commandflow.annotated.annotation.*;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
Expand Down Expand Up @@ -55,16 +55,16 @@ public void setComponentParser(Function<String, Component> componentParser) {
public List<Command> fromClass(CommandClass commandClass) {
Class<?> clazz = commandClass.getClass();

me.fixeddev.commandflow.annotated.annotation.Command rootCommandAnnotation =
clazz.getAnnotation(me.fixeddev.commandflow.annotated.annotation.Command.class);
team.unnamed.commandflow.annotated.annotation.Command rootCommandAnnotation =
clazz.getAnnotation(team.unnamed.commandflow.annotated.annotation.Command.class);

List<Command> commandList = new ArrayList<>();

Method rootCommandMethod = null;

for (Method method : clazz.getDeclaredMethods()) {
me.fixeddev.commandflow.annotated.annotation.Command commandAnnotation =
method.getAnnotation(me.fixeddev.commandflow.annotated.annotation.Command.class);
team.unnamed.commandflow.annotated.annotation.Command commandAnnotation =
method.getAnnotation(team.unnamed.commandflow.annotated.annotation.Command.class);

if (commandAnnotation == null) {
continue;
Expand All @@ -91,7 +91,7 @@ public List<Command> fromClass(CommandClass commandClass) {
}

private Command fromMethod(CommandClass commandClass,
me.fixeddev.commandflow.annotated.annotation.Command commandAnnotation,
team.unnamed.commandflow.annotated.annotation.Command commandAnnotation,
Method method) {
if (Modifier.isStatic(method.getModifiers()) || !Modifier.isPublic(method.getModifiers())) {
return null;
Expand Down Expand Up @@ -128,7 +128,7 @@ private Command fromMethod(CommandClass commandClass,
@NotNull
private List<Command> createRootCommand(CommandClass commandClass,
Class<?> clazz,
me.fixeddev.commandflow.annotated.annotation.Command rootCommandAnnotation,
team.unnamed.commandflow.annotated.annotation.Command rootCommandAnnotation,
List<Command> commandList,
Method rootCommandMethod) {
String[] names = rootCommandAnnotation.names();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.fixeddev.commandflow.annotated;
package team.unnamed.commandflow.annotated;

/**
* A marker interface for Commands based on annotations.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.fixeddev.commandflow.annotated;
package team.unnamed.commandflow.annotated;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.fixeddev.commandflow.annotated;
package team.unnamed.commandflow.annotated;

import me.fixeddev.commandflow.command.Command;
import me.fixeddev.commandflow.exception.ArgumentException;
import me.fixeddev.commandflow.exception.ArgumentParseException;
import me.fixeddev.commandflow.part.defaults.SubCommandPart;
import team.unnamed.commandflow.command.Command;
import team.unnamed.commandflow.exception.ArgumentException;
import team.unnamed.commandflow.exception.ArgumentParseException;
import team.unnamed.commandflow.part.defaults.SubCommandPart;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package me.fixeddev.commandflow.annotated;
package team.unnamed.commandflow.annotated;

/**
* An interface with the purpose of creating a {@link CommandClass} instance that is a sub commands class of another
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package me.fixeddev.commandflow.annotated.action;
package team.unnamed.commandflow.annotated.action;

import me.fixeddev.commandflow.CommandContext;
import me.fixeddev.commandflow.annotated.CommandClass;
import me.fixeddev.commandflow.command.Action;
import me.fixeddev.commandflow.exception.CommandException;
import team.unnamed.commandflow.CommandContext;
import team.unnamed.commandflow.annotated.CommandClass;
import team.unnamed.commandflow.command.Action;
import team.unnamed.commandflow.exception.CommandException;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package me.fixeddev.commandflow.annotated.action;
package team.unnamed.commandflow.annotated.action;

import me.fixeddev.commandflow.CommandContext;
import me.fixeddev.commandflow.part.CommandPart;

import java.util.Collections;
import team.unnamed.commandflow.CommandContext;
import team.unnamed.commandflow.part.CommandPart;

public interface ValueGetter {
Object getValue(CommandContext commandContext);
Expand Down
Loading
Loading