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