minecraft-datapack-language 15.4.13__py3-none-any.whl → 15.4.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  """
2
2
  CLI Help System - Comprehensive help documentation for MDL CLI
3
3
  """
4
-
4
+ from .cli_colors import color, print_header, print_title, print_section, print_separator, print_info, print_bullet, print_code
5
5
 
6
6
  def show_main_help():
7
7
  """Display the main help message for the MDL CLI."""
@@ -10,906 +10,473 @@ def show_main_help():
10
10
  version = __version__
11
11
  except ImportError:
12
12
  version = "unknown"
13
-
14
- try:
15
- from .cli_colors import color, print_header, print_title, print_section, print_separator, print_info, print_bullet, print_code
16
-
17
- # Header
18
- print()
19
- print_header(f"MDL (Minecraft Datapack Language) CLI - v{version}")
20
- print_separator("=", 70)
21
- print()
22
-
23
- # Description
24
- print(color.info("MDL is a simplified language for creating Minecraft datapacks with variables,"))
25
- print(color.info("control structures, and easy syntax. This CLI tool compiles MDL files into"))
26
- print(color.info("standard Minecraft datapacks."))
27
- print()
28
-
29
- # Available Commands
30
- print_section("Available Commands")
31
- print()
32
- print(f" {color.command('build')} - Compile MDL files into a Minecraft datapack")
33
- print(f" {color.command('check')} - Validate MDL files for syntax and semantic errors")
34
- print(f" {color.command('new')} - Create a new MDL project with template files")
35
- print()
36
-
37
- # Detailed Help
38
- print_section("Detailed Help")
39
- print()
40
- print(color.info("For detailed information about any command, use:"))
41
- print(f" {color.code('mdl <command> --help')}")
42
- print()
43
- print(color.info("Examples:"))
44
- print(f" {color.code('mdl build --help')} - Show build command options")
45
- print(f" {color.code('mdl check --help')} - Show check command options")
46
- print(f" {color.code('mdl new --help')} - Show new project options")
47
- print()
48
-
49
- # Quick Start
50
- print_section("Quick Start")
51
- print()
52
- print(f"1. Create a new project:")
53
- print(f" {color.code('mdl new my_project')}")
54
- print()
55
- print(f"2. Build your datapack:")
56
- print(f" {color.code('mdl build --mdl my_project.mdl -o dist')}")
57
- print()
58
- print(f"3. Check for errors:")
59
- print(f" {color.code('mdl check my_project.mdl')}")
60
- print()
61
-
62
- # Documentation
63
- print_section("Documentation")
64
- print()
65
- print_bullet(f"Language Reference: {color.file_path('https://www.mcmdl.com/docs/language-reference')}")
66
- print_bullet(f"CLI Reference: {color.file_path('https://www.mcmdl.com/docs/cli-reference')}")
67
- print_bullet(f"Examples: {color.file_path('https://www.mcmdl.com/docs/examples')}")
68
- print()
69
-
70
- # Error Reporting
71
- print_section("Error Reporting")
72
- print()
73
- print(color.info("MDL provides detailed error messages with:"))
74
- print_bullet("Exact file location (line, column)")
75
- print_bullet("Context lines showing the problematic code")
76
- print_bullet("Helpful suggestions for fixing issues")
77
- print_bullet("Multiple error collection and reporting")
78
- print()
79
-
80
- # Support
81
- print(color.info(f"For support and bug reports, visit: {color.file_path('https://github.com/aaron777collins/MinecraftDatapackLanguage')}"))
82
- print()
83
-
84
- except ImportError:
85
- # Fallback if colors aren't available
86
- print(f"""
87
- [GAME] MDL (Minecraft Datapack Language) CLI - v{version}
88
- ====================================================
89
-
90
- MDL is a simplified language for creating Minecraft datapacks with variables,
91
- control structures, and easy syntax. This CLI tool compiles MDL files into
92
- standard Minecraft datapacks.
93
-
94
- [CMD] Available Commands:
95
- =====================
96
-
97
- [BUILD] build - Compile MDL files into a Minecraft datapack
98
- [CHECK] check - Validate MDL files for syntax and semantic errors
99
- [NEW] new - Create a new MDL project with template files
100
-
101
- [DOC] Detailed Help:
102
- ================
103
-
104
- For detailed information about any command, use:
105
- mdl <command> --help
106
-
107
- Examples:
108
- mdl build --help - Show build command options
109
- mdl check --help - Show check command options
110
- mdl new --help - Show new project options
111
-
112
- [NEXT] Quick Start:
113
- ==============
114
-
115
- 1. Create a new project:
116
- mdl new my_project
117
-
118
- 2. Build your datapack:
119
- mdl build --mdl my_project.mdl -o dist
120
-
121
- 3. Check for errors:
122
- mdl check my_project.mdl
123
-
124
- [INFO] Documentation:
125
- ================
126
-
127
- • Language Reference: https://www.mcmdl.com/docs/language-reference
128
- • CLI Reference: https://www.mcmdl.com/docs/cli-reference
129
- • Examples: https://www.mcmdl.com/docs/examples
130
-
131
- 🐛 Error Reporting:
132
- ==================
133
-
134
- MDL provides detailed error messages with:
135
- • Exact file location (line, column)
136
- • Context lines showing the problematic code
137
- • Helpful suggestions for fixing issues
138
- • Multiple error collection and reporting
139
-
140
- For support and bug reports, visit: https://github.com/aaron777collins/MinecraftDatapackLanguage
141
- """)
142
13
 
