當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。