24 lines
922 B
JavaScript
24 lines
922 B
JavaScript
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
|
|
}
|