minecraft-datapack-language 15.1.64__py3-none-any.whl → 15.1.66__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.
- minecraft_datapack_language/_version.py +2 -2
- minecraft_datapack_language/cli_build.py +20 -9
- {minecraft_datapack_language-15.1.64.dist-info → minecraft_datapack_language-15.1.66.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.1.64.dist-info → minecraft_datapack_language-15.1.66.dist-info}/RECORD +8 -8
- {minecraft_datapack_language-15.1.64.dist-info → minecraft_datapack_language-15.1.66.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.1.64.dist-info → minecraft_datapack_language-15.1.66.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.1.64.dist-info → minecraft_datapack_language-15.1.66.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.1.64.dist-info → minecraft_datapack_language-15.1.66.dist-info}/top_level.txt +0 -0
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
28
28
|
commit_id: COMMIT_ID
|
29
29
|
__commit_id__: COMMIT_ID
|
30
30
|
|
31
|
-
__version__ = version = '15.1.
|
32
|
-
__version_tuple__ = version_tuple = (15, 1,
|
31
|
+
__version__ = version = '15.1.66'
|
32
|
+
__version_tuple__ = version_tuple = (15, 1, 66)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -195,7 +195,6 @@ def _generate_load_function(scoreboard_commands: List[str], output_dir: Path, na
|
|
195
195
|
|
196
196
|
# Add armor stand setup for server-side operations
|
197
197
|
load_content.append("execute unless entity @e[type=armor_stand,tag=mdl_server,limit=1] run summon armor_stand ~ 320 ~ {Tags:[\"mdl_server\"],Invisible:1b,Marker:1b,NoGravity:1b,Invulnerable:1b}")
|
198
|
-
load_content.append("")
|
199
198
|
|
200
199
|
# Add scoreboard objectives
|
201
200
|
load_content.extend(scoreboard_commands)
|
@@ -283,6 +282,10 @@ def _process_statement(statement: Any, namespace: str, function_name: str, state
|
|
283
282
|
# Convert to Minecraft tellraw format
|
284
283
|
processed_command = _process_say_command_with_variables(content, selector)
|
285
284
|
commands.append(processed_command)
|
285
|
+
elif command.startswith('tellraw @a '):
|
286
|
+
# Fix extra space in tellraw commands
|
287
|
+
fixed_command = command.replace('tellraw @ a ', 'tellraw @a ')
|
288
|
+
commands.append(fixed_command)
|
286
289
|
else:
|
287
290
|
# Process other commands normally
|
288
291
|
processed_command = _process_variable_substitutions(command, selector)
|
@@ -294,11 +297,11 @@ def _process_statement(statement: Any, namespace: str, function_name: str, state
|
|
294
297
|
|
295
298
|
# Handle different value types
|
296
299
|
if isinstance(value, int):
|
297
|
-
commands.append(f"scoreboard players set {
|
300
|
+
commands.append(f"scoreboard players set {selector} {var_name} {value}")
|
298
301
|
elif isinstance(value, str) and value.startswith('$') and value.endswith('$'):
|
299
302
|
# Variable reference
|
300
303
|
ref_var = value[1:-1] # Remove $ symbols
|
301
|
-
commands.append(f"scoreboard players operation {
|
304
|
+
commands.append(f"scoreboard players operation {selector} {var_name} = {selector} {ref_var}")
|
302
305
|
elif hasattr(value, '__class__') and 'BinaryExpression' in str(value.__class__):
|
303
306
|
# Handle complex expressions (BinaryExpression, etc.)
|
304
307
|
# Convert to proper Minecraft scoreboard commands
|
@@ -311,14 +314,14 @@ def _process_statement(statement: Any, namespace: str, function_name: str, state
|
|
311
314
|
if operator == 'PLUS':
|
312
315
|
if hasattr(left, 'name') and hasattr(right, 'value'):
|
313
316
|
# counter = counter + 1
|
314
|
-
commands.append(f"scoreboard players add {
|
317
|
+
commands.append(f"scoreboard players add {selector} {var_name} {right.value}")
|
315
318
|
else:
|
316
319
|
# Complex case - use operation
|
317
320
|
commands.append(f"# Complex addition: {var_name} = {left} + {right}")
|
318
321
|
elif operator == 'MINUS':
|
319
322
|
if hasattr(left, 'name') and hasattr(right, 'value'):
|
320
323
|
# health = health - 10
|
321
|
-
commands.append(f"scoreboard players remove {
|
324
|
+
commands.append(f"scoreboard players remove {selector} {var_name} {right.value}")
|
322
325
|
else:
|
323
326
|
# Complex case - use operation
|
324
327
|
commands.append(f"# Complex subtraction: {var_name} = {left} - {right}")
|
@@ -333,11 +336,11 @@ def _process_statement(statement: Any, namespace: str, function_name: str, state
|
|
333
336
|
if hasattr(value, 'value'):
|
334
337
|
# LiteralExpression case
|
335
338
|
num_value = int(value.value)
|
336
|
-
commands.append(f"scoreboard players set {
|
339
|
+
commands.append(f"scoreboard players set {selector} {var_name} {num_value}")
|
337
340
|
else:
|
338
341
|
# Direct value case
|
339
342
|
num_value = int(value)
|
340
|
-
commands.append(f"scoreboard players set {
|
343
|
+
commands.append(f"scoreboard players set {selector} {var_name} {num_value}")
|
341
344
|
except (ValueError, TypeError):
|
342
345
|
# If we can't convert to int, add a placeholder
|
343
346
|
commands.append(f"# Assignment: {var_name} = {value}")
|
@@ -434,10 +437,12 @@ def _generate_function_file(ast: Dict[str, Any], output_dir: Path, namespace: st
|
|
434
437
|
function_commands = []
|
435
438
|
for i, statement in enumerate(func_body):
|
436
439
|
try:
|
440
|
+
if verbose:
|
441
|
+
print(f"DEBUG: Processing statement {i} of type {statement.get('type', 'unknown')}: {statement}")
|
437
442
|
commands = _process_statement(statement, namespace, func_name, i, False, "@s", {}, build_context)
|
438
443
|
function_commands.extend(commands)
|
439
444
|
if verbose:
|
440
|
-
print(f"Generated {len(commands)} commands for statement {i} in function {func_name}")
|
445
|
+
print(f"Generated {len(commands)} commands for statement {i} in function {func_name}: {commands}")
|
441
446
|
except Exception as e:
|
442
447
|
if verbose:
|
443
448
|
print(f"Warning: Error processing statement {i} in function {func_name}: {e}")
|
@@ -447,11 +452,17 @@ def _generate_function_file(ast: Dict[str, Any], output_dir: Path, namespace: st
|
|
447
452
|
|
448
453
|
# Write function file
|
449
454
|
if function_commands:
|
455
|
+
# Add armor stand setup to the beginning of each function
|
456
|
+
final_commands = []
|
457
|
+
final_commands.append("execute unless entity @e[type=armor_stand,tag=mdl_server,limit=1] run summon armor_stand ~ 320 ~ {Tags:[\"mdl_server\"],Invisible:1b,Marker:1b,NoGravity:1b,Invulnerable:1b}")
|
458
|
+
final_commands.append("")
|
459
|
+
final_commands.extend(function_commands)
|
460
|
+
|
450
461
|
func_dir = output_dir / "data" / namespace / "function"
|
451
462
|
ensure_dir(str(func_dir))
|
452
463
|
|
453
464
|
with open(func_dir / f"{func_name}.mcfunction", 'w', encoding='utf-8') as f:
|
454
|
-
f.write('\n'.join(
|
465
|
+
f.write('\n'.join(final_commands))
|
455
466
|
|
456
467
|
if verbose:
|
457
468
|
print(f"Generated function: {namespace}:{func_name}")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version: 15.1.
|
3
|
+
Version: 15.1.66
|
4
4
|
Summary: Compile JavaScript-style MDL language or Python API into a Minecraft datapack (1.21+ ready). Features variables, control flow, error handling, and VS Code extension.
|
5
5
|
Project-URL: Homepage, https://www.mcmdl.com
|
6
6
|
Project-URL: Documentation, https://www.mcmdl.com/docs
|
@@ -1,8 +1,8 @@
|
|
1
1
|
minecraft_datapack_language/__init__.py,sha256=i-qCchbe5b2Fshgc6yCU9mddOLs2UBt9SAcLqfUIrT0,606
|
2
|
-
minecraft_datapack_language/_version.py,sha256=
|
2
|
+
minecraft_datapack_language/_version.py,sha256=XaWr400473_Igz1L5PwRIHAYUo89bDeGrP21_54xiUE,708
|
3
3
|
minecraft_datapack_language/ast_nodes.py,sha256=pgjI2Nlap3ixFPgWqGSkqncG9zB91h5BKgRjtcJqMew,2118
|
4
4
|
minecraft_datapack_language/cli.py,sha256=p5A_tEEXugN2NhQFbbgfwi4FxbWYD91RWeKR_A3Vuec,6263
|
5
|
-
minecraft_datapack_language/cli_build.py,sha256=
|
5
|
+
minecraft_datapack_language/cli_build.py,sha256=HC-tIcmUYz1zH9xkQ0PUUXd1E0cMFYfRE6vDb749JlU,40117
|
6
6
|
minecraft_datapack_language/cli_check.py,sha256=bPq9gHsxQ1CIiftkrAtRCifWkVAyjp5c8Oay2NNQ1qs,6277
|
7
7
|
minecraft_datapack_language/cli_help.py,sha256=jUTHUQBONAZKVTdQK9tNPXq4c_6xpsafNOvHDjkEldg,12243
|
8
8
|
minecraft_datapack_language/cli_new.py,sha256=uaKH0VBC43XBt_Hztc35-BfC9bYlsDdLbAfe_42rrtI,8235
|
@@ -16,9 +16,9 @@ minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYa
|
|
16
16
|
minecraft_datapack_language/mdl_parser_js.py,sha256=4VMWx6O7A10afTzjGnnwL_Sh52osIO84ObqHp8KoDZw,38677
|
17
17
|
minecraft_datapack_language/pack.py,sha256=nYiXQ3jgJlDfc4m-65f7C2LFhDRioaUU_XVy6Na4SJI,34625
|
18
18
|
minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
|
19
|
-
minecraft_datapack_language-15.1.
|
20
|
-
minecraft_datapack_language-15.1.
|
21
|
-
minecraft_datapack_language-15.1.
|
22
|
-
minecraft_datapack_language-15.1.
|
23
|
-
minecraft_datapack_language-15.1.
|
24
|
-
minecraft_datapack_language-15.1.
|
19
|
+
minecraft_datapack_language-15.1.66.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
20
|
+
minecraft_datapack_language-15.1.66.dist-info/METADATA,sha256=YjxzdBrfgB5qI2DcvQVJhBGUWLpr7m7DM6L-o3c3R1Q,35230
|
21
|
+
minecraft_datapack_language-15.1.66.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
22
|
+
minecraft_datapack_language-15.1.66.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
23
|
+
minecraft_datapack_language-15.1.66.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
24
|
+
minecraft_datapack_language-15.1.66.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|