diff --git a/cmd/mccl/commands/run_command.go b/cmd/mccl/commands/run_command.go index af9aff8..150fbbd 100755 --- a/cmd/mccl/commands/run_command.go +++ b/cmd/mccl/commands/run_command.go @@ -31,9 +31,11 @@ func (rc *RunCommand) Run() error { if rc.Id == "" { return errors.New("an empty Minecraft version was provided") } + if err := os.Chdir(rc.GameDir); err != nil { return err } + if rc.UseProfile { if util.IsFileExist(path.Join(rc.GameDir, mcclprofile.ProfileFileName)) { p, err := mcclprofile.Load(rc.GameDir) @@ -53,6 +55,7 @@ func (rc *RunCommand) Run() error { } } } + return rc.run_client() } @@ -156,6 +159,7 @@ func (rc *RunCommand) run_client() error { fmt.Printf("Minecraft version %s is started with username %s and player's UUID %s.\n", manifst.Id, rc.Username, rc.AuthUuid) + if err := cmd.Run(); err != nil && (err.Error() != "exec: already started") { return err }