mcservice

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventExtractError    = "extract.error"
	EventExtractDone     = "extract.done"
	EventExtractProgress = "extract.progress"
)

Variables

This section is empty.

Functions

func BackupWorld

func BackupWorld(worldDir string) string

func BackupWorldWithVersion

func BackupWorldWithVersion(worldDir string, versionName string) string

func CanWriteToDir

func CanWriteToDir(path string) bool

func CancelMsixvcDownload

func CancelMsixvcDownload()

func CopyVersionDataFromGDK

func CopyVersionDataFromGDK(isPreview bool, targetName string) string

func CopyVersionDataFromVersion

func CopyVersionDataFromVersion(sourceName string, targetName string) string

func CreateDesktopShortcut

func CreateDesktopShortcut(name string) string

func CreateFolder

func CreateFolder(parent string, name string) string

func DeleteDownloadedMsixvc

func DeleteDownloadedMsixvc(version string, versionType string) string

func DeleteVersionFolder

func DeleteVersionFolder(name string) string

func FetchHistoricalVersions

func FetchHistoricalVersions(preferCN bool) map[string]interface{}

func GetBaseRoot

func GetBaseRoot() string

func GetContentRoots

func GetContentRoots(name string) types.ContentRoots

func GetDisableDiscordRPC added in v0.0.24

func GetDisableDiscordRPC() bool

func GetDriveStats

func GetDriveStats(root string) map[string]uint64

func GetInstallerDir

func GetInstallerDir() string

func GetPathModTime

func GetPathModTime(path string) int64

func GetPathSize

func GetPathSize(path string) int64

func GetVersionLogoDataUrl

func GetVersionLogoDataUrl(name string) string

func GetVersionMeta added in v0.0.20

func GetVersionMeta(name string) versions.VersionMeta

func GetVersionsDir

func GetVersionsDir() string

func GetWorldIconDataUrl

func GetWorldIconDataUrl(worldDir string) string

func GetWorldLevelName

func GetWorldLevelName(worldDir string) string

func ImportMcworld

func ImportMcworld(name string, player string, fileName string, data []byte, overwrite bool) string

func InstallExtractMsixvc

func InstallExtractMsixvc(ctx context.Context, name string, folderName string, isPreview bool) string

func IsProcessRunningAtPath

func IsProcessRunningAtPath(exePath string) bool

func ListDir

func ListDir(path string) []types.FileEntry

func ListDrives

func ListDrives() []string

func ListInheritableVersionNames

func ListInheritableVersionNames(versionType string) []string

func ListVersionMetas

func ListVersionMetas() []versions.VersionMeta

func OpenGameDataExplorer

func OpenGameDataExplorer(isPreview bool)

func OpenModsExplorer

func OpenModsExplorer(name string)

func OpenPathDir

func OpenPathDir(dir string)

func OpenWorldsExplorer

func OpenWorldsExplorer(name string, isPreview bool)

func ReadWorldLevelDatFields

func ReadWorldLevelDatFields(worldDir string) map[string]any

func ReadWorldLevelDatFieldsAt

func ReadWorldLevelDatFieldsAt(worldDir string, path []string) map[string]any

func ReconcileRegisteredFlags added in v0.0.20

func ReconcileRegisteredFlags()
func RemoveVersionLogo(name string) string

func RenameVersionFolder

func RenameVersionFolder(oldName string, newName string) string

func ResetBaseRoot

func ResetBaseRoot() string

func ResolveDownloadedMsixvc

func ResolveDownloadedMsixvc(version string, versionType string) string

func ResumeMsixvcDownload

func ResumeMsixvcDownload()

func SaveVersionLogoDataUrl

func SaveVersionLogoDataUrl(name string, dataUrl string) string

func SaveVersionLogoFromPath

func SaveVersionLogoFromPath(name string, filePath string) string

func SaveVersionMeta

func SaveVersionMeta(name string, gameVersion string, typeStr string, enableIsolation bool, enableConsole bool, enableEditorMode bool, enableRenderDragon bool) string

func SetBaseRoot

func SetBaseRoot(root string) string

func SetDisableDiscordRPC added in v0.0.24

func SetDisableDiscordRPC(disable bool) string

func SetWorldLevelName

func SetWorldLevelName(worldDir string, name string) string

func StartMsixvcDownload

func StartMsixvcDownload(ctx context.Context, url string) string

func TestMirrorLatencies

func TestMirrorLatencies(urls []string, timeoutMs int) []map[string]interface{}

func ValidateVersionFolderName

func ValidateVersionFolderName(name string) string

func WriteWorldLevelDatFields

func WriteWorldLevelDatFields(worldDir string, args map[string]any) string

func WriteWorldLevelDatFieldsAt

func WriteWorldLevelDatFieldsAt(worldDir string, args map[string]any) string

Types

type ContentCounts

type ContentCounts struct {
	Worlds        int `json:"worlds"`
	ResourcePacks int `json:"resourcePacks"`
	BehaviorPacks int `json:"behaviorPacks"`
}

func GetContentCounts

func GetContentCounts(name string) ContentCounts

type KnownFolder

type KnownFolder struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

func ListKnownFolders

func ListKnownFolders() []KnownFolder

type VersionStatus

type VersionStatus struct {
	Version      string `json:"version"`
	IsInstalled  bool   `json:"isInstalled"`
	IsDownloaded bool   `json:"isDownloaded"`
	Type         string `json:"type"`
}

func GetAllVersionsStatus

func GetAllVersionsStatus(versionsList []map[string]interface{}) []VersionStatus

func GetVersionStatus

func GetVersionStatus(version string, versionType string) VersionStatus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL