Fix import order
This commit is contained in:
parent
dbf5af7202
commit
708d11854e
275 changed files with 559 additions and 834 deletions
|
|
@ -67,6 +67,14 @@ import cloud.commandframework.tasks.TaskConsumer;
|
|||
import cloud.commandframework.types.tuples.Pair;
|
||||
import cloud.commandframework.types.tuples.Triplet;
|
||||
import io.leangen.geantyref.TypeToken;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
|
|
@ -90,15 +98,6 @@ import org.bukkit.util.Vector;
|
|||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static net.kyori.adventure.text.Component.text;
|
||||
|
||||
/**
|
||||
|
|
@ -254,28 +253,28 @@ public final class ExamplePlugin extends JavaPlugin {
|
|||
// Create a teleportation command
|
||||
//
|
||||
this.manager.command(builder.literal("teleport")
|
||||
.literal("me")
|
||||
// Require a player sender
|
||||
.senderType(Player.class)
|
||||
.argument(worldArgument, ArgumentDescription.of("World name"))
|
||||
.argumentTriplet(
|
||||
"coords",
|
||||
TypeToken.get(Vector.class),
|
||||
Triplet.of("x", "y", "z"),
|
||||
Triplet.of(Integer.class, Integer.class, Integer.class),
|
||||
(sender, triplet) -> new Vector(triplet.getFirst(), triplet.getSecond(),
|
||||
triplet.getThird()
|
||||
),
|
||||
ArgumentDescription.of("Coordinates")
|
||||
)
|
||||
.handler(context -> this.manager.taskRecipe().begin(context)
|
||||
.synchronous(commandContext -> {
|
||||
final Player player = (Player) commandContext.getSender();
|
||||
final World world = commandContext.get(worldArgument);
|
||||
final Vector coords = commandContext.get("coords");
|
||||
final Location location = coords.toLocation(world);
|
||||
player.teleport(location);
|
||||
}).execute()))
|
||||
.literal("me")
|
||||
// Require a player sender
|
||||
.senderType(Player.class)
|
||||
.argument(worldArgument, ArgumentDescription.of("World name"))
|
||||
.argumentTriplet(
|
||||
"coords",
|
||||
TypeToken.get(Vector.class),
|
||||
Triplet.of("x", "y", "z"),
|
||||
Triplet.of(Integer.class, Integer.class, Integer.class),
|
||||
(sender, triplet) -> new Vector(triplet.getFirst(), triplet.getSecond(),
|
||||
triplet.getThird()
|
||||
),
|
||||
ArgumentDescription.of("Coordinates")
|
||||
)
|
||||
.handler(context -> this.manager.taskRecipe().begin(context)
|
||||
.synchronous(commandContext -> {
|
||||
final Player player = (Player) commandContext.getSender();
|
||||
final World world = commandContext.get(worldArgument);
|
||||
final Vector coords = commandContext.get("coords");
|
||||
final Location location = coords.toLocation(world);
|
||||
player.teleport(location);
|
||||
}).execute()))
|
||||
.command(builder.literal("teleport")
|
||||
.literal("entity")
|
||||
.senderType(Player.class)
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ import cloud.commandframework.extra.confirmation.CommandConfirmationManager;
|
|||
import cloud.commandframework.meta.CommandMeta;
|
||||
import cloud.commandframework.minecraft.extras.MinecraftExceptionHandler;
|
||||
import cloud.commandframework.minecraft.extras.RichDescription;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
import net.kyori.adventure.platform.bungeecord.BungeeAudiences;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
|
|
@ -43,9 +45,6 @@ import net.md_5.bungee.api.config.ServerInfo;
|
|||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static net.kyori.adventure.text.Component.text;
|
||||
|
||||
public final class ExamplePlugin extends Plugin {
|
||||
|
|
|
|||
|
|
@ -23,14 +23,13 @@
|
|||
//
|
||||
package cloud.commandframework.examples.jda;
|
||||
|
||||
import java.util.Optional;
|
||||
import net.dv8tion.jda.api.entities.MessageChannel;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public abstract class CustomUser {
|
||||
|
||||
private final MessageReceivedEvent event;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import cloud.commandframework.jda.JDA4CommandManager;
|
|||
import cloud.commandframework.jda.JDAGuildSender;
|
||||
import cloud.commandframework.jda.JDAPrivateSender;
|
||||
import cloud.commandframework.jda.parsers.UserArgument;
|
||||
import javax.security.auth.login.LoginException;
|
||||
import net.dv8tion.jda.api.JDA;
|
||||
import net.dv8tion.jda.api.JDABuilder;
|
||||
import net.dv8tion.jda.api.entities.Activity;
|
||||
|
|
@ -41,8 +42,6 @@ import net.dv8tion.jda.api.utils.ChunkingFilter;
|
|||
import net.dv8tion.jda.api.utils.MemberCachePolicy;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import javax.security.auth.login.LoginException;
|
||||
|
||||
public final class ExampleBot {
|
||||
|
||||
private ExampleBot() {
|
||||
|
|
|
|||
|
|
@ -23,13 +23,12 @@
|
|||
//
|
||||
package cloud.commandframework.examples.jda;
|
||||
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public final class PermissionRegistry {
|
||||
|
||||
|
|
|
|||
|
|
@ -40,14 +40,13 @@ import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
|||
import com.velocitypowered.api.plugin.Plugin;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.server.RegisteredServer;
|
||||
import java.util.function.Function;
|
||||
import net.kyori.adventure.identity.Identity;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
import net.kyori.adventure.text.format.TextColor;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
|
||||
import java.util.function.Function;
|
||||
|
||||
@Plugin(
|
||||
id = "example-plugin",
|
||||
name = "Cloud example plugin",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue