fix all
This commit is contained in:
parent
5088e3ad1c
commit
d1d2b93742
82 changed files with 4008 additions and 3032 deletions
|
|
@ -0,0 +1,35 @@
|
|||
package com.loki.lochat.commands.base;
|
||||
|
||||
import com.loki.lochat.LoChat;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Базовый класс для административных команд
|
||||
*/
|
||||
public abstract class AdminCommand extends BaseCommand {
|
||||
|
||||
private final String requiredPermission;
|
||||
|
||||
public AdminCommand(LoChat plugin, String requiredPermission) {
|
||||
super(plugin);
|
||||
this.requiredPermission = requiredPermission;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final boolean executeCommand(@NotNull CommandSender sender, @NotNull Command command,
|
||||
@NotNull String label, @NotNull String[] args) {
|
||||
if (!requirePermission(sender, requiredPermission)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return executeAdminCommand(sender, command, label, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Выполнить административную команду
|
||||
*/
|
||||
protected abstract boolean executeAdminCommand(@NotNull CommandSender sender, @NotNull Command command,
|
||||
@NotNull String label, @NotNull String[] args);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue