Support vanilla profile launches
Some checks failed
Build / release (macos-latest) (push) Has been cancelled
Build / release (ubuntu-latest) (push) Has been cancelled
Build / release (windows-latest) (push) Has been cancelled
Windows Smoke Test / windows-smoke (push) Has been cancelled

This commit is contained in:
2026-05-06 05:11:36 +09:00
parent 316ce0e0dc
commit 555a5ea099
3 changed files with 103 additions and 54 deletions

View File

@@ -0,0 +1,23 @@
const { DistributionIndexProcessor } = require('helios-core/dl')
const { Type } = require('helios-distribution-types')
if(!DistributionIndexProcessor.prototype.__mrsVanillaPatchApplied){
const originalLoadModLoaderVersionJson = DistributionIndexProcessor.prototype.loadModLoaderVersionJson
DistributionIndexProcessor.prototype.loadModLoaderVersionJson = async function(...args){
const server = this.distribution?.getServerById?.(this.serverId)
const hasModLoader = server?.modules?.some(({ rawModule }) => {
return rawModule?.type === Type.ForgeHosted
|| rawModule?.type === Type.Forge
|| rawModule?.type === Type.Fabric
}) === true
if(!hasModLoader){
return null
}
return originalLoadModLoaderVersionJson.apply(this, args)
}
DistributionIndexProcessor.prototype.__mrsVanillaPatchApplied = true
}