mirror of
https://github.com/artegoser/pimi-launcher-core.git
synced 2024-12-23 02:13:46 +03:00
Merge pull request #111 from HerozDotExe/fix-no-artifact
Fix no artifact property when downloading a library
This commit is contained in:
commit
c09838d500
3 changed files with 8 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
|||
##### This project is complete for now.
|
||||
[![Build Status](https://travis-ci.com/Pierce01/MinecraftLauncher-core.svg?branch=master)](https://travis-ci.com/Pierce01/MinecraftLauncher-core)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
||||
![version](https://img.shields.io/badge/stable_version-3.17.0-blue)
|
||||
![version](https://img.shields.io/badge/stable_version-3.17.1-blue)
|
||||
![badge](https://img.shields.io/badge/ncurses-not_supported-purple)
|
||||
|
||||
MCLC (Minecraft Launcher Core) is a NodeJS solution for launching modded and vanilla Minecraft without having to download and format everything yourself.
|
||||
|
|
|
@ -509,8 +509,7 @@ class Handler {
|
|||
jarPath = path.join(directory, `${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}`)
|
||||
}
|
||||
|
||||
if (!fs.existsSync(path.join(jarPath, name)) || !this.checkSum(library.downloads.artifact.sha1, path.join(jarPath, name))) {
|
||||
// Simple lib support, forgot which addon needed this but here you go, Mr special.
|
||||
const downloadLibrary = async library => {
|
||||
if (library.url) {
|
||||
const url = `${library.url}${lib[0].replace(/\./g, '/')}/${lib[1]}/${lib[2]}/${name}`
|
||||
await this.downloadAsync(url, jarPath, name, true, eventName)
|
||||
|
@ -519,6 +518,11 @@ class Handler {
|
|||
}
|
||||
}
|
||||
|
||||
if (!fs.existsSync(path.join(jarPath, name))) downloadLibrary(library)
|
||||
else if (library.downloads && library.downloads.artifact) {
|
||||
if (!this.checkSum(library.downloads.artifact.sha1, path.join(jarPath, name))) downloadLibrary(library)
|
||||
}
|
||||
|
||||
counter++
|
||||
this.client.emit('progress', {
|
||||
type: eventName,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "minecraft-launcher-core",
|
||||
"version": "3.17.0",
|
||||
"version": "3.17.1",
|
||||
"description": "Lightweight module that downloads and runs Minecraft using javascript / NodeJS",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
|
|
Loading…
Add table
Reference in a new issue