mirror of
https://github.com/plexusorg/Module-TFMExtras.git
synced 2026-06-05 15:56:54 +00:00
Brigadier
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -13,10 +11,16 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "admininfo", description = "Information on how to apply for admin", aliases = "ai,si,staffinfo")
|
||||
@CommandPermissions(permission = "plex.tfmextras.admininfo")
|
||||
public class AdminInfoCommand extends PlexCommand
|
||||
public class AdminInfoCommand extends SimplePlexCommand
|
||||
{
|
||||
public AdminInfoCommand()
|
||||
{
|
||||
super(command("admininfo")
|
||||
.description("Information on how to apply for admin")
|
||||
.aliases("ai,si,staffinfo")
|
||||
.permission("plex.tfmextras.admininfo")
|
||||
.build());
|
||||
}
|
||||
private static final List<Component> ADMIN_INFO = TFMExtras.getModule().getConfig().getStringList("server.admininfo")
|
||||
.stream().map(info -> MiniMessage.miniMessage().deserialize(info)).toList();
|
||||
|
||||
@@ -32,7 +36,7 @@ public class AdminInfoCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@ package dev.plex.extras.command;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.api.player.PlexPlayerView;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.command.exception.PlayerNotFoundException;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.List;
|
||||
@@ -14,10 +12,17 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "autoclear", description = "Toggle whether or not a player has their inventory automatically cleared when they join", usage = "/<command> <player>", aliases = "aclear,ac")
|
||||
@CommandPermissions(permission = "plex.tfmextras.autoclear")
|
||||
public class AutoClearCommand extends PlexCommand
|
||||
public class AutoClearCommand extends SimplePlexCommand
|
||||
{
|
||||
public AutoClearCommand()
|
||||
{
|
||||
super(command("autoclear")
|
||||
.description("Toggle whether or not a player has their inventory automatically cleared when they join")
|
||||
.usage("/<command> <player>")
|
||||
.aliases("aclear,ac")
|
||||
.permission("plex.tfmextras.autoclear")
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -44,7 +49,7 @@ public class AutoClearCommand extends PlexCommand
|
||||
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return args.length == 1 && silentCheckPermission(sender, this.getPermission()) ? onlinePlayerNames() : ImmutableList.of();
|
||||
}
|
||||
|
||||
@@ -2,9 +2,7 @@ package dev.plex.extras.command;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.api.player.PlexPlayerView;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.command.exception.PlayerNotFoundException;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.List;
|
||||
@@ -15,10 +13,17 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "autoteleport", description = "If a player is specified, it will toggle whether or not the player is automatically teleported when they join. If no player is specified, you will be randomly teleported", usage = "/<command> [player]", aliases = "autotp,rtp,randomtp,tpr")
|
||||
@CommandPermissions(permission = "plex.tfmextras.autotp")
|
||||
public class AutoTeleportCommand extends PlexCommand
|
||||
public class AutoTeleportCommand extends SimplePlexCommand
|
||||
{
|
||||
public AutoTeleportCommand()
|
||||
{
|
||||
super(command("autoteleport")
|
||||
.description("If a player is specified, it will toggle whether or not the player is automatically teleported when they join. If no player is specified, you will be randomly teleported")
|
||||
.usage("/<command> [player]")
|
||||
.aliases("autotp,rtp,randomtp,tpr")
|
||||
.permission("plex.tfmextras.autotp")
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -50,7 +55,7 @@ public class AutoTeleportCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return args.length == 1 && silentCheckPermission(sender, this.getPermission()) ? onlinePlayerNames() : ImmutableList.of();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -17,10 +15,15 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "cake", description = "For the people that are still alive - gives a cake to everyone on the server")
|
||||
@CommandPermissions(permission = "plex.tfmextras.cake")
|
||||
public class CakeCommand extends PlexCommand
|
||||
public class CakeCommand extends SimplePlexCommand
|
||||
{
|
||||
public CakeCommand()
|
||||
{
|
||||
super(command("cake")
|
||||
.description("For the people that are still alive - gives a cake to everyone on the server")
|
||||
.permission("plex.tfmextras.cake")
|
||||
.build());
|
||||
}
|
||||
private static final ItemStack CAKE = cake();
|
||||
|
||||
@Override
|
||||
@@ -41,7 +44,7 @@ public class CakeCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender commandSender, @NotNull String s, @NotNull String[] strings) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender commandSender, @NotNull String s, @NotNull String[] strings) throws IllegalArgumentException
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
@@ -17,10 +15,17 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "cartsit", usage = "/<command> <player>", description = "Sit in nearest minecart. If target is in a minecart already, they will be ejected", aliases = "minecartsit")
|
||||
@CommandPermissions(permission = "plex.tfmextras.cartsit")
|
||||
public class CartSitCommand extends PlexCommand
|
||||
public class CartSitCommand extends SimplePlexCommand
|
||||
{
|
||||
public CartSitCommand()
|
||||
{
|
||||
super(command("cartsit")
|
||||
.description("Sit in nearest minecart. If target is in a minecart already, they will be ejected")
|
||||
.usage("/<command> <player>")
|
||||
.aliases("minecartsit")
|
||||
.permission("plex.tfmextras.cartsit")
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -68,7 +73,7 @@ public class CartSitCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return args.length == 1 && silentCheckPermission(sender, this.getPermission()) ? onlinePlayerNames() : ImmutableList.of();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -13,10 +11,16 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "clearchat", description = "Clears the chat", aliases = "cc,cleanchat,chatclear")
|
||||
@CommandPermissions(permission = "plex.tfmextras.clearchat")
|
||||
public class ClearChatCommand extends PlexCommand
|
||||
public class ClearChatCommand extends SimplePlexCommand
|
||||
{
|
||||
public ClearChatCommand()
|
||||
{
|
||||
super(command("clearchat")
|
||||
.description("Clears the chat")
|
||||
.aliases("cc,cleanchat,chatclear")
|
||||
.permission("plex.tfmextras.clearchat")
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -36,7 +40,7 @@ public class ClearChatCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -18,10 +16,16 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "cloudclear", description = "Clears lingering potion area effect clouds", aliases = "clearcloud,aeclear")
|
||||
@CommandPermissions(permission = "plex.tfmextras.cloudclear")
|
||||
public class CloudClearCommand extends PlexCommand
|
||||
public class CloudClearCommand extends SimplePlexCommand
|
||||
{
|
||||
public CloudClearCommand()
|
||||
{
|
||||
super(command("cloudclear")
|
||||
.description("Clears lingering potion area effect clouds")
|
||||
.aliases("clearcloud,aeclear")
|
||||
.permission("plex.tfmextras.cloudclear")
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -36,7 +40,7 @@ public class CloudClearCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.api.player.PlexPlayerView;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.command.exception.PlayerNotFoundException;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import net.kyori.adventure.text.Component;
|
||||
@@ -20,10 +18,16 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "clownfish", description = "Gives a player a clownfish capable of knocking people back", usage = "/<command> [<toggle>]")
|
||||
@CommandPermissions(permission = "plex.tfmextras.clownfish")
|
||||
public class ClownfishCommand extends PlexCommand
|
||||
public class ClownfishCommand extends SimplePlexCommand
|
||||
{
|
||||
public ClownfishCommand()
|
||||
{
|
||||
super(command("clownfish")
|
||||
.description("Gives a player a clownfish capable of knocking people back")
|
||||
.usage("/<command> [<toggle>]")
|
||||
.permission("plex.tfmextras.clownfish")
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender commandSender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -92,7 +96,7 @@ public class ClownfishCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException {
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException {
|
||||
if (silentCheckPermission(sender, "plex.tfmextras.clownfish.restrict"))
|
||||
{
|
||||
if (args.length == 1)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.Collections;
|
||||
@@ -14,10 +12,16 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "eject", description = "Removes all passengers from a player")
|
||||
@CommandPermissions(permission = "plex.tfmextras.eject", source = RequiredCommandSource.IN_GAME)
|
||||
public class EjectCommand extends PlexCommand
|
||||
public class EjectCommand extends SimplePlexCommand
|
||||
{
|
||||
public EjectCommand()
|
||||
{
|
||||
super(command("eject")
|
||||
.description("Removes all passengers from a player")
|
||||
.permission("plex.tfmextras.eject")
|
||||
.source(RequiredCommandSource.IN_GAME)
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -27,7 +31,7 @@ public class EjectCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
|
||||
import io.papermc.paper.registry.RegistryAccess;
|
||||
@@ -22,10 +20,18 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "enchant", description = "Enchants an item", usage = "/<command> <add | reset | list | addall | remove>", aliases = "enchantment")
|
||||
@CommandPermissions(permission = "plex.tfmextras.enchant", source = RequiredCommandSource.IN_GAME)
|
||||
public class EnchantCommand extends PlexCommand
|
||||
public class EnchantCommand extends SimplePlexCommand
|
||||
{
|
||||
public EnchantCommand()
|
||||
{
|
||||
super(command("enchant")
|
||||
.description("Enchants an item")
|
||||
.usage("/<command> <add | reset | list | addall | remove>")
|
||||
.aliases("enchantment")
|
||||
.permission("plex.tfmextras.enchant")
|
||||
.source(RequiredCommandSource.IN_GAME)
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -120,7 +126,7 @@ public class EnchantCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
if (silentCheckPermission(sender, this.getPermission()))
|
||||
{
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.List;
|
||||
import net.kyori.adventure.text.Component;
|
||||
@@ -17,10 +15,16 @@ import org.jetbrains.annotations.Nullable;
|
||||
* Credit to "TheDeus-Group" for the messages :)
|
||||
*/
|
||||
|
||||
@CommandParameters(name = "emf", description = "Speak english.", usage = "/<command> <player>")
|
||||
@CommandPermissions(permission = "plex.tfmextras.emf")
|
||||
public class EnglishMfCommand extends PlexCommand
|
||||
public class EnglishMfCommand extends SimplePlexCommand
|
||||
{
|
||||
public EnglishMfCommand()
|
||||
{
|
||||
super(command("emf")
|
||||
.description("Speak english.")
|
||||
.usage("/<command> <player>")
|
||||
.permission("plex.tfmextras.emf")
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -40,7 +44,7 @@ public class EnglishMfCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return args.length == 1 && silentCheckPermission(sender, this.getPermission()) ? onlinePlayerNames() : ImmutableList.of();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import org.bukkit.Location;
|
||||
@@ -16,10 +14,17 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@CommandParameters(name = "expel", description = "Pushes away nearby players", usage = "/expel <radius> <strength>", aliases = "push")
|
||||
@CommandPermissions(permission = "plex.tfmextras.expel")
|
||||
public class ExpelCommand extends PlexCommand
|
||||
public class ExpelCommand extends SimplePlexCommand
|
||||
{
|
||||
public ExpelCommand()
|
||||
{
|
||||
super(command("expel")
|
||||
.description("Pushes away nearby players")
|
||||
.usage("/expel <radius> <strength>")
|
||||
.aliases("push")
|
||||
.permission("plex.tfmextras.expel")
|
||||
.build());
|
||||
}
|
||||
@Override
|
||||
protected Component execute(@NotNull CommandSender sender, @Nullable Player player, @NotNull String[] args)
|
||||
{
|
||||
@@ -85,7 +90,7 @@ public class ExpelCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args)
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args)
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import dev.plex.extras.jumppads.JumpPads;
|
||||
import dev.plex.extras.jumppads.Mode;
|
||||
@@ -19,10 +16,17 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "jumppads", usage = "/jumppads <mode> [player]", description = "Enables jump pads for yourself or another player. Mode types available: none, regular, enhanced, extreme", aliases = "jp,pads,launchpads")
|
||||
@CommandPermissions(permission = "plex.tfmextras.jumppads", source = RequiredCommandSource.ANY)
|
||||
public class JumpPadsCommand extends PlexCommand
|
||||
public class JumpPadsCommand extends SimplePlexCommand
|
||||
{
|
||||
public JumpPadsCommand()
|
||||
{
|
||||
super(command("jumppads")
|
||||
.description("Enables jump pads for yourself or another player. Mode types available: none, regular, enhanced, extreme")
|
||||
.usage("/jumppads <mode> [player]")
|
||||
.aliases("jp,pads,launchpads")
|
||||
.permission("plex.tfmextras.jumppads")
|
||||
.build());
|
||||
}
|
||||
JumpPads jumpPads = TFMExtras.getModule().jumpPads;
|
||||
|
||||
@Override
|
||||
@@ -119,7 +123,7 @@ public class JumpPadsCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
if (silentCheckPermission(sender, this.getPermission()))
|
||||
{
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -19,10 +17,16 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@CommandParameters(name = "orbit", description = "Accelerates the player at a super fast rate", usage = "/<command> <target> [<<power> | stop>]")
|
||||
@CommandPermissions(permission = "plex.tfmextras.orbit")
|
||||
public class OrbitCommand extends PlexCommand
|
||||
public class OrbitCommand extends SimplePlexCommand
|
||||
{
|
||||
public OrbitCommand()
|
||||
{
|
||||
super(command("orbit")
|
||||
.description("Accelerates the player at a super fast rate")
|
||||
.usage("/<command> <target> [<<power> | stop>]")
|
||||
.permission("plex.tfmextras.orbit")
|
||||
.build());
|
||||
}
|
||||
private static final Map<UUID, Integer> isOrbited = new ConcurrentHashMap<>();
|
||||
|
||||
@Override
|
||||
@@ -66,7 +70,7 @@ public class OrbitCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
if (args.length == 1 && silentCheckPermission(sender, this.getPermission()))
|
||||
{
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package dev.plex.extras.command;
|
||||
|
||||
import dev.plex.command.PlexCommand;
|
||||
import dev.plex.command.annotation.CommandParameters;
|
||||
import dev.plex.command.annotation.CommandPermissions;
|
||||
import dev.plex.command.SimplePlexCommand;
|
||||
import dev.plex.command.source.RequiredCommandSource;
|
||||
import dev.plex.extras.TFMExtras;
|
||||
import java.util.Arrays;
|
||||
@@ -19,10 +17,17 @@ import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@CommandParameters(name = "randomfish", description = "Spawns a random type of fish at your location", aliases = "rfish,bird")
|
||||
@CommandPermissions(permission = "plex.tfmextras.randomfish", source = RequiredCommandSource.IN_GAME)
|
||||
public class RandomFishCommand extends PlexCommand
|
||||
public class RandomFishCommand extends SimplePlexCommand
|
||||
{
|
||||
public RandomFishCommand()
|
||||
{
|
||||
super(command("randomfish")
|
||||
.description("Spawns a random type of fish at your location")
|
||||
.aliases("rfish,bird")
|
||||
.permission("plex.tfmextras.randomfish")
|
||||
.source(RequiredCommandSource.IN_GAME)
|
||||
.build());
|
||||
}
|
||||
private static final List<EntityType> FISH_TYPES = Arrays.asList(EntityType.COD, EntityType.SALMON, EntityType.PUFFERFISH, EntityType.TROPICAL_FISH);
|
||||
|
||||
@Override
|
||||
@@ -44,7 +49,7 @@ public class RandomFishCommand extends PlexCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
protected @NotNull List<String> suggestions(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user