本文整理汇总了Java中ru.tehkode.permissions.PermissionUser.removeGroup方法的典型用法代码示例。如果您正苦于以下问题:Java PermissionUser.removeGroup方法的具体用法?Java PermissionUser.removeGroup怎么用?Java PermissionUser.removeGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ru.tehkode.permissions.PermissionUser
的用法示例。
在下文中一共展示了PermissionUser.removeGroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.removeGroup(s.getSingle(e));
}
}
示例2: removeGroup
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
boolean removeGroup(UUID player, 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.removeGroup(pexGroup);
return true;
}
else { return false; }
}
示例3: removeGroup
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
/**
* Remove 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 removeGroup(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.removeGroup(groupName);
return true;
case PERMISSIONS_BUKKIT:
// Permissions Bukkit
// Remove the group to the user using a command
return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "permissions player removegroup " + player.getName() + " " + groupName);
case B_PERMISSIONS:
// bPermissions
ApiLayer.removeGroup(player.getWorld().getName(), CalculableType.USER, player.getName(), groupName);
return true;
case ESSENTIALS_GROUP_MANAGER:
// Essentials Group Manager
// Remove the group to the user using a command
return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "manudelsub " + player.getName() + " " + groupName);
case Z_PERMISSIONS:
// zPermissions
// Remove the group to the user using a command
return Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "permissions player " + player.getName() + " removegroup " + groupName);
case VAULT:
// Vault
vaultPerms.playerRemoveGroup(player, groupName);
return true;
case PERMISSIONS:
// Permissions
// FIXME: Add support for this!
//return this.defaultPerms.group
return false;
}
// Failed, return false
return false;
}
示例4: removeFromGroup
import ru.tehkode.permissions.PermissionUser; //导入方法依赖的package包/类
@Override
public boolean removeFromGroup(OfflinePlayer player, String group) {
PermissionUser user = permissionManager.getUser(player.getName());
user.removeGroup(group);
return true;
}