2013-06-07 00:48:25 +02:00
|
|
|
package com.gmail.nossr50.chat;
|
|
|
|
|
|
|
|
import org.bukkit.plugin.Plugin;
|
|
|
|
|
|
|
|
import com.gmail.nossr50.config.Config;
|
|
|
|
import com.gmail.nossr50.datatypes.party.Party;
|
|
|
|
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
2014-07-18 17:06:30 +02:00
|
|
|
import com.gmail.nossr50.runnables.party.PartyChatTask;
|
2013-06-07 00:48:25 +02:00
|
|
|
|
|
|
|
public class PartyChatManager extends ChatManager {
|
|
|
|
private Party party;
|
|
|
|
|
|
|
|
protected PartyChatManager(Plugin plugin) {
|
2013-08-17 12:18:29 +02:00
|
|
|
super(plugin, Config.getInstance().getPartyDisplayNames(), Config.getInstance().getPartyChatPrefix());
|
2013-06-07 00:48:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setParty(Party party) {
|
|
|
|
this.party = party;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void handleChat(String senderName, String displayName, String message, boolean isAsync) {
|
|
|
|
handleChat(new McMMOPartyChatEvent(plugin, senderName, displayName, party.getName(), message, isAsync));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void sendMessage() {
|
2014-07-18 17:06:30 +02:00
|
|
|
new PartyChatTask(plugin, party, senderName, displayName, message).runTask(plugin);
|
2013-06-07 00:48:25 +02:00
|
|
|
}
|
|
|
|
}
|