本文整理汇总了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();
}
示例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" );
}
示例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" );
}
示例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" );
}