mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 13:13:06 +08:00
GameServerPacketHandler need to be added a registration interface for plugin developers
This commit is contained in:
parent
677aa2d2c4
commit
dde5a609fb
@ -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