Cross-modsystem compatibility fix with thanks to Mumfrey @ liteloader