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


Java Essentials.getUser方法代码示例

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


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

示例1: setUnvanished

import com.earth2me.essentials.Essentials; //导入方法依赖的package包/类
public void setUnvanished(Player player) {
    if (!config.isPatchesToggleVanishOnStart() || !isEnabled()) {
        return;
    }

    Essentials essentials = (Essentials) getPlugin();
    User user = essentials.getUser(player);

    if (user != null) {
        user.setVanished(false);
        user.setVanished(true);
        user.setVanished(false);
    }
}
 
开发者ID:RealizedMC,项目名称:Duels,代码行数:15,代码来源:EssentialsHook.java

示例2: setBackLocation

import com.earth2me.essentials.Essentials; //导入方法依赖的package包/类
public void setBackLocation(Player player, Location location) {
    if (!config.isPatchesSetBackLocation() || !isEnabled()) {
        return;
    }

    Essentials essentials = (Essentials) getPlugin();
    User user = essentials.getUser(player);

    if (user != null) {
        user.setLastLocation(location);
    }
}
 
开发者ID:RealizedMC,项目名称:Duels,代码行数:13,代码来源:EssentialsHook.java

示例3: getPermittedRecipients

import com.earth2me.essentials.Essentials; //导入方法依赖的package包/类
/**
 * Get a list of recipients that want this message.  The list is composed
 * of all the players Listening to the channel minus anyone who has muted
 * the sender of the message.
 *
 * @param player Player who is sending this message
 * @return Set containing Players who should receive the message.  Null if
 * the sending player is muted.
 */
public Set<Player> getPermittedRecipients(Player player) {
    final Set<Player> retVal = getRecipients();
    if (player == null) return retVal;

    Essentials ess = PwnChat.getEssentials();

    final User user;

    if (ess != null) {
        user = ess.getUser(player);
    } else {
        user = null;
    }

    if (user == null) {
        return retVal;
    } else {
        if (user.isMuted())
        {
            user.sendMessage(_("voiceSilenced"));
            return null;
        }
        try
        {
            final Iterator<Player> it = retVal.iterator();
            while (it.hasNext())
            {
                final User u = ess.getUser(it.next());
                if (u.isIgnoredPlayer(user))
                {
                    it.remove();
                }
            }
        }
        catch (UnsupportedOperationException ex)
        {
            if (ess.getSettings().isDebug())
            {
                ess.getLogger().log(Level.INFO, "Ignore could not block chat due to custom chat plugin event.", ex);
            }
            else
            {
                ess.getLogger().info("Ignore could not block chat due to custom chat plugin event.");
            }
        }
    }
    return retVal;
}
 
开发者ID:ptoal,项目名称:PwnChat,代码行数:58,代码来源:Channel.java


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