Documentation ¶
Index ¶
- type Launcher
- func (l *Launcher) ApplyOverWrites(o *OverwriteFlags)
- func (c *Launcher) HandleCrash() error
- func (l *Launcher) Java(ctx context.Context) (*java.Java, error)
- func (l *Launcher) Prepare() error
- func (l *Launcher) PrepareDependencies(ctx context.Context, force bool) error
- func (l *Launcher) PrepareJavaBg(ctx context.Context) chan error
- func (l *Launcher) PrepareMinecraft(ctx context.Context) error
- func (l Launcher) PrepareRequirements() (bool, error)
- func (c *Launcher) Run(opts *instances.LaunchOptions) error
- type MaybeSpinner
- type OverwriteFlags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Launcher ¶
type Launcher struct { // Instance is the minepkg instance to be launched Instance *instances.Instance // Patches is a list of patches to apply to the instance Patches []*patch.Patch // MinepkgVersion is the version number of minepkg MinepkgVersion string Cmd *exec.Cmd // ServerMode indicated if this instance should be started as a server ServerMode bool // OfflineMode indicates if this server should be started in offline mode OfflineMode bool // ForceUpdate will force a full dependency resolve if set to true ForceUpdate bool // LaunchManifest is a minecraft launcher manifest. it should be set after // calling `Prepare` LaunchManifest *minecraft.LaunchManifest // NonInteractive determines if fancy spinners or prompts should be displayed NonInteractive bool // UseSystemJava sets the instance to use the system java // instead of the internal installation. This skips downloading java UseSystemJava bool // JavaVersion is the version to use JavaVersion string // contains filtered or unexported fields }
Launcher can launch minepkg instances with CLI output
func (*Launcher) ApplyOverWrites ¶
func (l *Launcher) ApplyOverWrites(o *OverwriteFlags)
func (*Launcher) HandleCrash ¶
HandleCrash handles a crash by submitting it to minepkg.io and outputting some debug info
func (*Launcher) Prepare ¶
Prepare ensures all requirements are met to launch the instance in the current directory
func (*Launcher) PrepareDependencies ¶ added in v0.1.8
PrepareDependencies downloads missing dependencies if needed passing true as the second parameter will make sure to check for available updates
func (*Launcher) PrepareJavaBg ¶ added in v0.1.8
prepareJava downloads java if needed and returns an error channel
func (*Launcher) PrepareMinecraft ¶ added in v0.1.8
func (Launcher) PrepareRequirements ¶ added in v0.1.8
PrepareRequirements will update the requirements section in the lockfile if needed
type MaybeSpinner ¶
MaybeSpinner is a spinner that can also just log text
func NewMaybeSpinner ¶
func NewMaybeSpinner(spin bool) *MaybeSpinner
NewMaybeSpinner will return a new MaybeSpinner
func (*MaybeSpinner) Update ¶
func (m *MaybeSpinner) Update(t string)
Update will update the spinner text
type OverwriteFlags ¶
type OverwriteFlags struct { McVersion string FabricVersion string ForgeVersion string MinepkgCompanion string Java string Ram int }
OverwriteFlags are cli flags used to overwrite launch behavior
func CmdOverwriteFlags ¶
func CmdOverwriteFlags(cmd *cobra.Command) *OverwriteFlags