Commit 05e13d81 authored by muhammadeko's avatar muhammadeko Committed by Melledy
Browse files

Modify chat manager to give plugin ability to change it

parent 7a66f228
package emu.grasscutter.game.managers; package emu.grasscutter.game.managers.ChatManager;
import emu.grasscutter.command.CommandMap; import emu.grasscutter.command.CommandMap;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
...@@ -10,7 +10,7 @@ import emu.grasscutter.server.packet.send.PacketPrivateChatNotify; ...@@ -10,7 +10,7 @@ import emu.grasscutter.server.packet.send.PacketPrivateChatNotify;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
public class ChatManager { public class ChatManager implements ChatManagerHandler {
static final List<Character> PREFIXES = Arrays.asList('/', '!'); static final List<Character> PREFIXES = Arrays.asList('/', '!');
private final GameServer server; private final GameServer server;
......
package emu.grasscutter.game.managers.ChatManager;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.server.game.GameServer;
public interface ChatManagerHandler {
GameServer getServer();
void sendPrivateMessage(Player player, int targetUid, String message);
void sendPrivateMessage(Player player, int targetUid, int emote);
void sendTeamMessage(Player player, int channel, String message);
void sendTeamMessage(Player player, int channel, int icon);
}
...@@ -10,12 +10,12 @@ import emu.grasscutter.game.drop.DropManager; ...@@ -10,12 +10,12 @@ import emu.grasscutter.game.drop.DropManager;
import emu.grasscutter.game.dungeons.DungeonManager; import emu.grasscutter.game.dungeons.DungeonManager;
import emu.grasscutter.game.expedition.ExpeditionManager; import emu.grasscutter.game.expedition.ExpeditionManager;
import emu.grasscutter.game.gacha.GachaManager; import emu.grasscutter.game.gacha.GachaManager;
import emu.grasscutter.game.managers.ChatManager; import emu.grasscutter.game.managers.ChatManager.ChatManager;
import emu.grasscutter.game.managers.ChatManager.ChatManagerHandler;
import emu.grasscutter.game.managers.InventoryManager; import emu.grasscutter.game.managers.InventoryManager;
import emu.grasscutter.game.managers.MultiplayerManager; import emu.grasscutter.game.managers.MultiplayerManager;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.quest.ServerQuestHandler; import emu.grasscutter.game.quest.ServerQuestHandler;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
import emu.grasscutter.game.shop.ShopManager; import emu.grasscutter.game.shop.ShopManager;
import emu.grasscutter.game.tower.TowerScheduleManager; import emu.grasscutter.game.tower.TowerScheduleManager;
import emu.grasscutter.game.world.World; import emu.grasscutter.game.world.World;
...@@ -44,7 +44,7 @@ public final class GameServer extends KcpServer { ...@@ -44,7 +44,7 @@ public final class GameServer extends KcpServer {
private final Map<Integer, Player> players; private final Map<Integer, Player> players;
private final Set<World> worlds; private final Set<World> worlds;
private final ChatManager chatManager; private ChatManagerHandler chatManager;
private final InventoryManager inventoryManager; private final InventoryManager inventoryManager;
private final GachaManager gachaManager; private final GachaManager gachaManager;
private final ShopManager shopManager; private final ShopManager shopManager;
...@@ -107,9 +107,12 @@ public final class GameServer extends KcpServer { ...@@ -107,9 +107,12 @@ public final class GameServer extends KcpServer {
return worlds; return worlds;
} }
public ChatManager getChatManager() { public ChatManagerHandler getChatManager() {
return chatManager; return chatManager;
} }
public void setChatManager(ChatManagerHandler chatManager) {
this.chatManager = chatManager;
}
public InventoryManager getInventoryManager() { public InventoryManager getInventoryManager() {
return inventoryManager; return inventoryManager;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment