Reformat project

This commit is contained in:
broccolai 2020-12-07 12:01:30 +00:00 committed by Alexander Söderberg
parent 01d36aecd8
commit 237eda75ef
30 changed files with 130 additions and 87 deletions

View file

@ -80,8 +80,8 @@ public final class LocationArgument<C> extends CommandArgument<C, Location> {
/**
* Create a new argument builder
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Builder instance
*/
public static <C> @NonNull Builder<C> newBuilder(
@ -93,8 +93,8 @@ public final class LocationArgument<C> extends CommandArgument<C, Location> {
/**
* Create a new required argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Constructed argument
*/
public static <C> @NonNull CommandArgument<C, Location> of(
@ -108,8 +108,8 @@ public final class LocationArgument<C> extends CommandArgument<C, Location> {
/**
* Create a new optional argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Constructed argument
*/
public static <C> @NonNull CommandArgument<C, Location> optional(

View file

@ -32,6 +32,7 @@ import java.util.LinkedList;
/**
* Bungee specific {@link Caption caption keys}
*
* @since 1.1.0
*/
public final class BungeeCaptionKeys {

View file

@ -73,8 +73,8 @@ public final class PlayerArgument<C> extends CommandArgument<C, ProxiedPlayer> {
/**
* Create a new argument builder
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Constructed builder
**/
public static <C> CommandArgument.@NonNull Builder<C, ProxiedPlayer> newBuilder(
@ -90,8 +90,8 @@ public final class PlayerArgument<C> extends CommandArgument<C, ProxiedPlayer> {
/**
* Create a new required player argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Created argument
*/
public static <C> CommandArgument<C, ProxiedPlayer> of(
@ -103,8 +103,8 @@ public final class PlayerArgument<C> extends CommandArgument<C, ProxiedPlayer> {
/**
* Create a new optional player argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Created argument
*/
public static <C> CommandArgument<C, ProxiedPlayer> optional(

View file

@ -73,8 +73,8 @@ public final class ServerArgument<C> extends CommandArgument<C, ServerInfo> {
/**
* Create a new argument builder
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Constructed builder
*/
public static <C> CommandArgument.@NonNull Builder<C, ServerInfo> newBuilder(
@ -90,8 +90,8 @@ public final class ServerArgument<C> extends CommandArgument<C, ServerInfo> {
/**
* Create a new required server argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Created argument
*/
public static <C> @NonNull CommandArgument<C, ServerInfo> of(
@ -103,8 +103,8 @@ public final class ServerArgument<C> extends CommandArgument<C, ServerInfo> {
/**
* Create a new optional server argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Created argument
*/
public static <C> @NonNull CommandArgument<C, ServerInfo> optional(

View file

@ -117,10 +117,12 @@ public class CloudburstCommandManager<C> extends CommandManager<C> {
}
static final class CloudListener implements Listener {
static final CloudListener INSTANCE = new CloudListener();
private CloudListener() {
}
}
}

View file

@ -55,7 +55,7 @@ class PaperBrigadierListener<C> implements Listener {
)
);
this.brigadierManager.brigadierSenderMapper(
sender -> this.paperCommandManager.getCommandSenderMapper().apply(sender.getBukkitSender())
sender -> this.paperCommandManager.getCommandSenderMapper().apply(sender.getBukkitSender())
);
new BukkitBrigadierMapper<>(this.paperCommandManager, this.brigadierManager);
}

View file

@ -71,18 +71,23 @@ public final class CloudInjectionModule<C> extends AbstractModule {
@SuppressWarnings({"unchecked", "rawtypes"})
protected void configure() {
final Type commandTreeType = Types.newParameterizedType(CommandTree.class, this.commandSenderType);
final Type commandExecutionCoordinatorType = Types.newParameterizedType(CommandExecutionCoordinator.class,
this.commandSenderType);
final Type commandExecutionCoordinatorType = Types.newParameterizedType(
CommandExecutionCoordinator.class,
this.commandSenderType
);
final Type executorFunction = Types.newParameterizedType(Function.class, commandTreeType,
commandExecutionCoordinatorType);
commandExecutionCoordinatorType
);
final Key executorFunctionKey = Key.get(executorFunction);
this.bind(executorFunctionKey).toInstance(this.commandExecutionCoordinator);
final Type commandSenderMapperFunction = Types.newParameterizedType(Function.class, CommandSource.class,
this.commandSenderType);
this.commandSenderType
);
final Key commandSenderMapperFunctionKey = Key.get(commandSenderMapperFunction);
this.bind(commandSenderMapperFunctionKey).toInstance(this.commandSenderMapper);
final Type backwardsCommandSenderMapperFunction = Types.newParameterizedType(Function.class, this.commandSenderType,
CommandSource.class);
CommandSource.class
);
final Key backwardsCommandSenderMapperFunctionKey = Key.get(backwardsCommandSenderMapperFunction);
this.bind(backwardsCommandSenderMapperFunctionKey).toInstance(this.backwardsCommandSenderMapper);
}

View file

@ -32,6 +32,7 @@ import java.util.LinkedList;
/**
* Velocity specific {@link Caption caption keys}
*
* @since 1.1.0
*/
public final class VelocityCaptionKeys {

View file

@ -72,6 +72,7 @@ public class VelocityCommandManager<C> extends CommandManager<C> implements Brig
private final ProxyServer proxyServer;
private final Function<CommandSource, C> commandSenderMapper;
private final Function<C, CommandSource> backwardsCommandSenderMapper;
/**
* Create a new command manager instance.
*

View file

@ -95,7 +95,8 @@ final class VelocityExecutor<C> implements Command<CommandSource> {
e.getCorrectSyntax(),
NamedTextColor.GRAY
)
).build())
).build()
)
);
} else if (throwable instanceof InvalidCommandSenderException) {
this.manager.handleException(

View file

@ -73,8 +73,8 @@ public final class PlayerArgument<C> extends CommandArgument<C, Player> {
/**
* Create a new argument builder
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Constructed builder
*/
public static <C> CommandArgument.@NonNull Builder<C, Player> newBuilder(
@ -90,8 +90,8 @@ public final class PlayerArgument<C> extends CommandArgument<C, Player> {
/**
* Create a new required player argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Created argument
*/
public static <C> @NonNull CommandArgument<C, Player> of(
@ -103,8 +103,8 @@ public final class PlayerArgument<C> extends CommandArgument<C, Player> {
/**
* Create a new optional player argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Created argument
*/
public static <C> @NonNull CommandArgument<C, Player> optional(

View file

@ -73,8 +73,8 @@ public final class ServerArgument<C> extends CommandArgument<C, RegisteredServer
/**
* Create a new argument builder
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Constructed builder
*/
public static <C> CommandArgument.@NonNull Builder<C, RegisteredServer> newBuilder(
@ -90,8 +90,8 @@ public final class ServerArgument<C> extends CommandArgument<C, RegisteredServer
/**
* Create a new required player argument
*
* @param name Argument name
* @param <C> Command sender type
* @param name Argument name
* @param <C> Command sender type
* @return Created argument
*/
public static <C> @NonNull CommandArgument<C, RegisteredServer> of(