36 lines
1001 B
Java
36 lines
1001 B
Java
package cn.citycraft.LuckLottery.utils;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import net.md_5.bungee.api.ChatColor;
|
|
|
|
public class PermissionUtils {
|
|
public static final String ShowAll = "lucklottery.showall";
|
|
public static final String Reward = "lucklottery.reward";
|
|
public static final String Random = "lucklottery.random";
|
|
public static final String Look = "lucklottery.look";
|
|
public static final String Clear = "lucklottery.clear";
|
|
public static final String Reload = "lucklottery.reload";
|
|
|
|
public static String No_Permission = ChatColor.RED + "你没有此命令的权限!";
|
|
|
|
public static boolean Check(Player p, String perm) {
|
|
if (p.hasPermission(perm)) {
|
|
return true;
|
|
} else {
|
|
ChatUtils.noPermission(p);
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static boolean Check(CommandSender p, String perm) {
|
|
if (p.hasPermission(perm)) {
|
|
return true;
|
|
} else {
|
|
ChatUtils.noPermission(p);
|
|
}
|
|
return false;
|
|
}
|
|
}
|