mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-27 07:34:27 +00:00
Modify chat manager to give plugin ability to change it
This commit is contained in:
parent
722d53c9c2
commit
f1af23e8d6
@ -1,4 +1,4 @@
|
||||
package emu.grasscutter.game.managers;
|
||||
package emu.grasscutter.game.managers.ChatManager;
|
||||
|
||||
import emu.grasscutter.command.CommandMap;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
@ -10,7 +10,7 @@ import emu.grasscutter.server.packet.send.PacketPrivateChatNotify;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ChatManager {
|
||||
public class ChatManager implements ChatManagerHandler {
|
||||
static final List<Character> PREFIXES = Arrays.asList('/', '!');
|
||||
|
||||
private final GameServer server;
|
@ -0,0 +1,12 @@
|
||||
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;
|
||||
import emu.grasscutter.game.dungeons.DungeonManager;
|
||||
import emu.grasscutter.game.expedition.ExpeditionManager;
|
||||
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.MultiplayerManager;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.quest.ServerQuestHandler;
|
||||
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
|
||||
import emu.grasscutter.game.shop.ShopManager;
|
||||
import emu.grasscutter.game.tower.TowerScheduleManager;
|
||||
import emu.grasscutter.game.world.World;
|
||||
@ -44,7 +44,7 @@ public final class GameServer extends KcpServer {
|
||||
private final Map<Integer, Player> players;
|
||||
private final Set<World> worlds;
|
||||
|
||||
private final ChatManager chatManager;
|
||||
private ChatManagerHandler chatManager;
|
||||
private final InventoryManager inventoryManager;
|
||||
private final GachaManager gachaManager;
|
||||
private final ShopManager shopManager;
|
||||
@ -107,9 +107,12 @@ public final class GameServer extends KcpServer {
|
||||
return worlds;
|
||||
}
|
||||
|
||||
public ChatManager getChatManager() {
|
||||
public ChatManagerHandler getChatManager() {
|
||||
return chatManager;
|
||||
}
|
||||
public void setChatManager(ChatManagerHandler chatManager) {
|
||||
this.chatManager = chatManager;
|
||||
}
|
||||
|
||||
public InventoryManager getInventoryManager() {
|
||||
return inventoryManager;
|
||||
|
Loading…
Reference in New Issue
Block a user