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


Java GMUserEvent类代码示例

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


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

示例1: removeUser

import org.anjocaido.groupmanager.events.GMUserEvent; //导入依赖的package包/类
/**
 * Removes the user from the list. (he might become a default user)
 *
 * @param userName the username from the user to remove
 * @return true if it had something to remove
 */
public boolean removeUser(String userName)
{

	if (getUsers().containsKey(userName.toLowerCase()))
	{
		getUsers().remove(userName.toLowerCase());
		setUsersChanged(true);
		if (GroupManager.isLoaded())
		{
			GroupManagerEventHandler.callEvent(userName, GMUserEvent.Action.USER_REMOVED);
		}
		return true;
	}
	return false;
}
 
开发者ID:Curtis3321,项目名称:Essentials,代码行数:22,代码来源:WorldDataHolder.java

示例2: onGMUserEvent

import org.anjocaido.groupmanager.events.GMUserEvent; //导入依赖的package包/类
@EventHandler
public void onGMUserEvent(GMUserEvent event) {
    Player player = event.getUser().getBukkitPlayer();
    if (player != null) {
        handler.applyTagToPlayer(player);
    }
}
 
开发者ID:sgtcaze,项目名称:NametagEdit,代码行数:8,代码来源:HookGroupManager.java

示例3: onGMUserEvent

import org.anjocaido.groupmanager.events.GMUserEvent; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@EventHandler(priority = EventPriority.LOWEST)
public void onGMUserEvent(GMUserEvent userEvent) {
    final GMUserEvent event = userEvent;
    final Player resPlayer = event.getUser().getBukkitPlayer();
    if (resPlayer == null) { // Is null for offline players
        return;
    }
    Bukkit.getScheduler().scheduleAsyncDelayedTask(BridgePlugin.getInstance(), new Runnable() {
        public void run() {
            
            if ((GMUserEvent.Action.USER_GROUP_CHANGED == event.getAction()) && (event.getUser().getGroupName().equalsIgnoreCase("guardian"))) {
                Bukkit.broadcastMessage(ChatColor.DARK_PURPLE + resPlayer.getDisplayName() + ChatColor.WHITE + " has been granted: [" + ChatColor.GOLD + event.getUser().getGroupName() + ChatColor.WHITE + "]");
                Bukkit.broadcastMessage(ChatColor.WHITE + "Almura Thanks " + ChatColor.GOLD + resPlayer.getDisplayName() + ChatColor.WHITE + " for their donation.  It is very much appreciated.");
            }
            
            if ((GMUserEvent.Action.USER_GROUP_CHANGED == event.getAction()) && (event.getUser().getGroupName().equalsIgnoreCase("council"))) {
                Bukkit.broadcastMessage(ChatColor.DARK_PURPLE + resPlayer.getDisplayName() + ChatColor.WHITE + " has been granted: [" + ChatColor.GOLD + event.getUser().getGroupName() + ChatColor.WHITE + "]");
                Bukkit.broadcastMessage(ChatColor.WHITE + "Almura Thanks " + ChatColor.GOLD + resPlayer.getDisplayName() + ChatColor.WHITE + " for their donation.  It is very much appreciated.");
            }
            
            if ((GMUserEvent.Action.USER_GROUP_CHANGED == event.getAction()) && (event.getUser().getGroupName().equalsIgnoreCase("elder"))) {
                Bukkit.broadcastMessage(ChatColor.DARK_PURPLE + resPlayer.getDisplayName() + ChatColor.WHITE + " has been granted: [" + ChatColor.GOLD + event.getUser().getGroupName() + ChatColor.WHITE + "]");
                Bukkit.broadcastMessage(ChatColor.WHITE + "Almura Thanks " + ChatColor.GOLD + resPlayer.getDisplayName() + ChatColor.WHITE + " for their donation.  It is very much appreciated.");
            }
            
            if ((GMUserEvent.Action.USER_GROUP_CHANGED == event.getAction()) && (event.getUser().getGroupName().equalsIgnoreCase("protector"))) {
                Bukkit.broadcastMessage(ChatColor.DARK_PURPLE + resPlayer.getDisplayName() + ChatColor.WHITE + " has been granted: [" + ChatColor.GOLD + event.getUser().getGroupName() + ChatColor.WHITE + "]");
                Bukkit.broadcastMessage(ChatColor.WHITE + "Almura Thanks " + ChatColor.GOLD + resPlayer.getDisplayName() + ChatColor.WHITE + " for their donation.  It is very much appreciated.");
            }

            if ((GMUserEvent.Action.USER_GROUP_CHANGED == event.getAction()) && (event.getUser().getGroupName().equalsIgnoreCase("peasant"))) {
                Bukkit.broadcastMessage(ChatColor.DARK_PURPLE + resPlayer.getDisplayName() + ChatColor.WHITE + " has been promoted to: [" + ChatColor.YELLOW + event.getUser().getGroupName() + ChatColor.WHITE + "]");
            }
            
            if ((GMUserEvent.Action.USER_GROUP_CHANGED == event.getAction()) && (event.getUser().getGroupName().equalsIgnoreCase("citizen"))) {
                Bukkit.broadcastMessage(ChatColor.DARK_PURPLE + resPlayer.getDisplayName() + ChatColor.WHITE + " has been earned: [" + ChatColor.DARK_PURPLE + "Almura Citizenship" + ChatColor.WHITE + "]");
            }

            for (Player player : Bukkit.getServer().getOnlinePlayers()) {
                ServerWorldUtil.sendAdditionalWorldInfo(player, player.getWorld().getName(), Bukkit.getOnlinePlayers().size(), Bukkit.getMaxPlayers());
                TitleUtil.sendDisplayName(player, resPlayer.getName(), ChatColor.stripColor(resPlayer.getDisplayName()) + "\n" + TitleUtil.getCustomTitle(resPlayer));
                TitleUtil.sendDisplayName(resPlayer, player.getName(), ChatColor.stripColor(player.getDisplayName()) + "\n" + TitleUtil.getCustomTitle(player));
            }
        }
    }, 20L); //Delayed so this Group Manager has time to change the players group.
}
 
开发者ID:AlmuraDev,项目名称:AlmuraForgeBridge,代码行数:48,代码来源:PlayerListener.java


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