diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandExecutor.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandExecutor.java deleted file mode 100644 index e6248b4..0000000 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandExecutor.java +++ /dev/null @@ -1,11 +0,0 @@ -package de.kentoj.scrow.bukkit.services.command; - -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandContext; - -public interface CommandExecutor { - - /** - * @return true on success, 1 on failure - */ - void execute(CommandContext ctx); -} diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandFactory.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandFactory.java similarity index 50% rename from core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandFactory.java rename to core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandFactory.java index 90c1ef2..e584c14 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandFactory.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandFactory.java @@ -1,7 +1,9 @@ -package de.kentoj.scrow.bukkit.services.command.cmds2; +package de.kentoj.scrow.bukkit.services.command; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.Literal; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.literal.Literal; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import de.kentoj.scrow.bukkit.services.command.type.ArgumentType; import java.util.function.Function; diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandManager.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandManager.java index bcbbf9c..ca3db96 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandManager.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/CommandManager.java @@ -1,6 +1,6 @@ package de.kentoj.scrow.bukkit.services.command; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import org.bukkit.plugin.Plugin; public interface CommandManager { diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/Commands.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/Commands.java similarity index 78% rename from core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/Commands.java rename to core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/Commands.java index 2ce05b5..f190a5c 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/Commands.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/Commands.java @@ -1,7 +1,9 @@ -package de.kentoj.scrow.bukkit.services.command.cmds2; +package de.kentoj.scrow.bukkit.services.command; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.Literal; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.literal.Literal; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import de.kentoj.scrow.bukkit.services.command.type.ArgumentType; import lombok.AccessLevel; import lombok.NoArgsConstructor; diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/SuggestionProvider.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/SuggestionProvider.java new file mode 100644 index 0000000..6df8520 --- /dev/null +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/SuggestionProvider.java @@ -0,0 +1,10 @@ +package de.kentoj.scrow.bukkit.services.command; + +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; + +import java.util.Set; + +public interface SuggestionProvider { + + Set suggest(CommandContext context); +} diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/SuggestionProvider.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/SuggestionProvider.java deleted file mode 100644 index 09c6120..0000000 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/SuggestionProvider.java +++ /dev/null @@ -1,8 +0,0 @@ -package de.kentoj.scrow.bukkit.services.command.cmds2; - -import java.util.Set; - -public interface SuggestionProvider { - - Set suggest(CommandContext context); -} diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/ArgumentData.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/ArgumentData.java similarity index 56% rename from core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/ArgumentData.java rename to core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/ArgumentData.java index e0d6ab4..5469835 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/ArgumentData.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/ArgumentData.java @@ -1,5 +1,6 @@ -package de.kentoj.scrow.bukkit.services.command.cmds2; +package de.kentoj.scrow.bukkit.services.command.execution; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; import org.jetbrains.annotations.Nullable; public interface ArgumentData { @@ -11,5 +12,5 @@ public interface ArgumentData { /** * @return null if the default value for the type was used */ - @Nullable String getRawValue(); + @Nullable String getRawInput(); } diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandContext.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/CommandContext.java similarity index 88% rename from core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandContext.java rename to core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/CommandContext.java index e2439c2..d08b962 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandContext.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/CommandContext.java @@ -1,6 +1,7 @@ -package de.kentoj.scrow.bukkit.services.command.cmds2; +package de.kentoj.scrow.bukkit.services.command.execution; import de.kentoj.scrow.bukkit.services.command.exception.CommandInvocationException; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/CommandExecutor.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/CommandExecutor.java new file mode 100644 index 0000000..6156f1e --- /dev/null +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/execution/CommandExecutor.java @@ -0,0 +1,6 @@ +package de.kentoj.scrow.bukkit.services.command.execution; + +public interface CommandExecutor { + + void execute(CommandContext ctx); +} diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/ArgumentReader.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/ArgumentReader.java similarity index 74% rename from core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/ArgumentReader.java rename to core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/ArgumentReader.java index fc4d803..d927492 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/ArgumentReader.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/ArgumentReader.java @@ -1,4 +1,4 @@ -package de.kentoj.scrow.bukkit.services.command; +package de.kentoj.scrow.bukkit.services.command.literal; public interface ArgumentReader { diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandArgument.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/CommandArgument.java similarity index 71% rename from core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandArgument.java rename to core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/CommandArgument.java index b0d31ec..adad226 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/CommandArgument.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/CommandArgument.java @@ -1,5 +1,7 @@ -package de.kentoj.scrow.bukkit.services.command.cmds2; +package de.kentoj.scrow.bukkit.services.command.literal; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; +import de.kentoj.scrow.bukkit.services.command.SuggestionProvider; import de.kentoj.scrow.bukkit.services.command.type.ArgumentType; import org.jetbrains.annotations.Nullable; diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/literal/Literal.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/Literal.java similarity index 81% rename from core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/literal/Literal.java rename to core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/Literal.java index bc0ab3d..adbd51a 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/literal/Literal.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/Literal.java @@ -1,7 +1,6 @@ -package de.kentoj.scrow.bukkit.services.command.cmds2.literal; +package de.kentoj.scrow.bukkit.services.command.literal; -import de.kentoj.scrow.bukkit.services.command.CommandExecutor; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.execution.CommandExecutor; import org.bukkit.permissions.Permission; import org.jetbrains.annotations.Nullable; diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/literal/RootLiteral.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/RootLiteral.java similarity index 74% rename from core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/literal/RootLiteral.java rename to core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/RootLiteral.java index 5c77afd..61beca9 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/cmds2/literal/RootLiteral.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/literal/RootLiteral.java @@ -1,4 +1,4 @@ -package de.kentoj.scrow.bukkit.services.command.cmds2.literal; +package de.kentoj.scrow.bukkit.services.command.literal; import java.util.Set; diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/ArgumentType.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/ArgumentType.java index 188f0eb..f5bd226 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/ArgumentType.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/ArgumentType.java @@ -1,7 +1,7 @@ package de.kentoj.scrow.bukkit.services.command.type; -import de.kentoj.scrow.bukkit.services.command.ArgumentReader; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandContext; +import de.kentoj.scrow.bukkit.services.command.literal.ArgumentReader; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; import de.kentoj.scrow.bukkit.services.command.exception.CommandInvocationException; import java.util.Set; @@ -15,7 +15,7 @@ public interface ArgumentType { /** * @throws CommandInvocationException if the given value may not be used */ - void checkValue(CommandContext ctx, T value) throws CommandInvocationException; + void checkValue(CommandContext ctx, T value, String rawInput) throws CommandInvocationException; Set getDefaultSuggestions(CommandContext ctx); } diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/NumberArgumentType.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/NumberArgumentType.java index 596710b..bebc540 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/NumberArgumentType.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/NumberArgumentType.java @@ -1,8 +1,8 @@ package de.kentoj.scrow.bukkit.services.command.type; import com.google.common.base.Preconditions; -import de.kentoj.scrow.bukkit.services.command.ArgumentReader; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandContext; +import de.kentoj.scrow.bukkit.services.command.literal.ArgumentReader; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; import de.kentoj.scrow.bukkit.services.command.exception.CommandInvocationException; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -33,7 +33,7 @@ public class NumberArgumentType { } @Override - public void checkValue(CommandContext ctx, Integer value) throws CommandInvocationException { + public void checkValue(CommandContext ctx, Integer value, String rawInput) throws CommandInvocationException { if (value < min) throw new CommandInvocationException("Value too small -- " + value); if (value > max) throw new CommandInvocationException("Value too large -- " + value); } diff --git a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/PlayerArgumentType.java b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/PlayerArgumentType.java index 44db33d..f2ac631 100644 --- a/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/PlayerArgumentType.java +++ b/core-bukkit-api/src/main/java/de/kentoj/scrow/bukkit/services/command/type/PlayerArgumentType.java @@ -1,7 +1,7 @@ package de.kentoj.scrow.bukkit.services.command.type; -import de.kentoj.scrow.bukkit.services.command.ArgumentReader; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandContext; +import de.kentoj.scrow.bukkit.services.command.literal.ArgumentReader; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; import de.kentoj.scrow.bukkit.services.command.exception.CommandInvocationException; import lombok.AccessLevel; import lombok.NoArgsConstructor; @@ -36,8 +36,8 @@ public class PlayerArgumentType { } @Override - public void checkValue(CommandContext ctx, Player value) throws CommandInvocationException { - if (value == null) throw new CommandInvocationException("Player is not online"); + public void checkValue(CommandContext ctx, Player value, String rawInput) throws CommandInvocationException { + if (value == null) throw new CommandInvocationException("Player is not online -- " + rawInput); } @Override @@ -74,7 +74,7 @@ public class PlayerArgumentType { } @Override - public void checkValue(CommandContext ctx, OfflinePlayer value) throws CommandInvocationException { + public void checkValue(CommandContext ctx, OfflinePlayer value, String rawInput) throws CommandInvocationException { } }; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/ScrowAPISurface.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/ScrowAPISurface.java index be65dac..f794f71 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/ScrowAPISurface.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/ScrowAPISurface.java @@ -8,7 +8,7 @@ import de.kentoj.scrow.bukkit.cmds2.CommandFactoryImpl; import de.kentoj.scrow.bukkit.cmds2.bukkit.BukkitCommandManager; import de.kentoj.scrow.bukkit.economy.InMemoryEconomyService; import de.kentoj.scrow.bukkit.economy.MongoEconomyService; -import de.kentoj.scrow.bukkit.services.command.cmds2.Commands; +import de.kentoj.scrow.bukkit.services.command.Commands; import lombok.AccessLevel; import lombok.NoArgsConstructor; import org.bson.UuidRepresentation; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandArgumentImpl.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandArgumentImpl.java index 62194a7..91dab4e 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandArgumentImpl.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandArgumentImpl.java @@ -1,8 +1,8 @@ package de.kentoj.scrow.bukkit.cmds2; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandArgument; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandContext; -import de.kentoj.scrow.bukkit.services.command.cmds2.SuggestionProvider; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; +import de.kentoj.scrow.bukkit.services.command.SuggestionProvider; import de.kentoj.scrow.bukkit.services.command.type.ArgumentType; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandContextImpl.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandContextImpl.java index b43b699..f4377db 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandContextImpl.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandContextImpl.java @@ -1,8 +1,8 @@ package de.kentoj.scrow.bukkit.cmds2; import com.google.common.base.Preconditions; -import de.kentoj.scrow.bukkit.services.command.cmds2.ArgumentData; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandContext; +import de.kentoj.scrow.bukkit.services.command.execution.ArgumentData; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; import de.kentoj.scrow.bukkit.services.command.exception.CommandInvocationException; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandFactoryImpl.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandFactoryImpl.java index d4cce4f..c14d6a2 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandFactoryImpl.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/CommandFactoryImpl.java @@ -1,10 +1,10 @@ package de.kentoj.scrow.bukkit.cmds2; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandArgument; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandContext; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandFactory; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.Literal; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; +import de.kentoj.scrow.bukkit.services.command.CommandFactory; +import de.kentoj.scrow.bukkit.services.command.literal.Literal; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import de.kentoj.scrow.bukkit.services.command.type.ArgumentType; import java.util.function.Function; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/LiteralImpl.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/LiteralImpl.java index 66d2844..d8fa877 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/LiteralImpl.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/LiteralImpl.java @@ -1,8 +1,8 @@ package de.kentoj.scrow.bukkit.cmds2; -import de.kentoj.scrow.bukkit.services.command.CommandExecutor; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandArgument; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.Literal; +import de.kentoj.scrow.bukkit.services.command.execution.CommandExecutor; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.literal.Literal; import lombok.Getter; import lombok.Setter; import org.bukkit.Bukkit; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/RootLiteralImpl.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/RootLiteralImpl.java index 4c48860..b4b0b71 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/RootLiteralImpl.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/RootLiteralImpl.java @@ -1,6 +1,6 @@ package de.kentoj.scrow.bukkit.cmds2; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import lombok.Getter; import lombok.Setter; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitCommand.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitCommand.java index fd348c9..54bc851 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitCommand.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitCommand.java @@ -2,7 +2,7 @@ package de.kentoj.scrow.bukkit.cmds2.bukkit; import de.kentoj.scrow.bukkit.cmds2.parsing.ArgumentReaderImpl; import de.kentoj.scrow.bukkit.cmds2.parsing.CommandProcessor; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import de.kentoj.scrow.bukkit.services.command.exception.CommandInvocationException; import org.bukkit.ChatColor; import org.bukkit.command.Command; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitCommandManager.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitCommandManager.java index 03176fa..b330320 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitCommandManager.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitCommandManager.java @@ -1,7 +1,7 @@ package de.kentoj.scrow.bukkit.cmds2.bukkit; import de.kentoj.scrow.bukkit.services.command.CommandManager; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import org.bukkit.Bukkit; import org.bukkit.command.CommandMap; import org.bukkit.plugin.Plugin; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitTabCompleter.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitTabCompleter.java index f4bff8e..06b5cda 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitTabCompleter.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/bukkit/BukkitTabCompleter.java @@ -1,6 +1,6 @@ package de.kentoj.scrow.bukkit.cmds2.bukkit; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import lombok.RequiredArgsConstructor; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/ArgumentDataImpl.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/ArgumentDataImpl.java index 6e72150..7609256 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/ArgumentDataImpl.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/ArgumentDataImpl.java @@ -1,7 +1,7 @@ package de.kentoj.scrow.bukkit.cmds2.parsing; -import de.kentoj.scrow.bukkit.services.command.cmds2.ArgumentData; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.execution.ArgumentData; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; import lombok.Value; import org.jetbrains.annotations.Nullable; @@ -9,5 +9,5 @@ import org.jetbrains.annotations.Nullable; public class ArgumentDataImpl implements ArgumentData { T value; CommandArgument argument; - @Nullable String rawValue; + @Nullable String rawInput; } diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/ArgumentReaderImpl.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/ArgumentReaderImpl.java index 18d6a9a..b5d041f 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/ArgumentReaderImpl.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/ArgumentReaderImpl.java @@ -1,6 +1,6 @@ package de.kentoj.scrow.bukkit.cmds2.parsing; -import de.kentoj.scrow.bukkit.services.command.ArgumentReader; +import de.kentoj.scrow.bukkit.services.command.literal.ArgumentReader; import de.kentoj.scrow.bukkit.services.command.exception.CommandInvocationException; import java.nio.CharBuffer; diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/CommandProcessor.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/CommandProcessor.java index c81a156..36fda5a 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/CommandProcessor.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/cmds2/parsing/CommandProcessor.java @@ -1,11 +1,11 @@ package de.kentoj.scrow.bukkit.cmds2.parsing; import de.kentoj.scrow.bukkit.cmds2.CommandContextImpl; -import de.kentoj.scrow.bukkit.services.command.ArgumentReader; -import de.kentoj.scrow.bukkit.services.command.cmds2.ArgumentData; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandArgument; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.Literal; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.literal.ArgumentReader; +import de.kentoj.scrow.bukkit.services.command.execution.ArgumentData; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.literal.Literal; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import de.kentoj.scrow.bukkit.services.command.exception.CommandInvocationException; import lombok.RequiredArgsConstructor; import org.bukkit.command.CommandSender; @@ -60,9 +60,9 @@ public class CommandProcessor { return new ArgumentDataImpl<>(defaultValue, argument, null); } - final var rawValue = argument.getType().readRawInput(argumentReader); - T value = argument.getType().parseInput(rawValue); - argument.getType().checkValue(new CommandContextImpl(sender, arguments), value); - return new ArgumentDataImpl<>(value, argument, rawValue); + final var rawInput = argument.getType().readRawInput(argumentReader); + T value = argument.getType().parseInput(rawInput); + argument.getType().checkValue(new CommandContextImpl(sender, arguments), value, rawInput); + return new ArgumentDataImpl<>(value, argument, rawInput); } } diff --git a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/economy/command/CoinsCommand.java b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/economy/command/CoinsCommand.java index 2504ada..116472f 100644 --- a/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/economy/command/CoinsCommand.java +++ b/core-bukkit-impl/src/main/java/de/kentoj/scrow/bukkit/economy/command/CoinsCommand.java @@ -1,10 +1,10 @@ package de.kentoj.scrow.bukkit.economy.command; import de.kentoj.scrow.bukkit.ScrowAPI; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandArgument; -import de.kentoj.scrow.bukkit.services.command.cmds2.CommandContext; -import de.kentoj.scrow.bukkit.services.command.cmds2.Commands; -import de.kentoj.scrow.bukkit.services.command.cmds2.literal.RootLiteral; +import de.kentoj.scrow.bukkit.services.command.literal.CommandArgument; +import de.kentoj.scrow.bukkit.services.command.execution.CommandContext; +import de.kentoj.scrow.bukkit.services.command.Commands; +import de.kentoj.scrow.bukkit.services.command.literal.RootLiteral; import de.kentoj.scrow.bukkit.services.command.type.NumberArgumentType; import de.kentoj.scrow.bukkit.services.command.type.PlayerArgumentType; import org.bukkit.Bukkit;