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


Java IPermissionsEntity类代码示例

本文整理汇总了Java中net.samagames.api.permissions.IPermissionsEntity的典型用法代码示例。如果您正苦于以下问题:Java IPermissionsEntity类的具体用法?Java IPermissionsEntity怎么用?Java IPermissionsEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: removePlayer

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
public void removePlayer(Player player)
{
    this.playersIn.remove(player.getUniqueId());
    this.playersCheckpoints.remove(player.getUniqueId());

    player.getInventory().clear();
    this.hub.getPlayerManager().getStaticInventory().setInventoryToPlayer(player);

    IPermissionsEntity permissionsEntity = SamaGamesAPI.get().getPermissionsManager().getPlayer(player.getUniqueId());

    if (permissionsEntity.hasPermission("network.vipplus") && SamaGamesAPI.get().getSettingsManager().getSettings(player.getUniqueId()).isElytraActivated())
    {
        player.getInventory().setChestplate(new ItemStack(Material.ELYTRA));
        this.hub.getPlayerManager().getStaticInventory().setInventoryToPlayer(player);
    }

    for (UUID playerIn : this.playersIn.keySet())
    {
        this.hub.getServer().getScheduler().runTask(this.hub, () ->
        {
            player.showPlayer(this.hub.getServer().getPlayer(playerIn));
            this.hub.getServer().getPlayer(playerIn).showPlayer(player);
        });
    }
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:26,代码来源:Parkour.java

示例2: getColoredFormattedPlayerName

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
/**
 * Get a colored formatted player name
 *
 * @param uuid Player's UUID
 *
 * @return Formatted name
 */
public static String getColoredFormattedPlayerName(UUID uuid)
{
    AbstractPlayerData playerData = SamaGamesAPI.get().getPlayerManager().getPlayerData(uuid);
    IPermissionsEntity playerPermissionEntity = SamaGamesAPI.get().getPermissionsManager().getPlayer(uuid);

    return playerPermissionEntity.getDisplayPrefix() + playerData.getDisplayName() + ChatColor.RESET;
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:15,代码来源:PlayerUtils.java

示例3: getFormattedRank

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
public static String getFormattedRank(UUID uuid, boolean overrideNickname)
{
    IPermissionsEntity permissionsEntity = SamaGamesAPI.get().getPermissionsManager().getPlayer(uuid);

    String prefix = overrideNickname ? permissionsEntity.getPrefix() : permissionsEntity.getDisplayPrefix();
    String display = (overrideNickname ? permissionsEntity.getTag() : permissionsEntity.getDisplayTag()).replace("[", "").replace("]", "");

    if (ChatColor.stripColor(display).isEmpty())
        display = ChatColor.GRAY + "Joueur";

    return prefix + display;
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:13,代码来源:RankUtils.java

示例4: callbackGadget

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
public void callbackGadget(AbstractDisplayer displayer)
{
    displayer.getBlocksUsed().keySet().forEach(this.blocksUsed::remove);
    this.playersGadgets.remove(displayer.getPlayer().getUniqueId());

    IPermissionsEntity permissionsEntity = SamaGamesAPI.get().getPermissionsManager().getPlayer(displayer.getPlayer().getUniqueId());

    if (permissionsEntity.hasPermission("network.vipplus") && SamaGamesAPI.get().getSettingsManager().getSettings(displayer.getPlayer().getUniqueId()).isElytraActivated())
    {
        displayer.getPlayer().getInventory().setChestplate(new ItemStack(Material.ELYTRA));
        this.hub.getPlayerManager().getStaticInventory().setInventoryToPlayer(displayer.getPlayer());
    }
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:14,代码来源:GadgetManager.java

示例5: checkElytra

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
private boolean checkElytra(Player player)
{
    IPermissionsEntity permissionsEntity = SamaGamesAPI.get().getPermissionsManager().getPlayer(player.getUniqueId());

    if (!permissionsEntity.hasPermission("network.vipplus") || !SamaGamesAPI.get().getSettingsManager().getSettings(player.getUniqueId()).isElytraActivated())
    {
        player.getInventory().setChestplate(null);
        this.hub.getPlayerManager().getStaticInventory().setInventoryToPlayer(player);
        return false;
    }

    return true;
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:14,代码来源:PlayerListener.java

示例6: addConnectedPlayer

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
public void addConnectedPlayer(Player player)
{
    IPermissionsEntity user = SamaGamesAPI.get().getPermissionsManager().getPlayer(player.getUniqueId());
    String display = user.getDisplayTag();

    if (display.length() < 5)
        display += "Joueurs";

    if (this.playersDetails.containsKey(display))
        this.playersDetails.put(display, this.playersDetails.get(display) + 1);
    else
        this.playersDetails.put(display, 1);
}
 
开发者ID:SamaGames,项目名称:Hub,代码行数:14,代码来源:JsonHub.java

示例7: getPrefix

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
@Override
public String getPrefix(IPermissionsEntity entity) {
    String value = entity.getPrefix();
    if (value == null)
        return "";
    value = value.replaceAll("&s", " ");
    value = ChatColor.translateAlternateColorCodes('&', value);
    return value;
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:10,代码来源:PermissionManager.java

示例8: getSuffix

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
@Override
public String getSuffix(IPermissionsEntity entity) {
    String value = entity.getSuffix();
    if (value == null)
        return "";
    value = value.replaceAll("&s", " ");
    value = ChatColor.translateAlternateColorCodes('&', value);
    return value;
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:10,代码来源:PermissionManager.java

示例9: getDisplay

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
@Override
public String getDisplay(IPermissionsEntity entity) {
    String value = entity.getTag();
    if (value == null)
        return "";
    value = value.replaceAll("&s", " ");
    value = ChatColor.translateAlternateColorCodes('&', value);
    return value;
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:10,代码来源:PermissionManager.java

示例10: hasPermission

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
@Override
public boolean hasPermission(IPermissionsEntity entity, String permission) {
    return entity.hasPermission(permission);
}
 
开发者ID:SamaGames,项目名称:SamaGamesCore,代码行数:5,代码来源:PermissionManager.java

示例11: getFullyFormattedPlayerName

import net.samagames.api.permissions.IPermissionsEntity; //导入依赖的package包/类
/**
 * Get a fully formatted player name with
 * rank and color
 *
 * @param uuid Player's UUID
 *
 * @return Formatted name
 */
public static String getFullyFormattedPlayerName(UUID uuid)
{
    AbstractPlayerData playerData = SamaGamesAPI.get().getPlayerManager().getPlayerData(uuid);
    IPermissionsEntity playerPermissionEntity = SamaGamesAPI.get().getPermissionsManager().getPlayer(uuid);

    return playerPermissionEntity.getDisplayPrefix() + playerPermissionEntity.getDisplayTag() + playerData.getDisplayName() + ChatColor.RESET;
}
 
开发者ID:SamaGames,项目名称:SamaGamesAPI,代码行数:16,代码来源:PlayerUtils.java


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