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