本文整理汇总了Java中cn.nukkit.permission.PermissionAttachment类的典型用法代码示例。如果您正苦于以下问题:Java PermissionAttachment类的具体用法?Java PermissionAttachment怎么用?Java PermissionAttachment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PermissionAttachment类属于cn.nukkit.permission包,在下文中一共展示了PermissionAttachment类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removePermissions
import cn.nukkit.permission.PermissionAttachment; //导入依赖的package包/类
public void removePermissions(Player player){
PermissionAttachment attachment = player.addAttachment(this.plugin);
TreeMap<String, Boolean> permissions = new TreeMap<String, Boolean>(new PermissionComparator());
this.plugin.getServer().getPluginManager().getPermissions().forEach((k, v) -> {
permissions.put(k, false);
});
permissions.put("nukkit.command.help", true);
permissions.put("gatekeeper.command.login", true);
permissions.put("gatekeeper.command.register", true);
attachment.setPermissions(permissions);
this.attachments.put(player, attachment);
}
示例2: addAttachment
import cn.nukkit.permission.PermissionAttachment; //导入依赖的package包/类
@Override
public PermissionAttachment addAttachment(Plugin plugin) {
return this.addAttachment(plugin, null);
}
示例3: removeAttachment
import cn.nukkit.permission.PermissionAttachment; //导入依赖的package包/类
@Override
public void removeAttachment(PermissionAttachment attachment) {
this.perm.removeAttachment(attachment);
}
示例4: addAttachment
import cn.nukkit.permission.PermissionAttachment; //导入依赖的package包/类
@Override
public PermissionAttachment addAttachment(Plugin plugin) {
return this.perm.addAttachment(plugin);
}