mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-24 00:11:31 +00:00
GameServerPacketHandler need to be added a registration interface for plugin developers
This commit is contained in:
parent
d4e1b265e3
commit
59d5f4feec
@ -23,6 +23,10 @@ public class GameServerPacketHandler {
|
||||
this.registerHandlers(handlerClass);
|
||||
}
|
||||
|
||||
public void registerPacketHandler(int opcode, PacketHandler handler) {
|
||||
this.handlers.put(opcode, handler);
|
||||
}
|
||||
|
||||
public void registerHandlers(Class<? extends PacketHandler> handlerClass) {
|
||||
Reflections reflections = new Reflections("emu.grasscutter.server.packet");
|
||||
Set<?> handlerClasses = reflections.getSubTypesOf(handlerClass);
|
||||
|
Loading…
Reference in New Issue
Block a user