本文整理匯總了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();
}
}
示例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()));
}
示例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;
}
示例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());
}
}
示例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;
}