本文整理汇总了Java中cn.nukkit.permission.Permissible.hasPermission方法的典型用法代码示例。如果您正苦于以下问题:Java Permissible.hasPermission方法的具体用法?Java Permissible.hasPermission怎么用?Java Permissible.hasPermission使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.nukkit.permission.Permissible
的用法示例。
在下文中一共展示了Permissible.hasPermission方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: broadcast
import cn.nukkit.permission.Permissible; //导入方法依赖的package包/类
public int broadcast(String message, String permissions) {
Set<CommandSender> recipients = new HashSet<>();
for (String permission : permissions.split(";")) {
for (Permissible permissible : this.pluginManager.getPermissionSubscriptions(permission)) {
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
recipients.add((CommandSender) permissible);
}
}
}
for (CommandSender recipient : recipients) {
recipient.sendMessage(message);
}
return recipients.size();
}
示例2: broadcastPopup
import cn.nukkit.permission.Permissible; //导入方法依赖的package包/类
public int broadcastPopup(String message, String permissions) {
Set<Player> recipients = new HashSet<>();
for (String permission : permissions.split(";")) {
for (Permissible permissible : this.pluginManager.getPermissionSubscriptions(permission)) {
if (permissible instanceof Player && permissible.hasPermission(permission)) {
recipients.add((Player) permissible);
}
}
}
for (Player recipient : recipients) {
recipient.sendPopup(message);
}
return recipients.size();
}
示例3: broadcastTip
import cn.nukkit.permission.Permissible; //导入方法依赖的package包/类
public int broadcastTip(String message, String permissions) {
Set<Player> recipients = new HashSet<>();
for (String permission : permissions.split(";")) {
for (Permissible permissible : this.pluginManager.getPermissionSubscriptions(permission)) {
if (permissible instanceof Player && permissible.hasPermission(permission)) {
recipients.add((Player) permissible);
}
}
}
for (Player recipient : recipients) {
recipient.sendTip(message);
}
return recipients.size();
}
示例4: broadcastTitle
import cn.nukkit.permission.Permissible; //导入方法依赖的package包/类
public int broadcastTitle(String message, String permissions) {
Set<Player> recipients = new HashSet<>();
for (String permission : permissions.split(";")) {
for (Permissible permissible : this.pluginManager.getPermissionSubscriptions(permission)) {
if (permissible instanceof Player && permissible.hasPermission(permission)) {
recipients.add((Player) permissible);
}
}
}
for (Player recipient : recipients) {
recipient.sendTitle(message);
}
return recipients.size();
}
示例5: broadcastSubtitle
import cn.nukkit.permission.Permissible; //导入方法依赖的package包/类
public int broadcastSubtitle(String message, String permissions) {
Set<Player> recipients = new HashSet<>();
for (String permission : permissions.split(";")) {
for (Permissible permissible : this.pluginManager.getPermissionSubscriptions(permission)) {
if (permissible instanceof Player && permissible.hasPermission(permission)) {
recipients.add((Player) permissible);
}
}
}
for (Player recipient : recipients) {
recipient.setSubtitle(message);
}
return recipients.size();
}
示例6: broadcastImportantMessage
import cn.nukkit.permission.Permissible; //导入方法依赖的package包/类
public int broadcastImportantMessage(String message, String permissions) {
Set<CommandSender> recipients = new HashSet<>();
for (String permission : permissions.split(";")) {
for (Permissible permissible : this.pluginManager.getPermissionSubscriptions(permission)) {
if (permissible instanceof CommandSender && permissible.hasPermission(permission)) {
recipients.add((CommandSender) permissible);
}
}
}
for (CommandSender recipient : recipients) {
recipient.sendImportantMessage(message);
}
return recipients.size();
}
示例7: hasPermission
import cn.nukkit.permission.Permissible; //导入方法依赖的package包/类
public boolean hasPermission(Permissible sender){
return sender.hasPermission(this.getPermission());
}