Fixed /p and /a incompatibilities with bChatManager

This commit is contained in:
bm01 2012-05-02 00:55:43 +02:00
parent 06ede80435
commit 84e36d758e
2 changed files with 40 additions and 40 deletions

View File

@ -17,6 +17,8 @@ Version 1.3.07
+ Added a permission node for Farmer's Diet
+ Added config options for enabling/disabling specific double drops
+ Added automatic zip backup of flatfile database & config files
= Fixed /p and /a incompatibilities with bChatManager
= Fixed Iron Grip working reversely
= Fixed NPE when user clicked the HUD button with Spout
= Fixed bug where the permission node for Impact didn't work
= Fixed some bypass nodes defaulting true for Ops
@ -38,7 +40,6 @@ Version 1.3.06
+ Added API functions for admin & party chat
+ Added Iron Grip skill to Unarmed which gives players an chance to keep from being disarmed.
+ Added some new languages to the locale files.
= Fixed Iron Grip working reversely
= Fixed Green Thumb consuming 2 seeds instead of 1
= Fixed exploit where you could teleport to yourself with PTP to prevent things like fall damage
= Fixed NPE error with Metrics on startup

View File

@ -286,60 +286,59 @@ public class PlayerListener implements Listener {
*
* @param event The event to watch
*/
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPlayerChat(PlayerChatEvent event) {
Player player = event.getPlayer();
PlayerProfile PP = Users.getProfile(player);
boolean partyChat = PP.getPartyChatMode();
boolean adminChat = PP.getAdminChatMode();
Set<Player> recipients = event.getRecipients();
Set<Player> intendedRecipients = new HashSet<Player>();
ChatColor color = null;
if (partyChat || adminChat) {
if (partyChat) {
if (PP.getPartyChatMode()) {
if (!PP.inParty()) {
player.sendMessage("You're not in a party, type /p to leave party chat mode."); //TODO: Use mcLocale
return;
}
color = ChatColor.GREEN;
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(player.getName(), PP.getParty(), event.getMessage());
plugin.getServer().getPluginManager().callEvent(chatEvent);
if(chatEvent.isCancelled()) return;
if(chatEvent.isCancelled()) {
return;
}
event.setMessage(chatEvent.getMessage());
Set<Player> intendedRecipients = new HashSet<Player>();
for (Player x : Party.getInstance().getOnlineMembers(player)) {
intendedRecipients.add(x);
}
event.setFormat(color + "(" + ChatColor.WHITE + "%1$s" + color + ") %2$s");
ChatColor bracketColor = ChatColor.GREEN;
event.setFormat(bracketColor + "(" + ChatColor.WHITE + "%1$s" + bracketColor + ") %2$s");
event.getRecipients().retainAll(intendedRecipients);
}
if (adminChat) {
color = ChatColor.AQUA;
else if (PP.getAdminChatMode()) {
McMMOAdminChatEvent chatEvent = new McMMOAdminChatEvent(player.getName(), event.getMessage());
plugin.getServer().getPluginManager().callEvent(chatEvent);
if(chatEvent.isCancelled()) return;
if(chatEvent.isCancelled()) {
return;
}
event.setMessage(chatEvent.getMessage());
Set<Player> intendedRecipients = new HashSet<Player>();
for (Player x : plugin.getServer().getOnlinePlayers()) {
if (x.isOp() || Permissions.getInstance().adminChat(x)) {
intendedRecipients.add(x);
}
}
event.setFormat(color + "{" + ChatColor.WHITE + "%1$s" + color + "} %2$s");
}
ChatColor bracketColor = ChatColor.AQUA;
recipients.retainAll(intendedRecipients);
event.setFormat(bracketColor + "{" + ChatColor.WHITE + "%1$s" + bracketColor + "} %2$s");
event.getRecipients().retainAll(intendedRecipients);
}
}