当前位置: 首页>>代码示例>>Java>>正文


Java PermissionAttachment.setPermission方法代码示例

本文整理汇总了Java中org.bukkit.permissions.PermissionAttachment.setPermission方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionAttachment.setPermission方法的具体用法?Java PermissionAttachment.setPermission怎么用?Java PermissionAttachment.setPermission使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.permissions.PermissionAttachment的用法示例。


在下文中一共展示了PermissionAttachment.setPermission方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: permissionsSetter

import org.bukkit.permissions.PermissionAttachment; //导入方法依赖的package包/类
private void permissionsSetter(UUID uuid){
    PermissionAttachment attachment = this.playerPermissions.get(uuid);
    try {
        for (String rank : RankManager.getAllRanks()){

            if (!(RankManager.getPlayersInRank(RankManager.getRankId(rank)).contains(Bukkit.getPlayer(uuid)))) {
            return;
            }
            for (String permission : RankManager.getPermissions(RankManager.getRankId(rank))){
                if(!(StringUtils.isEmpty(permission) || permission.equals(" "))){attachment.setPermission(permission, true); }
            }
        }
    } catch (SQLException e) {
        e.printStackTrace();
    }
}
 
开发者ID:Warvale,项目名称:Ace,代码行数:17,代码来源:PermissionsManager.java

示例2: onPlayerJoin

import org.bukkit.permissions.PermissionAttachment; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOW)
public void onPlayerJoin(PlayerJoinEvent e) {
    Player p = e.getPlayer();
    PAUser u = PAServer.getUser(p);

    if(u.isOnRank(PACmd.Grupo.Mod)){
        PermissionAttachment attachment = p.addAttachment(plugin);
        plugin.getPerms().put(p, attachment);
        PermissionAttachment pperms = plugin.getPerms().get(p);
        pperms.setPermission("bm.*", true);
    }

    //u.sendHeaderAndFooter("&cProject&6Alpha", "");

    u.getUserData().setLastConnect(System.currentTimeMillis());
    u.getUserData().setTimeJoin(System.currentTimeMillis());
    u.getUserData().setIp(u.getPlayer().getAddress());
    u.save();
    u.getPlayer().setFlySpeed(0.2f);
    u.getPlayer().setWalkSpeed(0.2f);
    if (u.getUserData().getNickname() != null) {
        u.getPlayer().setDisplayName(u.getUserData().getNickname());
    } else {
        u.getPlayer().setDisplayName(u.getName());
    }

    e.setJoinMessage(Messages.getMessage(Messages.JOIN, PAData.CORE, "%player%", e.getPlayer().getName()));
}
 
开发者ID:cadox8,项目名称:PA,代码行数:29,代码来源:PlayerListener.java

示例3: addAttachment

import org.bukkit.permissions.PermissionAttachment; //导入方法依赖的package包/类
@Override
public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) {
    PermissionAttachment attachment = addAttachment(plugin);
    attachment.setPermission(name, value);
    return attachment;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:7,代码来源:NullPermissible.java

示例4: setPermissions

import org.bukkit.permissions.PermissionAttachment; //导入方法依赖的package包/类
public static void setPermissions(PermissionAttachment attachment,  Map<String, Boolean> permissions) {
    for(Map.Entry<String, Boolean> entry : permissions.entrySet()) {
        attachment.setPermission(entry.getKey(), entry.getValue());
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:6,代码来源:PermissionUtils.java

示例5: addAttachment

import org.bukkit.permissions.PermissionAttachment; //导入方法依赖的package包/类
@Override
public PermissionAttachment addAttachment( Plugin plugin, String s, boolean b ) {
    PermissionAttachment permissionAttachment = this.addAttachment( plugin );
    permissionAttachment.setPermission( s, b );
    return permissionAttachment;
}
 
开发者ID:lukas81298,项目名称:FlexMC,代码行数:7,代码来源:FlexServerImpl.java


注:本文中的org.bukkit.permissions.PermissionAttachment.setPermission方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。