14
+ # Header
15
+ print()
16
+ print_header(f"MDL (Minecraft Datapack Language) CLI - v{version}")
17
+ print_separator("=", 70)
18
+ print()
19
+
20
+ # Description
21
+ print(color.info("MDL is a simplified language for creating Minecraft datapacks with variables,"))
22
+ print(color.info("control structures, and easy syntax. This CLI tool compiles MDL files into"))
23
+ print(color.info("standard Minecraft datapacks."))
24
+ print()
25
+
26
+ # Available Commands
27
+ print_section("Available Commands")
28
+ print()
29
+ print(f" {color.command('build')} - Compile MDL files into a Minecraft datapack")
30
+ print(f" {color.command('check')} - Validate MDL files for syntax and semantic errors")
31
+ print(f" {color.command('new')} - Create a new MDL project with template files")
32
+ print()
33
+
34
+ # Detailed Help
35
+ print_section("Detailed Help")
36
+ print()
37
+ print(color.info("For detailed information about any command, use:"))
38
+ print(f" {color.code('mdl <command> --help')}")
39
+ print()
40
+ print(color.info("Examples:"))
41
+ print(f" {color.code('mdl build --help')} - Show build command options")
42
+ print(f" {color.code('mdl check --help')} - Show check command options")
43
+ print(f" {color.code('mdl new --help')} - Show new project options")
44
+ print()
45
+
46
+ # Quick Start
47
+ print_section("Quick Start")
48
+ print()
49
+ print(f"1. Create a new project:")
50
+ print(f" {color.code('mdl new my_project')}")
51
+ print()
52
+ print(f"2. Build your datapack:")
53
+ print(f" {color.code('mdl build --mdl my_project.mdl -o dist')}")
54
+ print()
55
+ print(f"3. Check for errors:")
56
+ print(f" {color.code('mdl check my_project.mdl')}")
57
+ print()
58
+
59
+ # Documentation
60
+ print_section("Documentation")
61
+ print()
62
+ print_bullet(f"Language Reference: {color.file_path('https://www.mcmdl.com/docs/language-reference')}")
63
+ print_bullet(f"CLI Reference: {color.file_path('https://www.mcmdl.com/docs/cli-reference')}")
64
+ print_bullet(f"Examples: {color.file_path('https://www.mcmdl.com/docs/examples')}")
65
+ print()
66
+
67
+ # Error Reporting
68
+ print_section("Error Reporting")
69
+ print()
70
+ print(color.info("MDL provides detailed error messages with:"))
71
+ print_bullet("Exact file location (line, column)")
72
+ print_bullet("Context lines showing the problematic code")
73
+ print_bullet("Helpful suggestions for fixing issues")
74
+ print_bullet("Multiple error collection and reporting")
75
+ print()
76
+
77
+ # Support
78
+ print(color.info(f"For support and bug reports, visit: {color.file_path('https://github.com/aaron777collins/MinecraftDatapackLanguage')}"))
79
+ print()
143
80
 
144
81
  def show_build_help():
145
82
  """Display detailed help for the build command."""
