@@ -25,7 +25,7 @@ struct CLI {
2525enum Commands {
2626 /// initial setup
2727 Setup {
28- /// software to use (paper/folia/purpur/velocity)
28+ /// software to use (paper/folia/purpur/velocity/gate/nukkit )
2929 #[ arg( short, long, value_enum) ]
3030 software : Option < Software > ,
3131
@@ -58,6 +58,7 @@ enum Software {
5858 Purpur ,
5959 Velocity ,
6060 Gate ,
61+ Nukkit ,
6162}
6263
6364#[ derive( Serialize , Deserialize ) ]
@@ -85,6 +86,7 @@ impl Software {
8586 "purpur" => Self :: Purpur ,
8687 "velocity" => Self :: Velocity ,
8788 "gate" => Self :: Gate ,
89+ "nukkit" => Self :: Nukkit ,
8890 _ => panic ! ( "Invalid software name: {}" , name) ,
8991 }
9092 }
@@ -96,6 +98,7 @@ impl Software {
9698 Self :: Purpur => "purpur" ,
9799 Self :: Velocity => "velocity" ,
98100 Self :: Gate => "gate" ,
101+ Self :: Nukkit => "nukkit" ,
99102 }
100103 . to_string ( )
101104 }
@@ -129,7 +132,7 @@ fn handle_setup(
129132 if software. is_none ( ) {
130133 let binding = Select :: new (
131134 "💽 Which server software are you using?" ,
132- vec ! [ "Paper" , "Folia" , "Purpur" , "Velocity" , "Gate" ] ,
135+ vec ! [ "Paper" , "Folia" , "Purpur" , "Velocity" , "Gate" , "Nukkit" ] ,
133136 )
134137 . prompt ( ) ;
135138
@@ -142,7 +145,7 @@ fn handle_setup(
142145 let version = {
143146 if software. name ( ) == "velocity" {
144147 "3.4.0-SNAPSHOT" . to_string ( )
145- } else if software. name ( ) == "gate" {
148+ } else if software. name ( ) == "gate" || software . name ( ) == "nukkit" {
146149 "ignore" . to_string ( )
147150 } else if mc_version. is_none ( ) {
148151 let binding = Text :: new ( "🪨 What version of Minecraft are you using?" )
@@ -156,7 +159,7 @@ fn handle_setup(
156159 } ;
157160
158161 let eula = {
159- if software. name ( ) == "velocity" || software. name ( ) == "gate" {
162+ if software. name ( ) == "velocity" || software. name ( ) == "gate" || software . name ( ) == "nukkit" {
160163 false
161164 } else if eula. is_none ( ) {
162165 let binding = Confirm :: new (
@@ -176,7 +179,7 @@ fn handle_setup(
176179 }
177180 } ;
178181
179- if software. name ( ) != "velocity" && software. name ( ) != "gate" {
182+ if software. name ( ) != "velocity" && software. name ( ) != "gate" && software . name ( ) != "nukkit" {
180183 println ! (
181184 "\n ✨ I will setup {}, with Minecraft server version {}, {} Mojang's EULA in this directory {}{}{}." ,
182185 software. name( ) . bold( ) . yellow( ) ,
@@ -247,7 +250,7 @@ fn handle_setup(
247250
248251 println ! ( ) ;
249252
250- if eula && software. name ( ) != "velocity" && software. name ( ) != "gate" {
253+ if eula && software. name ( ) != "velocity" && software. name ( ) != "gate" && software . name ( ) != "nukkit" {
251254 print ! ( "(1/3) Adding EULA... " ) ;
252255 match eula:: add_eula ( ) {
253256 Err ( e) => {
@@ -261,7 +264,7 @@ fn handle_setup(
261264 print ! (
262265 "{}Downloading {}... " ,
263266 {
264- if eula && software. name( ) != "velocity" && software. name( ) != "gate" {
267+ if eula && software. name( ) != "velocity" && software. name( ) != "gate" && software . name ( ) != "nukkit" {
265268 "(2/3) "
266269 } else {
267270 "(1/2) "
@@ -281,7 +284,7 @@ fn handle_setup(
281284 }
282285
283286 print ! ( "{}Saving configuration... " , {
284- if eula && software. name( ) != "velocity" && software. name( ) != "gate" {
287+ if eula && software. name( ) != "velocity" && software. name( ) != "gate" && software . name ( ) != "nukkit" {
285288 "(3/3) "
286289 } else {
287290 "(2/2) "
@@ -304,7 +307,7 @@ fn handle_setup(
304307 }
305308
306309 println ! ( "\n {}" , "Summary" . bold( ) . underline( ) ) ;
307- if eula && software. name ( ) != "velocity" && software. name ( ) != "gate" {
310+ if eula && software. name ( ) != "velocity" && software. name ( ) != "gate" && software . name ( ) != "nukkit" {
308311 println ! ( " {} eula.txt" , "+" . green( ) . bold( ) ) ;
309312 }
310313
@@ -340,7 +343,7 @@ fn handle_setup(
340343fn handle_update ( ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
341344 let config = Config :: load ( ) ?;
342345
343- if config. software . name ( ) . to_lowercase ( ) == "gate" {
346+ if config. software . name ( ) . to_lowercase ( ) == "gate" || config . software . name ( ) . to_lowercase ( ) == "nukkit" {
344347 println ! (
345348 "🔄 Updating {} to latest build..." ,
346349 config. software. name( ) . bold( ) . yellow( )
@@ -397,9 +400,9 @@ fn handle_upgrade(target_version: Option<String>) -> Result<(), Box<dyn std::err
397400
398401 let target_version = {
399402 if target_version. is_none ( ) {
400- if config. software . name ( ) == "velocity" || config. software . name ( ) == "gate" {
401- eprintln ! ( "❌ Velocity / Gate upgrades are currently unsupported." ) ;
402- return Err ( "Velocity / Gate upgrades are not supported" . into ( ) ) ;
403+ if config. software . name ( ) == "velocity" || config. software . name ( ) == "gate" || config . software . name ( ) == "nukkit" {
404+ eprintln ! ( "❌ Velocity / Gate / Nukkit upgrades are currently unsupported." ) ;
405+ return Err ( "Velocity / Gate / Nukkit upgrades are not supported" . into ( ) ) ;
403406 } else {
404407 let binding =
405408 Text :: new ( "🚀 What version of Minecraft would you like to upgrade to?" )
0 commit comments