minecraft-datapack-language 16.0.11__py3-none-any.whl → 16.0.12__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.
@@ -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 = '16.0.11'
32
- __version_tuple__ = version_tuple = (16, 0, 11)
31
+ __version__ = version = '16.0.12'
32
+ __version_tuple__ = version_tuple = (16, 0, 12)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -656,6 +656,12 @@ class MDLCompiler:
656
656
  wrap_fn = self._generate_while_function_name() # e.g., fn__while_1
657
657
  body_fn = f"{wrap_fn}__body"
658
658
  tag = f"mdl_sched__{wrap_fn}"
659
+ # If inside a parent scheduledwhile, register this tag as a child so parent defers while child active
660
+ if hasattr(self, '_sched_child_tag_stack') and self._sched_child_tag_stack:
661
+ self._sched_child_tag_stack[-1].append(tag)
662
+ # Prepare nested scheduledwhile coordination
663
+ if not hasattr(self, '_sched_child_tag_stack'):
664
+ self._sched_child_tag_stack = []
659
665
 
660
666
  # Build condition once
661
667
  cond_str, invert_then = self._build_condition(while_loop.condition)
@@ -669,8 +675,21 @@ class MDLCompiler:
669
675
 
670
676
  # Build per-entity body function
671
677
  body_lines: List[str] = [f"# Function: {self.current_namespace}:{body_fn}"]
678
+
672
679
  if not hasattr(self, '_temp_sink_stack'):
673
680
  self._temp_sink_stack = []
681
+
682
+ # Push a new child tag collector for nested scheduledwhiles
683
+ self._sched_child_tag_stack.append([])
684
+ # Also expose this collector to nested calls via a convenience reference
685
+ current_child_list = self._sched_child_tag_stack[-1]
686
+ # Provide a hook for nested scheduledwhile to register their tag
687
+ if not hasattr(self, '_register_child_sched_tag'):
688
+ def _register(tag_name: str):
689
+ if self._sched_child_tag_stack:
690
+ self._sched_child_tag_stack[-1].append(tag_name)
691
+ self._register_child_sched_tag = _register
692
+
674
693
  self._temp_sink_stack.append(body_lines)
675
694
  for stmt in while_loop.body:
676
695
  if isinstance(stmt, VariableAssignment):
@@ -697,14 +716,20 @@ class MDLCompiler:
697
716
  cmd = self._function_call_to_command(stmt)
698
717
  body_lines.append(cmd)
699
718
  self._temp_sink_stack.pop()
719
+ # Pop collected child tags for this level
720
+ child_tags: List[str] = self._sched_child_tag_stack.pop() if hasattr(self, '_sched_child_tag_stack') and self._sched_child_tag_stack else []
700
721
  self._store_generated_function(body_fn, body_lines)
701
722
 
702
723
  # Build wrapper function that maintains the tag set and reschedules if needed
703
724
  wrap_lines: List[str] = [f"# Function: {self.current_namespace}:{wrap_fn}"]
704
725
  # Hint comment to aid tests expecting a plain 'execute if score' substring
705
726
  wrap_lines.append(f"# execute {cond_true} ...")
706
- # Run body for entities where condition holds
707
- wrap_lines.append(f"execute as @e[tag={tag}] {cond_true} run function {self.current_namespace}:{body_fn}")
727
+ # Run body for entities where condition holds (but NOT currently inside any child scheduled loop)
728
+ selector = f"@e[tag={tag}"
729
+ for ct in child_tags:
730
+ selector += f",tag=!{ct}"
731
+ selector += "]"
732
+ wrap_lines.append(f"execute as {selector} {cond_true} run function {self.current_namespace}:{body_fn}")
708
733
  # Remove tag when condition fails
709
734
  wrap_lines.append(f"execute as @e[tag={tag}] {cond_false} run tag @s remove {tag}")
710
735
  # Continue scheduling while any remain
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: minecraft-datapack-language
3
- Version: 16.0.11
3
+ Version: 16.0.12
4
4
  Summary: Compile MDL language with explicit scoping 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,18 +1,18 @@
1
1
  minecraft_datapack_language/__init__.py,sha256=0KVXBE4ScRaRUrf83aA2tVB-y8A_jplyaxVvtHH6Uw0,1199
2
- minecraft_datapack_language/_version.py,sha256=0teKLh7F1fBENIal1EYkpAqq_ACLfpRPnzU2u5d-84c,708
2
+ minecraft_datapack_language/_version.py,sha256=qcI2Mkb_Pla9x345XpE8wo3tbrWbgeMISZVSqOvyEo8,708
3
3
  minecraft_datapack_language/ast_nodes.py,sha256=L5izavSeXDr766vsfRvJrcnflXNJyXcy0WSfyJPq2ZA,4484
4
4
  minecraft_datapack_language/cli.py,sha256=R4QZYtox-Da9B8pr_kCg_9qc9aI-ORTah7kMkhsI5tw,10373
5
5
  minecraft_datapack_language/dir_map.py,sha256=HmxFkuvWGkzHF8o_GFb4BpuMCRc6QMw8UbmcAI8JVdY,1788
6
- minecraft_datapack_language/mdl_compiler.py,sha256=L2-NCQBc-6gshM-VNqyW4HxnltS8XNb7IU_37AOiDAI,50680
6
+ minecraft_datapack_language/mdl_compiler.py,sha256=mgw3tscpAYtAuhiCsMGQgFy03KVHUt6OWIk4xQf12IU,52065
7
7
  minecraft_datapack_language/mdl_errors.py,sha256=r0Gu3KhoX1YLPAVW_iO7Q_fPgaf_Dv9tOGSOdKNSzmw,16114
8
8
  minecraft_datapack_language/mdl_lexer.py,sha256=rfsW2QNcZxa9HAHpU9HFReshQSmjOrrK6xY_r43mKFk,23485
9
9
  minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYaLDcGNRAl-RAI,17253
10
10
  minecraft_datapack_language/mdl_parser.py,sha256=Krk7Y_E9OKNCcsDOCT7ATvQLbJII951AU2qzEY00GLE,26068
11
11
  minecraft_datapack_language/python_api.py,sha256=Iao1jbdeW6ekeA80BZG6gNqHVjxQJEheB3DbpVsuTZQ,12304
12
12
  minecraft_datapack_language/utils.py,sha256=Aq0HAGlXqj9BUTEjaEilpvzEW0EtZYYMMwOqG9db6dE,684
13
- minecraft_datapack_language-16.0.11.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
14
- minecraft_datapack_language-16.0.11.dist-info/METADATA,sha256=gEFJawJ7Rmjc4QVM0PrDu0FehvtajZbQCLFwDxpfcXI,8344
15
- minecraft_datapack_language-16.0.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
- minecraft_datapack_language-16.0.11.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
17
- minecraft_datapack_language-16.0.11.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
18
- minecraft_datapack_language-16.0.11.dist-info/RECORD,,
13
+ minecraft_datapack_language-16.0.12.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
14
+ minecraft_datapack_language-16.0.12.dist-info/METADATA,sha256=ub5-kid2nQqJIWlv7VGeG6vsQkXwi0O7qkN1zaSG6e8,8344
15
+ minecraft_datapack_language-16.0.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
16
+ minecraft_datapack_language-16.0.12.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
17
+ minecraft_datapack_language-16.0.12.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
18
+ minecraft_datapack_language-16.0.12.dist-info/RECORD,,