Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Jul 17, 2025

This PR enables both quickPlayMultiplayer and server/port options to be used simultaneously for compatibility, addressing the limitation introduced in PR #321.

Problem

PR #321 added support for the newer --quickPlayMultiplayer option but implemented it with exclusive logic that prevented it from being used alongside the legacy --server/--port options:

if (options.quickPlayMultiplayer) {
  cmd.push('--quickPlayMultiplayer', options.quickPlayMultiplayer)
} else if (options.server) {  // <- This 'else if' prevents both from working together
  cmd.push('--server', options.server.ip)
  // ...
}

Solution

Changed the exclusive else if to separate if statements, allowing both options to be processed independently:

if (options.quickPlayMultiplayer) {
  cmd.push('--quickPlayMultiplayer', options.quickPlayMultiplayer)
}
if (options.server) {  // <- Now both can be included
  cmd.push('--server', options.server.ip)
  // ...
}

Changes

  • Modified launch.ts: Removed else from server option logic to allow both options simultaneously
  • Updated test case: Changed from testing precedence to testing compatibility
  • Updated documentation: Added example showing both options can be used together

Usage Example

// Both options can now be used together for compatibility
await launch({
  version: '1.20.1',
  gamePath: '/path/to/.minecraft',
  javaPath: '/path/to/java',
  quickPlayMultiplayer: 'play.hypixel.net:25565',
  server: { ip: 'play.hypixel.net', port: 25565 }
})

This generates command line arguments containing both:

--quickPlayMultiplayer play.hypixel.net:25565 --server play.hypixel.net --port 25565

Backward Compatibility

✅ Fully backward compatible - existing code using either option alone continues to work unchanged.

Fixes #323.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] quickPlayMultiplayer compatibility Allow quickPlayMultiplayer and server options to work together for compatibility Jul 17, 2025
@Copilot Copilot AI requested a review from ci010 July 17, 2025 08:36
Copilot finished work on behalf of ci010 July 17, 2025 08:36
@ci010 ci010 marked this pull request as ready for review July 17, 2025 09:32
@ci010 ci010 merged commit f1cb1d5 into master Jul 17, 2025
1 check failed
@ci010 ci010 deleted the copilot/fix-323 branch July 17, 2025 09:38
@github-actions github-actions bot mentioned this pull request Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

quickPlayMultiplayer compatibility
2 participants