commit
956c6abb93
@ -19,10 +19,7 @@ import zone.themcgamer.core.common.Style;
|
|||||||
import zone.themcgamer.core.module.Module;
|
import zone.themcgamer.core.module.Module;
|
||||||
import zone.themcgamer.core.module.ModuleInfo;
|
import zone.themcgamer.core.module.ModuleInfo;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Braydon
|
* @author Braydon
|
||||||
@ -31,6 +28,13 @@ import java.util.Optional;
|
|||||||
public class ChatManager extends Module {
|
public class ChatManager extends Module {
|
||||||
private final BadSportSystem badSportSystem;
|
private final BadSportSystem badSportSystem;
|
||||||
private final IChatComponent[] chatComponents;
|
private final IChatComponent[] chatComponents;
|
||||||
|
private final Map<String, String> emotes = new HashMap<>();
|
||||||
|
|
||||||
|
{
|
||||||
|
emotes.put("shrug", "¯\\_(ツ)_/¯");
|
||||||
|
emotes.put("tableflip", "(╯°□°)╯︵ ┻━┻");
|
||||||
|
emotes.put("unflip", "┬─┬ ノ( ゜-゜ノ)");
|
||||||
|
}
|
||||||
|
|
||||||
public ChatManager(JavaPlugin plugin, BadSportSystem badSportSystem, IChatComponent[] chatComponents) {
|
public ChatManager(JavaPlugin plugin, BadSportSystem badSportSystem, IChatComponent[] chatComponents) {
|
||||||
super(plugin);
|
super(plugin);
|
||||||
@ -74,6 +78,8 @@ public class ChatManager extends Module {
|
|||||||
player.sendMessage(Style.error("Chat", "§cCannot format chat message"));
|
player.sendMessage(Style.error("Chat", "§cCannot format chat message"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
for (Map.Entry<String, String> emote : emotes.entrySet())
|
||||||
|
message = message.replace(":" + emote.getKey() + ":", emote.getValue());
|
||||||
List<BaseComponent> components = new ArrayList<>();
|
List<BaseComponent> components = new ArrayList<>();
|
||||||
for (IChatComponent chatComponent : chatComponents) {
|
for (IChatComponent chatComponent : chatComponents) {
|
||||||
BaseComponent component = chatComponent.getComponent(player);
|
BaseComponent component = chatComponent.getComponent(player);
|
||||||
|
Reference in New Issue
Block a user