146
- try:
147
- from .cli_colors import color, print_header, print_title, print_section, print_separator, print_info, print_bullet, print_code
148
-
149
- # Header
150
- print()
151
- print_header("MDL Build Command - Compile MDL Files to Minecraft Datapacks")
152
- print_separator("=", 75)
153
- print()
154
-
155
- # Description
156
- print(color.info("The build command compiles MDL files into standard Minecraft datapacks that can"))
157
- print(color.info("be loaded directly into Minecraft."))
158
- print()
159
-
160
- # Usage
161
- print_section("Usage")
162
- print()
163
- print(f" {color.code('mdl build --mdl <input> -o <output> [options]')}")
164
- print()
165
-
166
- # Arguments
167
- print_section("Arguments")
168
- print()
169
- print(f" {color.command('--mdl, -m')} {color.highlight('<input>')} Input MDL file or directory containing .mdl files")
170
- print(f" Examples: {color.code('--mdl project.mdl')}, {color.code('--mdl src/')}, {color.code('--mdl .')}")
171
- print()
172
- print(f" {color.command('-o, --output')} {color.highlight('<output>')} Output directory for the generated datapack")
173
- print(f" Example: {color.code('-o dist')}, {color.code('-o build/my_pack')}")
174
- print()
175
-
176
- # Options
177
- print_section("Options")
178
- print()
179
- print(f" {color.command('--verbose, -v')} Enable verbose output with detailed build information")
180
- print(f" Shows file parsing, function generation, and progress")
181
- print()
182
- print(f" {color.command('--pack-format')} {color.highlight('<num>')} Override the pack format number in pack.mcmeta")
183
- print(f" Default: {color.highlight('82')} (Minecraft 1.20+)")
184
- print(f" Example: {color.code('--pack-format 15')} (for older versions)")
185
- print()
186
- print(f" {color.command('--wrapper')} {color.highlight('<name>')} Create a zip file with the specified name")
187
- print(f" Example: {color.code('--wrapper my_awesome_pack')}")
188
- print()
189
- print(f" {color.command('--ignore-warnings')} Suppress warning messages during build")
190
- print(f" Only show errors, hide all warnings")
191
- print()
192
-
193
- # Examples
194
- print_section("Examples")
195
- print()
196
- print(f"1. Build a single MDL file:")
197
- print(f" {color.code('mdl build --mdl hello_world.mdl -o dist')}")
198
- print()
199
- print(f"2. Build all MDL files in a directory:")
200
- print(f" {color.code('mdl build --mdl src/ -o build/my_pack')}")
201
- print()
202
- print(f"3. Build current directory with verbose output:")
203
- print(f" {color.code('mdl build --mdl . -o dist --verbose')}")
204
- print()
205
- print(f"4. Build with custom pack format and zip wrapper:")
206
- print(f" {color.code('mdl build --mdl project.mdl -o dist --pack-format 15 --wrapper my_pack')}")
207
- print()
208
- print(f"5. Build multiple files in a directory:")
209
- print(f" {color.code('mdl build --mdl examples/ -o output --verbose')}")
210
- print()
211
-
212
- # Output Structure
213
- print_section("Output Structure")
214
- print()
215
- print(color.info("The build command creates a standard Minecraft datapack structure:"))
216
- print()
217
- print(f" {color.file_path('output/')}")
218
- print(f" ├── {color.file_path('pack.mcmeta')} # Datapack metadata")
219
- print(f" └── {color.file_path('data/')}")
220
- print(f" ├── {color.file_path('<namespace>/')} # Your datapack namespace")
221
- print(f" └── {color.file_path('function/')} # Generated functions")
222
- print(f" │ ├── {color.file_path('load.mcfunction')}")
223
- print(f"└── {color.file_path('*.mcfunction')}")
224
- print(f" └── {color.file_path('minecraft/')}")
225
- print(f" └── {color.file_path('tags/')}")
226
- print(f" └── {color.file_path('function/')} # Load/tick tags")
227
- print(f" ├── {color.file_path('load.json')}")
228
- print(f" └── {color.file_path('tick.json')}")
229
- print()
230
-
231
- # Features
232
- print_section("Features")
233
- print()
234
- print_bullet("Multi-file compilation - Merge multiple .mdl files into one datapack")
235
- print_bullet("Variable system - Automatic scoreboard objective creation")
236
- print_bullet("Control structures - If/else statements and while loops")
237
- print_bullet("Function calls - Call other functions within your datapack")
238
- print_bullet("Raw commands - Use native Minecraft commands with $variable$ substitution")
239
- print_bullet("Error handling - Detailed error reporting with suggestions")
240
- print_bullet("Progress tracking - Verbose mode shows build progress")
241
- print()
242
-
243
- # Error Handling
244
- print_section("Error Handling")
245
- print()
246
- print(color.info("The build command provides comprehensive error reporting:"))
247
- print_bullet("Syntax errors with exact line and column numbers")
248
- print_bullet("Context lines showing the problematic code")
249
- print_bullet("Helpful suggestions for fixing issues")
250
- print_bullet("Multiple error collection (won't stop on first error)")
251
- print()
252
-
253
- # More Info
254
- print(color.info(f"For more information, visit: {color.file_path('https://www.mcmdl.com/docs/cli-reference/#basic-commands')}"))
255
- print()
256
-
257
- except ImportError:
258
- # Fallback if colors aren't available
259
- print("""
260
- [BUILD] MDL Build Command - Compile MDL Files to Minecraft Datapacks
261
- ===============================================================
262
-
263
- The build command compiles MDL files into standard Minecraft datapacks that can
264
- be loaded directly into Minecraft.
265
-
266
- [CMD] Usage:
267
- ========
268
-
269
- mdl build --mdl <input> -o <output> [options]
270
-
271
- [DIR] Arguments:
272
- ============
273
-
274
- --mdl, -m <input> Input MDL file or directory containing .mdl files
275
- Examples: --mdl project.mdl, --mdl src/, --mdl .
276
-
277
- -o, --output <output> Output directory for the generated datapack
278
- Example: -o dist, -o build/my_pack
279
-
280
- [OPT] Options:
281
- ==========
282
-
283
- --verbose, -v Enable verbose output with detailed build information
284
- Shows file parsing, function generation, and progress
285
-
286
- --pack-format <num> Override the pack format number in pack.mcmeta
287
- Default: 82 (Minecraft 1.20+)
288
- Example: --pack-format 15 (for older versions)
289
-
290
- --wrapper <name> Create a zip file with the specified name
291
- Example: --wrapper my_awesome_pack
292
-
293
- --ignore-warnings Suppress warning messages during build
294
- Only show errors, hide all warnings
295
-
296
- [EX] Examples:
297
- ===========
298
-
299
- 1. Build a single MDL file:
300
- mdl build --mdl hello_world.mdl -o dist
301
-
302
- 2. Build all MDL files in a directory:
303
- mdl build --mdl src/ -o build/my_pack
304
-
305
- 3. Build current directory with verbose output:
306
- mdl build --mdl . -o dist --verbose
307
-
308
- 4. Build with custom pack format and zip wrapper:
309
- mdl build --mdl project.mdl -o dist --pack-format 15 --wrapper my_pack
310
-
311
- 5. Build multiple files in a directory:
312
- mdl build --mdl examples/ -o output --verbose
313
-
314
- [OUT] Output Structure:
315
- ===================
316
-
317
- The build command creates a standard Minecraft datapack structure:
318
-
319
- output/
320
- ├── pack.mcmeta # Datapack metadata
321
- └── data/
322
- ├── <namespace>/ # Your datapack namespace
323
- │ └── function/ # Generated functions
324
- │ ├── load.mcfunction
325
- │ └── *.mcfunction
326
- └── minecraft/
327
- └── tags/
328
- └── function/ # Load/tick tags
329
- ├── load.json
330
- └── tick.json
331
-
332
- [FEAT] Features:
333
- ===========
334
-
335
- • Multi-file compilation - Merge multiple .mdl files into one datapack
336
- • Variable system - Automatic scoreboard objective creation
337
- • Control structures - If/else statements and while loops
338
- • Function calls - Call other functions within your datapack
339
- • Raw commands - Use native Minecraft commands with $variable$ substitution
340
- • Error handling - Detailed error reporting with suggestions
341
- • Progress tracking - Verbose mode shows build progress
342
-
343
- [CHECK] Error Handling:
344
- =================
345
-
346
- The build command provides comprehensive error reporting:
347
- • Syntax errors with exact line and column numbers
348
- • Context lines showing the problematic code
349
- • Helpful suggestions for fixing issues
350
- • Multiple error collection (won't stop on first error)
351
-
352
- For more information, visit: https://www.mcmdl.com/docs/cli-reference/#basic-commands
353
- """)
354
-
83
+ # Header
84
+ print()
85
+ print_header("MDL Build Command - Compile MDL Files to Minecraft Datapacks")
86
+ print_separator("=", 75)
87
+ print()
88
+
89
+ # Description
90
+ print(color.info("The build command compiles MDL files into standard Minecraft datapacks that can"))
91
+ print(color.info("be loaded directly into Minecraft."))
92
+ print()
93
+
94
+ # Usage
95
+ print_section("Usage")
96
+ print()
97
+ print(f" {color.code('mdl build --mdl <input> -o <output> [options]')}")
98
+ print()
99
+
100
+ # Arguments
101
+ print_section("Arguments")
102
+ print()
103
+ print(f" {color.command('--mdl, -m')} {color.highlight('<input>')} Input MDL file or directory containing .mdl files")
104
+ print(f" Examples: {color.code('--mdl project.mdl')}, {color.code('--mdl src/')}, {color.code('--mdl .')}")
105
+ print()
106
+ print(f" {color.command('-o, --output')} {color.highlight('<output>')} Output directory for the generated datapack")
107
+ print(f" Example: {color.code('-o dist')}, {color.code('-o build/my_pack')}")
108
+ print()
109
+
110
+ # Options
111
+ print_section("Options")
112
+ print()
113
+ print(f" {color.command('--verbose, -v')} Enable verbose output with detailed build information")
114
+ print(f" Shows file parsing, function generation, and progress")
115
+ print()
116
+ print(f" {color.command('--pack-format')} {color.highlight('<num>')} Override the pack format number in pack.mcmeta")
117
+ print(f" Default: {color.highlight('82')} (Minecraft 1.20+)")
118
+ print(f" Example: {color.code('--pack-format 15')} (for older versions)")
119
+ print()
120
+ print(f" {color.command('--wrapper')} {color.highlight('<name>')} Create a zip file with the specified name")
121
+ print(f" Example: {color.code('--wrapper my_awesome_pack')}")
122
+ print()
123
+ print(f" {color.command('--ignore-warnings')} Suppress warning messages during build")
124
+ print(f" Only show errors, hide all warnings")
125
+ print()
126
+
127
+ # Examples
128
+ print_section("Examples")
129
+ print()
130
+ print(f"1. Build a single MDL file:")
131
+ print(f" {color.code('mdl build --mdl hello_world.mdl -o dist')}")
132
+ print()
133
+ print(f"2. Build all MDL files in a directory:")
134
+ print(f" {color.code('mdl build --mdl src/ -o build/my_pack')}")
135
+ print()
136
+ print(f"3. Build current directory with verbose output:")
137
+ print(f" {color.code('mdl build --mdl . -o dist --verbose')}")
138
+ print()
139
+ print(f"4. Build with custom pack format and zip wrapper:")
140
+ print(f" {color.code('mdl build --mdl project.mdl -o dist --pack-format 15 --wrapper my_pack')}")
141
+ print()
142
+ print(f"5. Build multiple files in a directory:")
143
+ print(f" {color.code('mdl build --mdl examples/ -o output --verbose')}")
144
+ print()
145
+
146
+ # Output Structure
147
+ print_section("Output Structure")
148
+ print()
149
+ print(color.info("The build command creates a standard Minecraft datapack structure:"))
150
+ print()
151
+ print(f" {color.file_path('output/')}")
152
+ print(f" ├── {color.file_path('pack.mcmeta')} # Datapack metadata")
153
+ print(f" └── {color.file_path('data/')}")
154
+ print(f" ├── {color.file_path('<namespace>/')} # Your datapack namespace")
155
+ print(f" │ └── {color.file_path('function/')} # Generated functions")
156
+ print(f" │ ├── {color.file_path('load.mcfunction')}")
157
+ print(f" │ └── {color.file_path('*.mcfunction')}")
158
+ print(f" └── {color.file_path('minecraft/')}")
159
+ print(f" └── {color.file_path('tags/')}")
160
+ print(f" └── {color.file_path('function/')} # Load/tick tags")
161
+ print(f" ├── {color.file_path('load.json')}")
162
+ print(f" └── {color.file_path('tick.json')}")
163
+ print()
164
+
165
+ # Features
166
+ print_section("Features")
167
+ print()
168
+ print_bullet("Multi-file compilation - Merge multiple .mdl files into one datapack")
169
+ print_bullet("Variable system - Automatic scoreboard objective creation")
170
+ print_bullet("Control structures - If/else statements and while loops")
171
+ print_bullet("Function calls - Call other functions within your datapack")
172
+ print_bullet("Raw commands - Use native Minecraft commands with $variable$ substitution")
173
+ print_bullet("Error handling - Detailed error reporting with suggestions")
174
+ print_bullet("Progress tracking - Verbose mode shows build progress")
175
+ print()
176
+
177
+ # Error Handling
178
+ print_section("Error Handling")
179
+ print()
180
+ print(color.info("The build command provides comprehensive error reporting:"))
181
+ print_bullet("Syntax errors with exact line and column numbers")
182
+ print_bullet("Context lines showing the problematic code")
183
+ print_bullet("Helpful suggestions for fixing issues")
184
+ print_bullet("Multiple error collection (won't stop on first error)")
185
+ print()
186
+
187
+ # More Info
188
+ print(color.info(f"For more information, visit: {color.file_path('https://www.mcmdl.com/docs/cli-reference/#basic-commands')}"))
189
+ print()
355
190
 
