mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 21:47:39 +00:00
GameServerPacketHandler need to be added a registration interface for plugin developers
This commit is contained in:
parent
d4e1b265e3
commit
59d5f4feec
@ -22,7 +22,11 @@ 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