WurmClientModLauncher icon indicating copy to clipboard operation
WurmClientModLauncher copied to clipboard

postInit

Open ago1024 opened this issue 10 years ago • 1 comments

Small issue/suggestion:

Currently if i try to use normal java reflection into wurm code in init or preInit - it causes the class to be properly loaded and frozen, which means javaassist can't modify it later if some other mod wants to do that.

What i'd suggest is adding another "step" - postInit and defining in documentation (i'm not sure if enforcing that in code would be possible) what mods should do in every initialization "step". Eg:

Pre - setup their own internal stuff
Init - add hooks and patch classes, no interaction with wurm classes in "normal" code
Post - wurm classes can be accessed from normal code, javaassist stuff is not allowed anymore

ago1024 avatar Dec 27 '15 13:12 ago1024

This sounds cool. Would Post run after server connection is created? So that all the classes are initiated?

I understand that to do that know I need to use javaassist to hook my code in the right place?

marad avatar Dec 30 '16 16:12 marad