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


Java Player.hasPermission方法代码示例

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


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

示例1: execute

import org.spongepowered.api.entity.player.Player; //导入方法依赖的package包/类
@Override
public CommandResult execute(Optional<Claim> claimOptional, Tenant tenant, CommandContext args, Player player) throws CommandException {
    if (claimOptional.isPresent()){
        Claim claim = claimOptional.get();
        try {
            if (claim.getOwner().getId().equals(player.getUniqueId()) || player.hasPermission(Permissions.ADMINUNCLAIM))
            {
                plugin.getClaimManager().removeClaim(player.getLocation());
                plugin.getLanguageManager().sendMessage(player, Messages.LAND_UNCLAIMED, TextColors.GREEN);
            }
            else
                plugin.getLanguageManager().sendMessage(player, Messages.NO_ACCES_TO_UNCLAIM, TextColors.RED);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }else {
        plugin.getLanguageManager().sendMessage(player, Messages.NO_CLAIM_TO_UNCLAIM, TextColors.YELLOW);
    }
    return CommandResult.success();
}
 
开发者ID:thomas15v,项目名称:ChunkLord,代码行数:22,代码来源:UnclaimCommand.java

示例2: hasOwnerAccess

import org.spongepowered.api.entity.player.Player; //导入方法依赖的package包/类
/**
 * Check if a player has owner access.
 *
 * @param target the {@link UUID}
 * @return true if the player has owner access
 */
@Override
public boolean hasOwnerAccess( UUID target )
{
    if ( target.equals( this.owner ) )
    {
        return true;
    }
    Player player;
    return ( player = this.sponge.getServer().getPlayer( target ).orNull() ) != null &&
            player.hasPermission( "oglofus.protection.bypass.owner" );
}
 
开发者ID:nikosgram13,项目名称:OglofusProtection,代码行数:18,代码来源:OglofusProtectionStaff.java

示例3: hasOfficerAccess

import org.spongepowered.api.entity.player.Player; //导入方法依赖的package包/类
/**
 * Check if a player has officer access.
 *
 * @param target the {@link UUID}
 * @return true if the player has officer access
 */
@Override
public boolean hasOfficerAccess( UUID target )
{
    if ( this.staff.containsKey( target ) && this.staff.get( target ).equals( ProtectionRank.Officer ) )
    {
        return true;
    }
    Player player;
    return ( player = this.sponge.getServer().getPlayer( target ).orNull() ) != null &&
            player.hasPermission( "oglofus.protection.bypass.officer" );
}
 
开发者ID:nikosgram13,项目名称:OglofusProtection,代码行数:18,代码来源:OglofusProtectionStaff.java

示例4: hasMemberAccess

import org.spongepowered.api.entity.player.Player; //导入方法依赖的package包/类
/**
 * Check if a player has member access.
 *
 * @param target the {@link UUID}
 * @return true if the player has member access
 */
@Override
public boolean hasMemberAccess( UUID target )
{
    if ( this.staff.containsKey( target ) && this.staff.get( target ).equals( ProtectionRank.Member ) )
    {
        return true;
    }
    Player player;
    return ( player = this.sponge.getServer().getPlayer( target ).orNull() ) != null &&
            player.hasPermission( "oglofus.protection.bypass.member" );
}
 
开发者ID:nikosgram13,项目名称:OglofusProtection,代码行数:18,代码来源:OglofusProtectionStaff.java


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