Skip to content

Commit 04832c5

Browse files
committed
z
1 parent f57808e commit 04832c5

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

pkg/mrpack.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type ModrinthIndex struct {
2727
} `json:"dependencies"`
2828
}
2929

30-
func Modrinth(file string, MaxConnections int, Argsment string) {
30+
func Modrinth(file string, MaxCon int, Args string) {
3131
if strings.HasSuffix(file, ".mrpack") {
3232
zipFile, err := zip.OpenReader(file)
3333
if err != nil {
@@ -101,8 +101,8 @@ func Modrinth(file string, MaxConnections int, Argsment string) {
101101
instConfig := core.InstConfig{
102102
Version: modrinthIndex.Dependencies.Minecraft,
103103
Download: "bmclapi",
104-
MaxConnections: MaxConnections,
105-
Argsment: Argsment,
104+
MaxConnections: 32,
105+
Argsment: "-Xmx{maxmen}M -Xms{maxmen}M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true",
106106
}
107107

108108
if modrinthIndex.Dependencies.NeoForge != "" {

pkg/spc.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"github.com/autoinst/AutoInstall/core"
1414
)
1515

16-
func SPCInstall(file string, MaxConnections int, Argsment string) {
16+
func SPCInstall(file string, MaxCon int, Args string) {
1717
if strings.HasSuffix(file, ".zip") {
1818
zipFile, err := zip.OpenReader(file)
1919
if err != nil {
@@ -63,8 +63,8 @@ func SPCInstall(file string, MaxConnections int, Argsment string) {
6363
Loader: strings.ToLower(strings.ToLower(vars["MODLOADER"])),
6464
LoaderVersion: vars["MODLOADER_VERSION"],
6565
Download: "bmclapi",
66-
MaxConnections: MaxConnections,
67-
Argsment: Argsment,
66+
MaxConnections: 32,
67+
Argsment: "-Xmx{maxmen}M -Xms{maxmen}M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled -XX:+PerfDisableSharedMem -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1HeapRegionSize=8M -XX:G1HeapWastePercent=5 -XX:G1MaxNewSizePercent=40 -XX:G1MixedGCCountTarget=4 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1NewSizePercent=30 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:G1ReservePercent=20 -XX:InitiatingHeapOccupancyPercent=15 -XX:MaxGCPauseMillis=200 -XX:MaxTenuringThreshold=1 -XX:SurvivorRatio=32 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true",
6868
}
6969
jsonData, err := json.MarshalIndent(instConfig, "", " ")
7070
if err != nil {
@@ -78,7 +78,6 @@ func SPCInstall(file string, MaxConnections int, Argsment string) {
7878
}
7979
}
8080

81-
// readVariables 读取 variables.txt 文件并解析为 map
8281
func readVariables(filePath string) (map[string]string, error) {
8382
file, err := os.Open(filePath)
8483
if err != nil {

0 commit comments

Comments
 (0)