本文整理汇总了Java中ru.tehkode.permissions.PermissionUser.addGroup方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionUser.addGroup方法的具体用法?Java PermissionUser.addGroup怎么用?Java PermissionUser.addGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ru.tehkode.permissions.PermissionUser
的用法示例。
在下文中一共展示了PermissionUser.addGroup方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
protected void execute(Event e) {
for (OfflinePlayer op : p.getAll(e)) {
PermissionUser permuser = PermissionsEx.getPermissionManager().getUser(op.getUniqueId());
permuser.addGroup(s.getSingle(e));
}
}
示例2: addGroup
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
boolean addGroup(final UUID player, final Group group) {
Check.nonNulls("The player/group cannot be null!", player, group);
if(!this.getManager().isPresent()) { return false; }
final PermissionUser user = this.getManager().get().getUser(player);
final PermissionGroup pexGroup = this.getGroupMap().get(group);
if (!user.inGroup(pexGroup)) {
user.addGroup(pexGroup);
return true;
}
else { return false; }
}
示例3: playerAddGroup
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
public boolean playerAddGroup(String worldName, String playerName, String groupName) {
PermissionGroup group = PermissionsEx.getPermissionManager().getGroup(groupName);
PermissionUser user = PermissionsEx.getPermissionManager().getUser(playerName);
if (group == null || user == null) {
return false;
} else {
user.addGroup(group);
return true;
}
}
示例4: addToGroup
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
public boolean addToGroup(OfflinePlayer player, String group) {
if (!PermissionsEx.getPermissionManager().getGroupNames().contains(group)) {
return false;
}
PermissionUser user = PermissionsEx.getUser(player.getName());
user.addGroup(group);
return true;
}
示例5: addGroup
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
/**
* Add the permission group of a player, if supported.
*
* @param player The player
* @param groupName The name of the group.
* @return True if succeed, false otherwise.
* False is also returned if this feature isn't supported for the current permissions system.
*/
public boolean addGroup(Player player, String groupName) {
// Make sure the manager is enabled and is hooked into a permissions system
if(!isEnabled() || !isHooked())
return false;
// Set the group the proper way
switch (this.permsType) {
case PERMISSIONS_EX:
// Permissions Ex
PermissionUser user = PermissionsEx.getUser(player);
user.addGroup(groupName);
return true;
case PERMISSIONS_BUKKIT:
// Permissions Bukkit
// Add the group to the user using a command
return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "permissions player addgroup " + player.getName() + " " + groupName);
case B_PERMISSIONS:
// bPermissions
ApiLayer.addGroup(player.getWorld().getName(), CalculableType.USER, player.getName(), groupName);
return true;
case ESSENTIALS_GROUP_MANAGER:
// Essentials Group Manager
// Add the group to the user using a command
return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "manuaddsub " + player.getName() + " " + groupName);
case Z_PERMISSIONS:
// zPermissions
// Add the group to the user using a command
return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "permissions player " + player.getName() + " addgroup " + groupName);
case VAULT:
// Vault
vaultPerms.playerAddGroup(player, groupName);
return true;
case PERMISSIONS:
// Permissions
// FIXME: Add support for this!
//return this.defaultPerms.group
return false;
}
// Failed, return false
return false;
}