mirror of
https://github.com/Crazy-Crew/CrazyAuctions.git
synced 2024-11-10 10:10:22 +01:00
register new commands
This commit is contained in:
parent
bfdd853edd
commit
e193f5558d
@ -6,12 +6,18 @@ import com.badbones69.crazyauctions.api.enums.Messages;
|
||||
import com.badbones69.crazyauctions.api.support.MetricsWrapper;
|
||||
import com.badbones69.crazyauctions.commands.AuctionCommand;
|
||||
import com.badbones69.crazyauctions.commands.AuctionTab;
|
||||
import com.badbones69.crazyauctions.commands.v2.BaseCommand;
|
||||
import com.badbones69.crazyauctions.commands.v2.player.CommandHelp;
|
||||
import com.badbones69.crazyauctions.commands.v2.staff.CommandReload;
|
||||
import com.badbones69.crazyauctions.configs.ConfigManager;
|
||||
import com.badbones69.crazyauctions.controllers.GuiListener;
|
||||
import com.badbones69.crazyauctions.controllers.MarcoListener;
|
||||
import com.badbones69.crazyauctions.currency.VaultSupport;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import com.ryderbelserion.vital.paper.Vital;
|
||||
import com.ryderbelserion.vital.paper.util.scheduler.FoliaRunnable;
|
||||
import io.papermc.paper.command.brigadier.CommandSourceStack;
|
||||
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.PluginCommand;
|
||||
@ -22,6 +28,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import java.io.File;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
public class CrazyAuctions extends Vital {
|
||||
|
||||
@ -117,7 +124,19 @@ public class CrazyAuctions extends Vital {
|
||||
getServer().getPluginManager().registerEvents(new GuiListener(), this);
|
||||
getServer().getPluginManager().registerEvents(new MarcoListener(), this);
|
||||
|
||||
registerCommand(getCommand("crazyauctions"), new AuctionTab(), new AuctionCommand());
|
||||
registerCommand(getCommand("ca"), new AuctionTab(), new AuctionCommand());
|
||||
|
||||
// Register commands.
|
||||
getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> {
|
||||
LiteralArgumentBuilder<CommandSourceStack> root = new BaseCommand().registerPermission().literal().createBuilder();
|
||||
|
||||
List.of(
|
||||
new CommandReload(),
|
||||
new CommandHelp()
|
||||
).forEach(command -> root.then(command.registerPermission().literal()));
|
||||
|
||||
event.registrar().register(root.build(), "the base command for CrazyAuctions");
|
||||
});
|
||||
|
||||
this.support = new VaultSupport();
|
||||
this.support.loadVault();
|
||||
|
Loading…
Reference in New Issue
Block a user