Support vanilla profile launches
This commit is contained in:
23
app/assets/js/vanillapatch.js
Normal file
23
app/assets/js/vanillapatch.js
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user