mcservice

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: GPL-3.0, LGPL-3.0 Imports: 44 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 CancelMsixvcDownloadTask added in v0.1.7

func CancelMsixvcDownloadTask(dest string)

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 FetchLeviLaminaVersionDB added in v0.1.6

func FetchLeviLaminaVersionDB() (map[string][]string, error)

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 GetEnableBetaUpdates added in v0.2.0

func GetEnableBetaUpdates() bool

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 InstallLeviLamina added in v0.1.6

func InstallLeviLamina(ctx context.Context, mcVersion string, targetName string) string

func IsProcessRunningAtPath

func IsProcessRunningAtPath(exePath string) bool

func KillAllMinecraftProcesses added in v0.1.6

func KillAllMinecraftProcesses() error

func KillProcess added in v0.1.6

func KillProcess(pid int) error

func ListDir

func ListDir(path string) []types.FileEntry

func ListDrives

func ListDrives() []string

func ListInheritableVersionNames

func ListInheritableVersionNames(versionType string) []string

func ListMinecraftProcesses added in v0.1.6

func ListMinecraftProcesses() []types.ProcessInfo

func ListServers added in v0.1.6

func ListServers(versionName string, player string) ([]types.Server, error)

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, enableCtrlRReloadResources bool, launchArgs string, envVars string) string

func SetBaseRoot

func SetBaseRoot(root string) string

func SetDisableDiscordRPC added in v0.0.24

func SetDisableDiscordRPC(disable bool) string

func SetEnableBetaUpdates added in v0.2.0

func SetEnableBetaUpdates(enable bool) string

func SetWorldLevelName

func SetWorldLevelName(worldDir string, name string) string

func StartMsixvcDownload

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

func TestMirrorLatencies

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

func UninstallLeviLamina added in v0.1.6

func UninstallLeviLamina(ctx context.Context, targetName string) string

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 LeviLaminaVersionDB added in v0.1.6

type LeviLaminaVersionDB struct {
	FormatVersion int                 `json:"format_version"`
	Versions      map[string][]string `json:"versions"`
}

type MotdBEInfo added in v0.1.6

type MotdBEInfo struct {
	Status         string `json:"status"`           // online/offline
	Host           string `json:"host"`             // Server Host
	Motd           string `json:"motd"`             // Motd message
	Agreement      int    `json:"agreement"`        // Protocol version
	Version        string `json:"version"`          // Game version
	Online         int    `json:"online"`           // Online players
	Max            int    `json:"max"`              // Max players
	LevelName      string `json:"level_name"`       // Level name
	GameMode       string `json:"gamemode"`         // Game mode
	ServerUniqueID string `json:"server_unique_id"` // Server Unique ID
	Delay          int64  `json:"delay"`            // Latency in ms
}

MotdBEInfo represents the server status information

func MotdBE added in v0.1.6

func MotdBE(Host string) (*MotdBEInfo, error)

type SunTimes added in v0.3.0

type SunTimes struct {
	Sunrise string `json:"sunrise"`
	Sunset  string `json:"sunset"`
	IP      string `json:"ip"`
}

func GetSunTimes added in v0.3.0

func GetSunTimes() SunTimes

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