File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -103,4 +103,15 @@ const proc = launch({
103
103
});
104
104
```
105
105
106
- ** Note:** When both ` quickPlayMultiplayer ` and ` server ` options are provided, ` quickPlayMultiplayer ` takes precedence.
106
+ Both ` quickPlayMultiplayer ` and ` server ` options can be used together for compatibility:
107
+
108
+ ``` ts
109
+ // Both options together for compatibility
110
+ const proc = launch ({
111
+ gamePath ,
112
+ javaPath ,
113
+ version ,
114
+ quickPlayMultiplayer: ' play.hypixel.net:25565' ,
115
+ server: { ip: ' play.hypixel.net' , port: 25565 }
116
+ });
117
+ ```
Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ describe('Launcher', () => {
290
290
expect ( args . indexOf ( '--server' ) ) . toBe ( - 1 )
291
291
expect ( args . indexOf ( '--port' ) ) . toBe ( - 1 )
292
292
} )
293
- test ( 'should prefer quickPlayMultiplayer over server option ' , async ( { mock } ) => {
293
+ test ( 'should allow both quickPlayMultiplayer and server options for compatibility ' , async ( { mock } ) => {
294
294
const server = {
295
295
ip : '192.168.1.1' ,
296
296
port : 25565 ,
@@ -303,9 +303,9 @@ describe('Launcher', () => {
303
303
quickPlayMultiplayer : '127.0.0.1:25565' ,
304
304
} )
305
305
expect ( args [ args . indexOf ( '--quickPlayMultiplayer' ) + 1 ] ) . toEqual ( '127.0.0.1:25565' )
306
- // Should not contain old server arguments when quickPlayMultiplayer is present
307
- expect ( args . indexOf ( '--server' ) ) . toBe ( - 1 )
308
- expect ( args . indexOf ( '--port' ) ) . toBe ( - 1 )
306
+ // Should also contain legacy server arguments for compatibility
307
+ expect ( args [ args . indexOf ( '--server' ) + 1 ] ) . toEqual ( '192.168.1.1' )
308
+ expect ( args [ args . indexOf ( '--port' ) + 1 ] ) . toEqual ( '25565' )
309
309
} )
310
310
} )
311
311
Original file line number Diff line number Diff line change @@ -812,7 +812,8 @@ export async function generateArguments(options: LaunchOption) {
812
812
}
813
813
if ( options . quickPlayMultiplayer ) {
814
814
cmd . push ( '--quickPlayMultiplayer' , options . quickPlayMultiplayer )
815
- } else if ( options . server ) {
815
+ }
816
+ if ( options . server ) {
816
817
cmd . push ( '--server' , options . server . ip )
817
818
if ( options . server . port ) {
818
819
cmd . push ( '--port' , options . server . port . toString ( ) )
You can’t perform that action at this time.
0 commit comments