Suppress certain mod errors on client load

This commit is contained in:
Anuken
2021-06-25 14:37:32 -04:00
parent 3d6cfcafd0
commit cd2c605036
3 changed files with 11 additions and 2 deletions

View File

@@ -149,7 +149,16 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
}
mods.eachClass(Mod::init);
finished = true;
Events.fire(new ClientLoadEvent());
var event = new ClientLoadEvent();
//a temporary measure for compatibility with certain mods
Events.fireWrap(event.getClass(), event, listener -> {
try{
listener.get(event);
}catch(NoSuchFieldError | NoSuchMethodError error){
Log.err(error);
}
});
clientLoaded = true;
super.resize(graphics.getWidth(), graphics.getHeight());
app.post(() -> app.post(() -> app.post(() -> app.post(() -> {