Changed leave messages to be printed BEFORE enter messages. Suggested by Protected.

This commit is contained in:
sk89q 2011-06-06 11:30:00 -07:00
parent 7059fdfd9e
commit 2188690d20

View File

@ -182,14 +182,21 @@ public void onPlayerMove(PlayerMoveEvent event) {
Boolean notifyEnter = set.getFlag(DefaultFlag.NOTIFY_ENTER);
Boolean notifyLeave = set.getFlag(DefaultFlag.NOTIFY_LEAVE);
if (state.lastFarewell != null && (farewell == null
|| !state.lastFarewell.equals(farewell))) {
player.sendMessage(ChatColor.AQUA + " ** " + state.lastFarewell);
}
if (greeting != null && (state.lastGreeting == null
|| !state.lastGreeting.equals(greeting))) {
player.sendMessage(ChatColor.AQUA + " ** " + greeting);
}
if (state.lastFarewell != null && (farewell == null
|| !state.lastFarewell.equals(farewell))) {
player.sendMessage(ChatColor.AQUA + " ** " + state.lastFarewell);
if ((notifyLeave == null || !notifyLeave)
&& state.notifiedForLeave != null && state.notifiedForLeave) {
plugin.broadcastNotification(ChatColor.GRAY + "WG: "
+ ChatColor.LIGHT_PURPLE + player.getName()
+ ChatColor.GOLD + " left NOTIFY region");
}
if (notifyEnter != null && notifyEnter && (state.notifiedForEnter == null
@ -209,13 +216,6 @@ public void onPlayerMove(PlayerMoveEvent event) {
+ ChatColor.WHITE
+ regionList);
}
if ((notifyLeave == null || !notifyLeave)
&& state.notifiedForLeave != null && state.notifiedForLeave) {
plugin.broadcastNotification(ChatColor.GRAY + "WG: "
+ ChatColor.LIGHT_PURPLE + player.getName()
+ ChatColor.GOLD + " left NOTIFY region");
}
state.lastGreeting = greeting;
state.lastFarewell = farewell;