356
191
  def show_check_help():
357
192
  """Display detailed help for the check command."""
358
- try:
359
- from .cli_colors import color, print_header, print_title, print_section, print_separator, print_info, print_bullet, print_code
360
-
361
- # Header
362
- print()
363
- print_header("MDL Check Command - Validate MDL Files for Errors")
364
- print_separator("=", 70)
365
- print()
366
-
367
- # Description
368
- print(color.info("The check command validates MDL files for syntax errors, semantic issues, and"))
369
- print(color.info("potential problems without generating any output files."))
370
- print()
371
-
372
- # Usage
373
- print_section("Usage")
374
- print()
375
- print(f" {color.code('mdl check <input> [options]')}")
376
- print()
377
-
378
- # Arguments
379
- print_section("Arguments")
380
- print()
381
- print(f" {color.highlight('<input>')} Input MDL file or directory containing .mdl files")
382
- print(f" Examples: {color.code('project.mdl')}, {color.code('src/')}, {color.code('.')}")
383
- print()
384
-
385
- # Options
386
- print_section("Options")
387
- print()
388
- print(f" {color.command('--verbose, -v')} Enable verbose output with detailed validation information")
389
- print(f" Shows parsing steps, token analysis, and detailed error context")
390
- print()
391
- print(f" {color.command('--ignore-warnings')} Suppress warning messages during check")
392
- print(f" Only show errors, hide all warnings")
393
- print()
394
-
395
- # Examples
396
- print_section("Examples")
397
- print()
398
- print(f"1. Check a single MDL file:")
399
- print(f" {color.code('mdl check hello_world.mdl')}")
400
- print()
401
- print(f"2. Check all MDL files in a directory:")
402
- print(f" {color.code('mdl check src/')}")
403
- print()
404
- print(f"3. Check current directory with verbose output:")
405
- print(f" {color.code('mdl check . --verbose')}")
406
- print()
407
- print(f"4. Check multiple files:")
408
- print(f" {color.code('mdl check examples/ --verbose')}")
409
- print()
410
-
411
- # Validation Types
412
- print_section("Validation Types")
413
- print()
414
- print(color.info("The check command performs comprehensive validation:"))
415
- print()
416
-
417
- print_section("Syntax Validation")
418
- print_bullet("Lexical analysis - Token recognition and validation")
419
- print_bullet("Parsing - AST construction and syntax structure")
420
- print_bullet("Grammar validation - Language rule compliance")
421
- print()
422
-
423
- print_section("Semantic Validation")
424
- print_bullet("Variable declarations - Proper variable naming and scope")
425
- print_bullet("Function definitions - Valid function signatures")
426
- print_bullet("Control structures - Proper if/else and while loop syntax")
427
- print_bullet("Command validation - Minecraft command syntax checking")
428
- print()
429
-
430
- print_section("Error Detection")
431
- print_bullet("Missing semicolons and braces")
432
- print_bullet("Invalid variable names or references")
433
- print_bullet("Unclosed strings and comments")
434
- print_bullet("Malformed control structures")
435
- print_bullet("Invalid selector syntax")
436
- print_bullet("Undefined function calls")
437
- print()
438
-
439
- # Error Reporting
440
- print_section("Error Reporting")
441
- print()
442
- print(color.info("The check command provides detailed error information:"))
443
- print()
444
-
445
- print_section("Error Details")
446
- print_bullet("File path and exact location (line, column)")
447
- print_bullet("Error type and description")
448
- print_bullet("Context lines showing the problematic code")
449
- print_bullet("Helpful suggestions for fixing issues")
450
- print()
451
-
452
- print_section("Error Types")
453
- print_bullet("MDLSyntaxError - Basic syntax violations")
454
- print_bullet("MDLLexerError - Token recognition issues")
455
- print_bullet("MDLParserError - Parsing and structure problems")
456
- print_bullet("MDLValidationError - Semantic validation failures")
457
- print_bullet("MDLFileError - File access and I/O issues")
458
- print()
459
-
460
- # Example Error Output
461
- print_section("Example Error Output")
462
- print()
463
- print(color.info(" Error 1: MDLSyntaxError in test.mdl:15:8"))
464
- print(color.info(" Missing closing brace for if statement"))
465
- print(color.info(" Context:"))
466
- print(f" {color.line_number('13')}: if (score > 10) {{")
467
- print(f" {color.line_number('14')}: say \"High score!\"")
468
- print(f" {color.line_number('15')}: score = 0")
469
- print(f" {color.line_number('16')}: }}")
470
- print()
471
- print(color.suggestion(" Suggestion: Add closing brace '}' after line 15"))
472
- print()
473
-
474
- # Advanced Features
475
- print_section("Advanced Features")
476
- print()
477
- print_bullet("Multi-file validation - Check entire projects at once")
478
- print_bullet("Directory support - Recursively check all .mdl files")
479
- print_bullet("Error collection - Report all errors, not just the first one")
480
- print_bullet("Context preservation - Show surrounding code for better debugging")
481
- print_bullet("Suggestion system - Provide helpful fix recommendations")
482
- print()
483
-
484
- # Integration
485
- print_section("Integration")
486
- print()
487
- print(color.info("The check command is perfect for:"))
488
- print_bullet("CI/CD pipelines - Automated validation")
489
- print_bullet("Development workflows - Pre-commit checks")
490
- print_bullet("Learning MDL - Understand syntax requirements")
491
- print_bullet("Debugging - Identify and fix issues quickly")
492
- print()
493
-
494
- # More Info
495
- print(color.info(f"For more information, visit: {color.file_path('https://www.mcmdl.com/docs/cli-reference#check')}"))
496
- print()
497
-
498
- except ImportError:
499
- # Fallback if colors aren't available
500
- print("""
501
- [CHECK] MDL Check Command - Validate MDL Files for Errors
502
- ====================================================
503
-
504
- The check command validates MDL files for syntax errors, semantic issues, and
505
- potential problems without generating any output files.
506
-
507
- [CMD] Usage:
508
- ========
509
-
510
- mdl check <input> [options]
511
-
512
- [DIR] Arguments:
513
- ============
514
-
515
- <input> Input MDL file or directory containing .mdl files
516
- Examples: project.mdl, src/, .
517
-
518
- [OPT] Options:
519
- ==========
520
-
521
- --verbose, -v Enable verbose output with detailed validation information
522
- Shows parsing steps, token analysis, and detailed error context
523
-
524
- --ignore-warnings Suppress warning messages during check
525
- Only show errors, hide all warnings
526
-
527
- [EX] Examples:
528
- ===========
529
-
530
- 1. Check a single MDL file:
531
- mdl check hello_world.mdl
532
-
533
- 2. Check all MDL files in a directory:
534
- mdl check src/
535
-
536
- 3. Check current directory with verbose output:
537
- mdl check . --verbose
538
-
539
- 4. Check multiple files:
540
- mdl check examples/ --verbose
541
-
542
- [CHECK] Validation Types:
543
- ===================
544
-
545
- The check command performs comprehensive validation:
546
-
547
- [EX] Syntax Validation:
548
- • Lexical analysis - Token recognition and validation
549
- • Parsing - AST construction and syntax structure
550
- • Grammar validation - Language rule compliance
551
-
552
- [OPT] Semantic Validation:
553
- • Variable declarations - Proper variable naming and scope
554
- • Function definitions - Valid function signatures
555
- • Control structures - Proper if/else and while loop syntax
556
- • Command validation - Minecraft command syntax checking
557
-
558
- [WARN] Error Detection:
559
- • Missing semicolons and braces
560
- • Invalid variable names or references
561
- • Unclosed strings and comments
562
- • Malformed control structures
563
- • Invalid selector syntax
564
- • Undefined function calls
565
-
566
- [REP] Error Reporting:
567
- ==================
568
-
569
- The check command provides detailed error information:
570
-
571
- [FEAT] Error Details:
572
- • File path and exact location (line, column)
573
- • Error type and description
574
- • Context lines showing the problematic code
575
- • Helpful suggestions for fixing issues
576
-
577
- [CMD] Error Types:
578
- • MDLSyntaxError - Basic syntax violations
579
- • MDLLexerError - Token recognition issues
580
- • MDLParserError - Parsing and structure problems
581
- • MDLValidationError - Semantic validation failures
582
- • MDLFileError - File access and I/O issues
583
-
584
- [TIP] Example Error Output:
585
- ========================
586
-
587
- Error 1: MDLSyntaxError in test.mdl:15:8
588
- Missing closing brace for if statement
589
- Context:
590
- 13: if (score > 10) {
591
- 14: say "High score!"
592
- 15: score = 0
593
- 16: }
594
-
595
- Suggestion: Add closing brace '}' after line 15
596
-
597
- [CHECK] Advanced Features:
598
- ====================
599
-
600
- • Multi-file validation - Check entire projects at once
601
- • Directory support - Recursively check all .mdl files
602
- • Error collection - Report all errors, not just the first one
603
- • Context preservation - Show surrounding code for better debugging
604
- • Suggestion system - Provide helpful fix recommendations
605
-
606
- [NEXT] Integration:
607
- ==============
608
-
609
- The check command is perfect for:
610
- • CI/CD pipelines - Automated validation
611
- • Development workflows - Pre-commit checks
612
- • Learning MDL - Understand syntax requirements
613
- • Debugging - Identify and fix issues quickly
614
-
615
- For more information, visit: https://www.mcmdl.com/docs/cli-reference#check
616
- """)
617
-
193
+ # Header
194
+ print()
195
+ print_header("MDL Check Command - Validate MDL Files for Errors")
196
+ print_separator("=", 70)
197
+ print()
198
+
199
+ # Description
200
+ print(color.info("The check command validates MDL files for syntax errors, semantic issues, and"))
201
+ print(color.info("potential problems without generating any output files."))
202
+ print()
203
+
204
+ # Usage
205
+ print_section("Usage")
206
+ print()
207
+ print(f" {color.code('mdl check <input> [options]')}")
208
+ print()
209
+
210
+ # Arguments
211
+ print_section("Arguments")
212
+ print()
213
+ print(f" {color.highlight('<input>')} Input MDL file or directory containing .mdl files")
214
+ print(f" Examples: {color.code('project.mdl')}, {color.code('src/')}, {color.code('.')}")
215
+ print()
216
+
217
+ # Options
218
+ print_section("Options")
219
+ print()
220
+ print(f" {color.command('--verbose, -v')} Enable verbose output with detailed validation information")
221
+ print(f" Shows parsing steps, token analysis, and detailed error context")
222
+ print()
223
+ print(f" {color.command('--ignore-warnings')} Suppress warning messages during check")
224
+ print(f" Only show errors, hide all warnings")
225
+ print()
226
+
227
+ # Examples
228
+ print_section("Examples")
229
+ print()
230
+ print(f"1. Check a single MDL file:")
231
+ print(f" {color.code('mdl check hello_world.mdl')}")
232
+ print()
233
+ print(f"2. Check all MDL files in a directory:")
234
+ print(f" {color.code('mdl check src/')}")
235
+ print()
236
+ print(f"3. Check current directory with verbose output:")
237
+ print(f" {color.code('mdl check . --verbose')}")
238
+ print()
239
+ print(f"4. Check multiple files:")
240
+ print(f" {color.code('mdl check examples/ --verbose')}")
241
+ print()
242
+
243
+ # Validation Types
244
+ print_section("Validation Types")
245
+ print()
246
+ print(color.info("The check command performs comprehensive validation:"))
247
+ print()
248
+
249
+ print_section("Syntax Validation")
250
+ print_bullet("Lexical analysis - Token recognition and validation")
251
+ print_bullet("Parsing - AST construction and syntax structure")
252
+ print_bullet("Grammar validation - Language rule compliance")
253
+ print()
254
+
255
+ print_section("Semantic Validation")
256
+ print_bullet("Variable declarations - Proper variable naming and scope")
257
+ print_bullet("Function definitions - Valid function signatures")
258
+ print_bullet("Control structures - Proper if/else and while loop syntax")
259
+ print_bullet("Command validation - Minecraft command syntax checking")
260
+ print()
261
+
262
+ print_section("Error Detection")
263
+ print_bullet("Missing semicolons and braces")
264
+ print_bullet("Invalid variable names or references")
265
+ print_bullet("Unclosed strings and comments")
266
+ print_bullet("Malformed control structures")
267
+ print_bullet("Invalid selector syntax")
268
+ print_bullet("Undefined function calls")
269
+ print()
270
+
271
+ # Error Reporting
272
+ print_section("Error Reporting")
273
+ print()
274
+ print(color.info("The check command provides detailed error information:"))
275
+ print()
276
+
277
+ print_section("Error Details")
278
+ print_bullet("File path and exact location (line, column)")
279
+ print_bullet("Error type and description")
280
+ print_bullet("Context lines showing the problematic code")
281
+ print_bullet("Helpful suggestions for fixing issues")
282
+ print()
283
+
284
+ print_section("Error Types")
285
+ print_bullet("MDLSyntaxError - Basic syntax violations")
286
+ print_bullet("MDLLexerError - Token recognition issues")
287
+ print_bullet("MDLParserError - Parsing and structure problems")
288
+ print_bullet("MDLValidationError - Semantic validation failures")
289
+ print_bullet("MDLFileError - File access and I/O issues")
290
+ print()
291
+
292
+ # Example Error Output
293
+ print_section("Example Error Output")
294
+ print()
295
+ print(color.info(" Error 1: MDLSyntaxError in test.mdl:15:8"))
296
+ print(color.info(" Missing closing brace for if statement"))
297
+ print(color.info(" Context:"))
298
+ print(f" {color.line_number('13')}: if (score > 10) {{")
299
+ print(f" {color.line_number('14')}: say \"High score!\"")
300
+ print(f" {color.line_number('15')}: score = 0")
301
+ print(f" {color.line_number('16')}: }}")
302
+ print()
303
+ print(color.suggestion(" Suggestion: Add closing brace '}' after line 15"))
304
+ print()
305
+
306
+ # Advanced Features
307
+ print_section("Advanced Features")
308
+ print()
309
+ print_bullet("Multi-file validation - Check entire projects at once")
310
+ print_bullet("Directory support - Recursively check all .mdl files")
311
+ print_bullet("Error collection - Report all errors, not just the first one")
312
+ print_bullet("Context preservation - Show surrounding code for better debugging")
313
+ print_bullet("Suggestion system - Provide helpful fix recommendations")
314
+ print()
315
+
316
+ # Integration
317
+ print_section("Integration")
318
+ print()
319
+ print(color.info("The check command is perfect for:"))
320
+ print_bullet("CI/CD pipelines - Automated validation")
321
+ print_bullet("Development workflows - Pre-commit checks")
322
+ print_bullet("Learning MDL - Understand syntax requirements")
323
+ print_bullet("Debugging - Identify and fix issues quickly")
324
+ print()
325
+
326
+ # More Info
327
+ print(color.info(f"For more information, visit: {color.file_path('https://www.mcmdl.com/docs/cli-reference#check')}"))
328
+ print()
618
329
 
