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