Changed default RAM limit
This commit is contained in:
parent
8208434b8f
commit
ad736787e9
@ -19,40 +19,40 @@ import (
|
||||
)
|
||||
|
||||
type McVersionManifestEntry struct {
|
||||
Id string
|
||||
Type string
|
||||
Url string
|
||||
Time time.Time
|
||||
ReleaseTime time.Time
|
||||
Sha1 string
|
||||
Id string
|
||||
Type string
|
||||
Url string
|
||||
Time time.Time
|
||||
ReleaseTime time.Time
|
||||
Sha1 string
|
||||
ComplianceLevel int
|
||||
}
|
||||
|
||||
type McLatestEntry struct {
|
||||
Release string
|
||||
Release string
|
||||
Snapshot string
|
||||
}
|
||||
|
||||
type McVersionManifest struct {
|
||||
Latest McLatestEntry
|
||||
Latest McLatestEntry
|
||||
Versions []McVersionManifestEntry
|
||||
}
|
||||
|
||||
type McArguments struct {
|
||||
Game []string
|
||||
Jvm []string
|
||||
Jvm []string
|
||||
}
|
||||
|
||||
type McAssetIndex struct {
|
||||
Id string
|
||||
Sha1 string
|
||||
Size int
|
||||
Id string
|
||||
Sha1 string
|
||||
Size int
|
||||
TotalSize int
|
||||
Url string
|
||||
Url string
|
||||
}
|
||||
|
||||
type McJavaVersion struct {
|
||||
Component string
|
||||
Component string
|
||||
MajorVersion int
|
||||
}
|
||||
|
||||
@ -60,37 +60,37 @@ type McLibraryArtifact struct {
|
||||
Path string
|
||||
Sha1 string
|
||||
Size int
|
||||
Url string
|
||||
Url string
|
||||
}
|
||||
|
||||
type McLibraryDownload struct {
|
||||
Artifact McLibraryArtifact
|
||||
Artifact McLibraryArtifact
|
||||
Classifiers map[string]interface{}
|
||||
}
|
||||
|
||||
type McRuleOs struct {
|
||||
Name string
|
||||
Name string
|
||||
Version string
|
||||
ARch string
|
||||
ARch string
|
||||
}
|
||||
|
||||
type McRule struct {
|
||||
Action string
|
||||
Action string
|
||||
Features map[string]bool
|
||||
Os McRuleOs
|
||||
Os McRuleOs
|
||||
}
|
||||
|
||||
type McLibrary struct {
|
||||
Downloads McLibraryDownload
|
||||
Name string
|
||||
Rules []McRule
|
||||
Natives map[string]string
|
||||
Name string
|
||||
Rules []McRule
|
||||
Natives map[string]string
|
||||
}
|
||||
|
||||
type McDownload struct {
|
||||
Sha1 string
|
||||
Size int
|
||||
Url string
|
||||
Url string
|
||||
}
|
||||
|
||||
type McLogging struct {
|
||||
@ -99,25 +99,25 @@ type McLogging struct {
|
||||
|
||||
type McLoggingClient struct {
|
||||
Argument string
|
||||
File McDownload
|
||||
File McDownload
|
||||
}
|
||||
|
||||
type McMetadata struct {
|
||||
Arguments McArguments
|
||||
AssetIndex McAssetIndex
|
||||
Assets string
|
||||
ComplianceLevel int
|
||||
Downloads map[string]McDownload
|
||||
Id string
|
||||
JavaVersion McJavaVersion
|
||||
Libraries []McLibrary
|
||||
MainClass string
|
||||
Arguments McArguments
|
||||
AssetIndex McAssetIndex
|
||||
Assets string
|
||||
ComplianceLevel int
|
||||
Downloads map[string]McDownload
|
||||
Id string
|
||||
JavaVersion McJavaVersion
|
||||
Libraries []McLibrary
|
||||
MainClass string
|
||||
MinimumLauncherVersion int
|
||||
ReleaseTime time.Time
|
||||
Time time.Time
|
||||
Type string
|
||||
MinecraftArguments string
|
||||
Logging McLogging
|
||||
ReleaseTime time.Time
|
||||
Time time.Time
|
||||
Type string
|
||||
MinecraftArguments string
|
||||
Logging McLogging
|
||||
}
|
||||
|
||||
func GetVersionManifest() (McVersionManifest, error) {
|
||||
@ -191,7 +191,7 @@ func GetVersionMetadata(wantedVersion string) (McMetadata, error) {
|
||||
defer f.Close()
|
||||
if data, err := io.ReadAll(f); err == nil {
|
||||
sha := sha1.Sum(data)
|
||||
if hex.EncodeToString(sha[:20]) == version.Sha1{
|
||||
if hex.EncodeToString(sha[:20]) == version.Sha1 {
|
||||
metadata := McMetadata{}
|
||||
json.Unmarshal(data, &metadata)
|
||||
return metadata, nil
|
||||
@ -415,7 +415,7 @@ func DownloadLibraries(mcVersion string, libPath string, a App) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func InstallNatives(mcVersion string, nativesDir string){
|
||||
func InstallNatives(mcVersion string, nativesDir string) {
|
||||
metadata, _ := GetVersionMetadata(mcVersion)
|
||||
for _, lib := range metadata.Libraries {
|
||||
if lib.Natives != nil {
|
||||
@ -446,7 +446,7 @@ func InstallNatives(mcVersion string, nativesDir string){
|
||||
}
|
||||
}
|
||||
|
||||
func DownloadLoggingConfig(mcVersion string, gameDir string){
|
||||
func DownloadLoggingConfig(mcVersion string, gameDir string) {
|
||||
metadata, _ := GetVersionMetadata(mcVersion)
|
||||
resp, err := http.Get(metadata.Logging.Client.File.Url)
|
||||
if err != nil {
|
||||
@ -540,7 +540,7 @@ func GetBaseLaunchArgs(mcVersion string, instance Instance, libDir string, binDi
|
||||
args = append(args, loggingArg)
|
||||
}
|
||||
args = append(args, "-Xms512m")
|
||||
args = append(args, "-Xmx1024m")
|
||||
args = append(args, "-Xmx4096m")
|
||||
args = append(args, "-cp")
|
||||
arg := ""
|
||||
separater := ":"
|
||||
@ -556,8 +556,6 @@ func GetBaseLaunchArgs(mcVersion string, instance Instance, libDir string, binDi
|
||||
arg += filepath.Join(binDir, mcVersion, "client.jar")
|
||||
args = append(args, arg)
|
||||
|
||||
|
||||
|
||||
args = append(args, instance.MainClass)
|
||||
|
||||
for _, val := range searchArgs {
|
||||
@ -586,7 +584,6 @@ func GetBaseLaunchArgs(mcVersion string, instance Instance, libDir string, binDi
|
||||
return args, nil
|
||||
}
|
||||
|
||||
|
||||
func GetOfflineLaunchArgs(mcVersion string, instance Instance, libDir string, binDir string, assetDir string, gameDir string, playerName string) ([]string, error) {
|
||||
args, err := GetBaseLaunchArgs(mcVersion, instance, libDir, binDir, assetDir, gameDir)
|
||||
if err != nil {
|
||||
@ -594,7 +591,7 @@ func GetOfflineLaunchArgs(mcVersion string, instance Instance, libDir string, bi
|
||||
}
|
||||
|
||||
for ind, val := range args {
|
||||
switch val{
|
||||
switch val {
|
||||
case "${auth_player_name}":
|
||||
args[ind] = playerName
|
||||
case "${auth_uuid}":
|
||||
@ -617,7 +614,7 @@ func GetOnlineLaunchArgs(mcVersion string, instance Instance, libDir string, bin
|
||||
}
|
||||
|
||||
for ind, val := range args {
|
||||
switch val{
|
||||
switch val {
|
||||
case "${auth_player_name}":
|
||||
args[ind] = auth.Name
|
||||
case "${auth_uuid}":
|
||||
|
Loading…
Reference in New Issue
Block a user