EpicKnarvik97 487cb3ad9e Adds missing info about Bungee-related permissions to the readme and adjusts permissions a bit
Adds stargate.server and stargate.admin.bungee permissions to the readme
Renames stargate.reload to stargate.admin.reload for better consistency
Makes the stargate.admin permission only give the reload, hidden, private and bungee permissions while the wildcard permission gives all permissions
2021-10-29 01:45:50 +02:00

29 lines
938 B
Java

package net.knarcraft.stargate.command;
import net.knarcraft.stargate.Stargate;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
/**
* This command represents the plugin's reload command
*/
public class CommandReload implements CommandExecutor {
@Override
public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s,
@NotNull String[] args) {
if (commandSender instanceof Player player) {
if (!player.hasPermission("stargate.admin.reload")) {
Stargate.getMessageSender().sendErrorMessage(commandSender, "Permission Denied");
return true;
}
}
Stargate.getStargateConfig().reload(commandSender);
return true;
}
}