summaryrefslogtreecommitdiffstats
path: root/EssentialsChat/src/com/earth2me/essentials/chat/EssentialsChatPlayerListenerHighest.java
blob: 2e65c8959f3c04349f29cdd68ba4e6e552c10553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.earth2me.essentials.chat;

import com.earth2me.essentials.IEssentials;
import java.util.Map;
import org.bukkit.Server;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.player.AsyncPlayerChatEvent;


public class EssentialsChatPlayerListenerHighest extends EssentialsChatPlayer
{
	public EssentialsChatPlayerListenerHighest(final Server server,
											   final IEssentials ess,
											   final Map<AsyncPlayerChatEvent, ChatStore> chatStorage)
	{
		super(server, ess, chatStorage);
	}

	@EventHandler(priority = EventPriority.HIGHEST)
	@Override
	public void onPlayerChat(final AsyncPlayerChatEvent event)
	{
		final ChatStore chatStore = delChatStore(event);
		if (isAborted(event) || chatStore == null)
		{
			return;
		}

		/**
		 * This file should handle charging the user for the action before returning control back
		 */
		charge(event, chatStore);
	}
}