619
330
  def show_new_help():
620
331
  """Display detailed help for the new command."""
621
- try:
622
- from .cli_colors import color, print_header, print_title, print_section, print_separator, print_info, print_bullet, print_code
623
-
624
- # Header
625
- print()
626
- print_header("MDL New Command - Create New MDL Projects")
627
- print_separator("=", 65)
628
- print()
629
-
630
- # Description
631
- print(color.info("The new command creates a new MDL project with template files and proper"))
632
- print(color.info("structure to get you started quickly."))
633
- print()
634
-
635
- # Usage
636
- print_section("Usage")
637
- print()
638
- print(f" {color.code('mdl new <project_name> [options]')}")
639
- print()
640
-
641
- # Arguments
642
- print_section("Arguments")
643
- print()
644
- print(f" {color.highlight('<project_name>')} Name for your new MDL project")
645
- print(f" This will be used for the project directory and pack name")
646
- print(f" Example: {color.code('my_awesome_pack')}, {color.code('hello_world')}, {color.code('magic_system')}")
647
- print()
648
-
649
- # Options
650
- print_section("Options")
651
- print()
652
- print(f" {color.command('--pack-name')} {color.highlight('<name>')} Custom name for the datapack (defaults to project name)")
653
- print(f" This appears in the pack.mcmeta description")
654
- print(f" Example: {color.code('--pack-name "My Awesome Magic Pack"')}")
655
- print()
656
- print(f" {color.command('--pack-format')} {color.highlight('<num>')} Pack format number for Minecraft version compatibility")
657
- print(f" Default: {color.highlight('82')} (Minecraft 1.20+)")
658
- print(f" Example: {color.code('--pack-format 15')} (for older versions)")
659
- print()
660
-
661
- # Examples
662
- print_section("Examples")
663
- print()
664
- print(f"1. Create a basic project:")
665
- print(f" {color.code('mdl new hello_world')}")
666
- print()
667
- print(f"2. Create project with custom pack name:")
668
- print(f" {color.code('mdl new magic_system --pack-name "Epic Magic Pack"')}")
669
- print()
670
- print(f"3. Create project for older Minecraft version:")
671
- print(f" {color.code('mdl new retro_pack --pack-format 15')}")
672
- print()
673
- print(f"4. Create project with all custom options:")
674
- print(f" {color.code('mdl new my_project --pack-name "My Project" --pack-format 82')}")
675
- print()
676
-
677
- # Generated Structure
678
- print_section("Generated Structure")
679
- print()
680
- print(color.info("The new command creates a complete project structure:"))
681
- print()
682
- print(f" {color.file_path('<project_name>/')}")
683
- print(f" ├── {color.file_path('README.md')} # Project documentation")
684
- print(f" └── {color.file_path('<project_name>.mdl')} # Main MDL file with template code")
685
- print()
686
-
687
- # Template Content
688
- print_section("Template Content")
689
- print()
690
- print(color.info("The generated MDL file includes:"))
691
- print()
692
-
693
- print_section("Pack Declaration")
694
- print(f"{color.code('pack {')}")
695
- print(f"{color.code(' name: "project_name"')}")
696
- print(f"{color.code(' format: 82')}")
697
- print(f"{color.code(' description: "Generated by MDL CLI"')}")
698
- print(f"{color.code('}')}")
699
- print()
700
-
701
- print_section("Example Functions")
702
- print(f"{color.code('function main {')}")
703
- print(f"{color.code(' say "Hello from MDL!"')}")
704
- print(f"{color.code(' ')}")
705
- print(f"{color.code(' // Variable example')}")
706
- print(f"{color.code(' score = 10')}")
707
- print(f"{color.code(' say "Score: $score$"')}")
708
- print(f"{color.code(' ')}")
709
- print(f"{color.code(' // Conditional example')}")
710
- print(f"{color.code(' if (score > 5) {')}")
711
- print(f"{color.code(' say "High score!"')}")
712
- print(f"{color.code(' } else {')}")
713
- print(f"{color.code(' say "Try again!"')}")
714
- print(f"{color.code(' }')}")
715
- print(f"{color.code('}')}")
716
- print()
717
- print(f"{color.code('function load {')}")
718
- print(f"{color.code(' // This function runs when the datapack loads')}")
719
- print(f"{color.code(' say "Datapack loaded successfully!"')}")
720
- print(f"{color.code('}')}")
721
- print()
722
-
723
- # Features
724
- print_section("Features")
725
- print()
726
- print_bullet("Complete project setup - Ready-to-use structure")
727
- print_bullet("Template code - Working examples to learn from")
728
- print_bullet("Proper pack metadata - Correct pack.mcmeta configuration")
729
- print_bullet("Documentation - README with usage instructions")
730
- print_bullet("Best practices - Follows MDL conventions")
731
- print()
732
-
733
- # Getting Started
734
- print_section("Getting Started")
735
- print()
736
- print(color.info("After creating a new project:"))
737
- print()
738
- print(f"1. Navigate to the project directory:")
739
- print(f" {color.code('cd <project_name>')}")
740
- print()
741
- print(f"2. Edit the MDL file:")
742
- print(f" # Edit {color.file_path('<project_name>.mdl')} with your code")
743
- print()
744
- print(f"3. Build the datapack:")
745
- print(f" {color.code('mdl build --mdl <project_name>.mdl -o dist')}")
746
- print()
747
- print(f"4. Check for errors:")
748
- print(f" {color.code('mdl check <project_name>.mdl')}")
749
- print()
750
- print(f"5. Load in Minecraft:")
751
- print(f" # Copy the dist folder to your world's datapacks directory")
752
- print()
753
-
754
- # Tips
755
- print_section("Tips")
756
- print()
757
- print_bullet("Use descriptive project names - They become your namespace")
758
- print_bullet("Start with the template code - It demonstrates key MDL features")
759
- print_bullet("Check your code regularly - Use `mdl check` during development")
760
- print_bullet("Use version control - Git is great for tracking changes")
761
- print_bullet("Read the documentation - Learn about all available features")
762
- print()
763
-
764
- # Next Steps
765
- print_section("Next Steps")
766
- print()
767
- print_bullet(f"Language Reference: {color.file_path('https://www.mcmdl.com/docs/language-reference')}")
768
- print_bullet(f"Examples: {color.file_path('https://www.mcmdl.com/docs/examples')}")
769
- print_bullet(f"CLI Reference: {color.file_path('https://www.mcmdl.com/docs/cli-reference')}")
770
- print()
771
-
772
- # More Info
773
- print(color.info(f"For more information, visit: {color.file_path('https://www.mcmdl.com/docs/cli-reference#new')}"))
774
- print()
775
-
776
- except ImportError:
777
- # Fallback if colors aren't available
778
- print("""
779
- [NEW] MDL New Command - Create New MDL Projects
780
- ============================================
781
-
782
- The new command creates a new MDL project with template files and proper
783
- structure to get you started quickly.
784
-
785
- [CMD] Usage:
786
- ========
787
-
788
- mdl new <project_name> [options]
789
-
790
- [DIR] Arguments:
791
- ============
792
-
793
- <project_name> Name for your new MDL project
794
- This will be used for the project directory and pack name
795
- Example: my_awesome_pack, hello_world, magic_system
796
-
797
- [OPT] Options:
798
- ==========
799
-
800
- --pack-name <name> Custom name for the datapack (defaults to project name)
801
- This appears in the pack.mcmeta description
802
- Example: --pack-name "My Awesome Magic Pack"
803
-
804
- --pack-format <num> Pack format number for Minecraft version compatibility
805
- Default: 82 (Minecraft 1.20+)
806
- Example: --pack-format 15 (for older versions)
807
-
808
- [EX] Examples:
809
- ===========
810
-
811
- 1. Create a basic project:
812
- mdl new hello_world
813
-
814
- 2. Create project with custom pack name:
815
- mdl new magic_system --pack-name "Epic Magic Pack"
816
-
817
- 3. Create project for older Minecraft version:
818
- mdl new retro_pack --pack-format 15
819
-
820
- 4. Create project with all custom options:
821
- mdl new my_project --pack-name "My Project" --pack-format 82
822
-
823
- [OUT] Generated Structure:
824
- ======================
825
-
826
- The new command creates a complete project structure:
827
-
828
- <project_name>/
829
- ├── README.md # Project documentation
830
- └── <project_name>.mdl # Main MDL file with template code
831
-
832
- [FILE] Template Content:
833
- ===================
834
-
835
- The generated MDL file includes:
836
-
837
- [CMD] Pack Declaration:
838
- ```mdl
839
- pack {
840
- name: "project_name"
841
- format: 82
842
- description: "Generated by MDL CLI"
843
- }
844
- ```
845
-
846
- [OPT] Example Functions:
847
- ```mdl
848
- function main {
849
- say "Hello from MDL!"
850
-
851
- // Variable example
852
- score = 10
853
- say "Score: $score$"
854
-
855
- // Conditional example
856
- if (score > 5) {
857
- say "High score!"
858
- } else {
859
- say "Try again!"
860
- }
861
- }
862
-
863
- function load {
864
- // This function runs when the datapack loads
865
- say "Datapack loaded successfully!"
866
- }
867
- ```
868
-
869
- [FEAT] Features:
870
- ===========
871
-
872
- • Complete project setup - Ready-to-use structure
873
- • Template code - Working examples to learn from
874
- • Proper pack metadata - Correct pack.mcmeta configuration
875
- • Documentation - README with usage instructions
876
- • Best practices - Follows MDL conventions
877
-
878
- [NEXT] Getting Started:
879
- ==================
880
-
881
- After creating a new project:
882
-
883
- 1. Navigate to the project directory:
884
- cd <project_name>
885
-
886
- 2. Edit the MDL file:
887
- # Edit <project_name>.mdl with your code
888
-
889
- 3. Build the datapack:
890
- mdl build --mdl <project_name>.mdl -o dist
891
-
892
- 4. Check for errors:
893
- mdl check <project_name>.mdl
894
-
895
- 5. Load in Minecraft:
896
- # Copy the dist folder to your world's datapacks directory
897
-
898
- [TIP] Tips:
899
- ========
900
-
901
- • Use descriptive project names - They become your namespace
902
- • Start with the template code - It demonstrates key MDL features
903
- • Check your code regularly - Use `mdl check` during development
904
- • Use version control - Git is great for tracking changes
905
- • Read the documentation - Learn about all available features
906
-
907
- [INFO] Next Steps:
908
- =============
909
-
910
- • Language Reference: https://www.mcmdl.com/docs/language-reference
911
- • Examples: https://www.mcmdl.com/docs/examples
912
- • CLI Reference: https://www.mcmdl.com/docs/cli-reference
913
-
914
- For more information, visit: https://www.mcmdl.com/docs/cli-reference#new
915
- """)
332
+ # Header
333
+ print()
334
+ print_header("MDL New Command - Create New MDL Projects")
335
+ print_separator("=", 65)
336
+ print()
337
+
338
+ # Description
339
+ print(color.info("The new command creates a new MDL project with template files and proper"))
340
+ print(color.info("structure to get you started quickly."))
341
+ print()
342
+
343
+ # Usage
344
+ print_section("Usage")
345
+ print()
346
+ print(f" {color.code('mdl new <project_name> [options]')}")
347
+ print()
348
+
349
+ # Arguments
350
+ print_section("Arguments")
351
+ print()
352
+ print(f" {color.highlight('<project_name>')} Name for your new MDL project")
353
+ print(f" This will be used for the project directory and pack name")
354
+ print(f" Example: {color.code('my_awesome_pack')}, {color.code('hello_world')}, {color.code('magic_system')}")
355
+ print()
356
+
357
+ # Options
358
+ print_section("Options")
359
+ print()
360
+ print(f" {color.command('--pack-name')} {color.highlight('<name>')} Custom name for the datapack (defaults to project name)")
361
+ print(f" This appears in the pack.mcmeta description")
362
+ print(f" Example: {color.code('--pack-name "My Awesome Magic Pack"')}")
363
+ print()
364
+ print(f" {color.command('--pack-format')} {color.highlight('<num>')} Pack format number for Minecraft version compatibility")
365
+ print(f" Default: {color.highlight('82')} (Minecraft 1.20+)")
366
+ print(f" Example: {color.code('--pack-format 15')} (for older versions)")
367
+ print()
368
+
369
+ # Examples
370
+ print_section("Examples")
371
+ print()
372
+ print(f"1. Create a basic project:")
373
+ print(f" {color.code('mdl new hello_world')}")
374
+ print()
375
+ print(f"2. Create project with custom pack name:")
376
+ print(f" {color.code('mdl new magic_system --pack-name "Epic Magic Pack"')}")
377
+ print()
378
+ print(f"3. Create project for older Minecraft version:")
379
+ print(f" {color.code('mdl new retro_pack --pack-format 15')}")
380
+ print()
381
+ print(f"4. Create project with all custom options:")
382
+ print(f" {color.code('mdl new my_project --pack-name "My Project" --pack-format 82')}")
383
+ print()
384
+
385
+ # Generated Structure
386
+ print_section("Generated Structure")
387
+ print()
388
+ print(color.info("The new command creates a complete project structure:"))
389
+ print()
390
+ print(f" {color.file_path('<project_name>/')}")
391
+ print(f" ├── {color.file_path('README.md')} # Project documentation")
392
+ print(f" └── {color.file_path('<project_name>.mdl')} # Main MDL file with template code")
393
+ print()
394
+
395
+ # Template Content
396
+ print_section("Template Content")
397
+ print()
398
+ print(color.info("The generated MDL file includes:"))
399
+ print()
400
+
401
+ print_section("Pack Declaration")
402
+ print(f"{color.code('pack {')}")
403
+ print(f"{color.code(' name: "project_name"')}")
404
+ print(f"{color.code(' format: 82')}")
405
+ print(f"{color.code(' description: "Generated by MDL CLI"')}")
406
+ print(f"{color.code('}')}")
407
+ print()
408
+
409
+ print_section("Example Functions")
410
+ print(f"{color.code('function main {')}")
411
+ print(f"{color.code(' say "Hello from MDL!"')}")
412
+ print(f"{color.code(' ')}")
413
+ print(f"{color.code(' // Variable example')}")
414
+ print(f"{color.code(' score = 10')}")
415
+ print(f"{color.code(' say "Score: $score$"')}")
416
+ print(f"{color.code(' ')}")
417
+ print(f"{color.code(' // Conditional example')}")
418
+ print(f"{color.code(' if (score > 5) {')}")
419
+ print(f"{color.code(' say "High score!"')}")
420
+ print(f"{color.code(' } else {')}")
421
+ print(f"{color.code(' say "Try again!"')}")
422
+ print(f"{color.code(' }')}")
423
+ print(f"{color.code('}')}")
424
+ print()
425
+ print(f"{color.code('function load {')}")
426
+ print(f"{color.code(' // This function runs when the datapack loads')}")
427
+ print(f"{color.code(' say "Datapack loaded successfully!"')}")
428
+ print(f"{color.code('}')}")
429
+ print()
430
+
431
+ # Features
432
+ print_section("Features")
433
+ print()
434
+ print_bullet("Complete project setup - Ready-to-use structure")
435
+ print_bullet("Template code - Working examples to learn from")
436
+ print_bullet("Proper pack metadata - Correct pack.mcmeta configuration")
437
+ print_bullet("Documentation - README with usage instructions")
438
+ print_bullet("Best practices - Follows MDL conventions")
439
+ print()
440
+
441
+ # Getting Started
442
+ print_section("Getting Started")
443
+ print()
444
+ print(color.info("After creating a new project:"))
445
+ print()
446
+ print(f"1. Navigate to the project directory:")
447
+ print(f" {color.code('cd <project_name>')}")
448
+ print()
449
+ print(f"2. Edit the MDL file:")
450
+ print(f" # Edit {color.file_path('<project_name>.mdl')} with your code")
451
+ print()
452
+ print(f"3. Build the datapack:")
453
+ print(f" {color.code('mdl build --mdl <project_name>.mdl -o dist')}")
454
+ print()
455
+ print(f"4. Check for errors:")
456
+ print(f" {color.code('mdl check <project_name>.mdl')}")
457
+ print()
458
+ print(f"5. Load in Minecraft:")
459
+ print(f" # Copy the dist folder to your world's datapacks directory")
460
+ print()
461
+
462
+ # Tips
463
+ print_section("Tips")
464
+ print()
465
+ print_bullet("Use descriptive project names - They become your namespace")
466
+ print_bullet("Start with the template code - It demonstrates key MDL features")
467
+ print_bullet("Check your code regularly - Use `mdl check` during development")
468
+ print_bullet("Use version control - Git is great for tracking changes")
469
+ print_bullet("Read the documentation - Learn about all available features")
470
+ print()
471
+
472
+ # Next Steps
473
+ print_section("Next Steps")
474
+ print()
475
+ print_bullet(f"Language Reference: {color.file_path('https://www.mcmdl.com/docs/language-reference')}")
476
+ print_bullet(f"Examples: {color.file_path('https://www.mcmdl.com/docs/examples')}")
477
+ print_bullet(f"CLI Reference: {color.file_path('https://www.mcmdl.com/docs/cli-reference')}")
478
+ print()
479
+
480
+ # More Info
481
+ print(color.info(f"For more information, visit: {color.file_path('https://www.mcmdl.com/docs/cli-reference#new')}"))
482
+ print()