Join/leave/death messages

This commit is contained in:
phobia 2016-04-04 17:20:21 +10:00
parent 15c4b2dd58
commit aaccb6fd48

View File

@ -575,7 +575,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
} }
} }
} }
@EventHandler @EventHandler
public void StaffIncognito(IncognitoStatusChangeEvent event) public void StaffIncognito(IncognitoStatusChangeEvent event)
{ {
@ -589,16 +589,16 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
} }
} }
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.HIGHEST)
public void Join(PlayerJoinEvent event) public void Join(PlayerJoinEvent event)
{ {
event.setJoinMessage(null);
if (IncognitoManager.Instance.Get(event.getPlayer()).Status) if (IncognitoManager.Instance.Get(event.getPlayer()).Status)
{ {
event.setJoinMessage(null);
return; return;
} }
event.setJoinMessage(null);
for (Player other : UtilServer.getPlayers()) for (Player other : UtilServer.getPlayers())
{ {
@ -612,16 +612,16 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
} }
} }
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.HIGHEST)
public void Quit(PlayerQuitEvent event) public void Quit(PlayerQuitEvent event)
{ {
event.setQuitMessage(null);
if (IncognitoManager.Instance.Get(event.getPlayer()).Status) if (IncognitoManager.Instance.Get(event.getPlayer()).Status)
{ {
event.setQuitMessage(null);
return; return;
} }
event.setQuitMessage(null);
for (Player other : UtilServer.getPlayers()) for (Player other : UtilServer.getPlayers())
{ {
@ -634,8 +634,8 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
other.sendMessage(F.sys("Quit", event.getPlayer().getName())); other.sendMessage(F.sys("Quit", event.getPlayer().getName()));
} }
} }
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.HIGHEST)
public void Kick(PlayerKickEvent event) public void Kick(PlayerKickEvent event)
{ {
if (IncognitoManager.Instance.Get(event.getPlayer()).Status) if (IncognitoManager.Instance.Get(event.getPlayer()).Status)
@ -1172,7 +1172,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
{ {
return; return;
} }
Rank rank = _clientManager.Get(event.getPlayer()).GetRank(); Rank rank = _clientManager.Get(event.getPlayer()).GetRank();
if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp()) if (UtilServer.getPlayers().length >= UtilServer.getServer().getMaxPlayers() && !rank.has(Rank.ADMIN) && !event.getPlayer().isWhitelisted() && !event.getPlayer().isOp())
{ {
@ -1248,6 +1248,14 @@ public class ClansManager extends MiniClientPlugin<ClientClan>implements IRelati
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void handleClansDeath(PlayerDeathEvent event) public void handleClansDeath(PlayerDeathEvent event)
{ {
event.setDeathMessage(null);
for(Player player : UtilServer.getPlayers())
{
if(!_tutorial.inTutorial(player))
player.sendMessage(event.getDeathMessage());
}
PlayerClan playerClan; PlayerClan playerClan;
PlayerClan killerClan = null; PlayerClan killerClan = null;