Add parent for admin team's commands.

This is a parity change with player command.
This commit is contained in:
BONNe 2022-07-13 12:35:20 +03:00
parent aed8caeb76
commit 5a527d4119
3 changed files with 50 additions and 5 deletions

View File

@ -9,11 +9,7 @@ import world.bentobox.bentobox.api.commands.admin.deaths.AdminDeathsCommand;
import world.bentobox.bentobox.api.commands.admin.purge.AdminPurgeCommand;
import world.bentobox.bentobox.api.commands.admin.range.AdminRangeCommand;
import world.bentobox.bentobox.api.commands.admin.resets.AdminResetsCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamAddCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamDisbandCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamFixCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamKickCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamSetownerCommand;
import world.bentobox.bentobox.api.commands.admin.team.*;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.user.User;
@ -56,6 +52,7 @@ public abstract class DefaultAdminCommand extends CompositeCommand {
new AdminSetrankCommand(this);
new AdminInfoCommand(this);
// Team commands
new AdminTeamCommand(this);
new AdminTeamAddCommand(this);
new AdminTeamKickCommand(this);
new AdminTeamDisbandCommand(this);

View File

@ -0,0 +1,47 @@
//
// Created by BONNe
// Copyright - 2022
//
package world.bentobox.bentobox.api.commands.admin.team;
import java.util.List;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.user.User;
/**
* Parent command for all Admin Team commands.
*/
public class AdminTeamCommand extends CompositeCommand
{
public AdminTeamCommand(CompositeCommand parent)
{
super(parent, "team");
}
@Override
public void setup()
{
this.setPermission("mod.team");
this.setDescription("commands.admin.team.description");
new AdminTeamAddCommand(this);
new AdminTeamDisbandCommand(this);
new AdminTeamFixCommand(this);
new AdminTeamKickCommand(this);
new AdminTeamSetownerCommand(this);
}
@Override
public boolean execute(User user, String label, List<String> args)
{
this.showHelp(this, user);
return true;
}
}

View File

@ -102,6 +102,7 @@ commands:
status: "&b [purged] &a islands purged out of &b [purgeable] &7(&b[percentage] %&7)&a."
team:
description: "manage teams"
add:
parameters: "<owner> <player>"
description: "add player to owner's team"