@@ -213,19 +213,6 @@ public void onInitializeClient() {
213213 registerDefaultCommands (dispatcher , "cofl" );
214214 registerDefaultCommands (dispatcher , "cl" );
215215
216- // Add bazaarsearch as a subcommand to /cofl
217- dispatcher .register (
218- ClientCommandManager .literal ("cofl" )
219- .then (ClientCommandManager .literal ("bazaarsearch" )
220- .then (ClientCommandManager .argument ("item" , StringArgumentType .greedyString ())
221- .executes (context -> {
222- String searchTerm = context .getArgument ("item" , String .class );
223- searchInBazaarSmart (searchTerm );
224- return 1 ;
225- })
226- )
227- )
228- );
229216
230217
231218 dispatcher .register (ClientCommandManager .literal ("fc" )
@@ -604,6 +591,21 @@ public String getString() {
604591 }
605592 }
606593
594+ // Special internal-only commands
595+ if (args .length >= 1 && args [0 ].equalsIgnoreCase ("bazaarsearch" )) {
596+ if (args .length >= 2 ) {
597+ // Join remaining args as the search term
598+ String [] part = new String [args .length - 1 ];
599+ System .arraycopy (args , 1 , part , 0 , part .length );
600+ String searchTerm = String .join (" " , part );
601+ searchInBazaarSmart (searchTerm );
602+ return 1 ;
603+ } else {
604+ sendChatMessage ("§cUsage: /cofl bazaarsearch <item>" );
605+ return 1 ;
606+ }
607+ }
608+
607609 // Pass to CoflSkyCommand for other commands
608610 CoflSkyCommand .processCommand (args , username );
609611 return 1 ;
0 commit comments