for (PacketHandlerDef handlerDef : handlerDefs) {
try {
String className = handlerDef.getClassName();
Class<?> c = Class.forName(className);
if (c != null) {
PacketHandler handler = (PacketHandler) c.newInstance();
for (int packetID : handlerDef.getAssociatedPackets()) {
LSPacketHandlers.put(packetID, handler);
}
}
} catch (Exception e) {
Server.error(e);
}
}
handlerDefs = ConfigManager.load("FPacketHandler.json",
PacketHandlerDef[].class);
for (PacketHandlerDef handlerDef : handlerDefs) {
try {
String className = handlerDef.getClassName();
Class<?> c = Class.forName(className);
if (c != null) {
PacketHandler handler = (PacketHandler) c.newInstance();
for (int packetID : handlerDef.getAssociatedPackets()) {
FPacketHandlers.put(packetID, handler);
}
}
} catch (Exception e) {