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