Raxen/src/main/java/gq/unurled/raxen/commands/admin/ReloadCommand.java
unurled 0b861e39bd 0.4.7
update to 1.18.2, and bug fixes
2022-03-20 00:35:06 +01:00

36 lines
1.2 KiB
Java

package gq.unurled.raxen.commands.admin;
import gq.unurled.raxen.utils.Reload;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import static gq.unurled.raxen.utils.Utils.*;
public class ReloadCommand implements TabExecutor {
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String msg, @NotNull String[] args) {
if(sender instanceof Player) {
Player player = (Player) sender;
if(!player.hasPermission("raxen.reload.cmd")) {
player.sendMessage(noPerms());
return true;
}
}
Reload.kickAll();
log(colorString("<red>Server stopping!\n Using: /rlpl.\n Please wait a little bit."));
Bukkit.getServer().shutdown();
return false;
}
@Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
return null;
}
}