1.8.9 version (?):
function register(eventClass, listener) {
//we are making reflected event bus to access private fields & methods
adaptedBus = new Reflector(MinecraftForge.EVENT_BUS);
//getting an actual mod container (it seems that activeModContainer() returns null in LiquidBounce so we are checking for null & redefining to minecraft mod container)
activeModContainer = Loader.instance().activeModContainer();
!activeModContainer && (activeModContainer = Loader.instance().getMinecraftModContainer());
//https://github.com/MinecraftForge/MinecraftForge/blob/d06e0ad71b8471923cc809dde58251de8299a143/src/main/java/net/minecraftforge/fml/common/eventhandler/EventBus.java#L58
adaptedBus.listenerOwners.put(listener, activeModContainer);
ctr = eventClass.getConstructor();
ctr.setAccessible(true);
EVENT = ctr.newInstance();
//don't remove this line because event won't call without it
asm = new ASMEventHandler(listener, getMethod(listener, "invoke"), activeModContainer);
//registering a new listener
EVENT.getListenerList().register(adaptedBus.busID, EventPriority.NORMAL, listener);
others = adaptedBus.listeners.get(listener);
if (!others) {
others = new ArrayList();
adaptedBus.listeners.put(listener, others);
}
others.add(asm)
}