minecraft-datapack-language 15.4.43__py3-none-any.whl → 16.0.1__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/mdl_compiler.py +50 -11
- {minecraft_datapack_language-15.4.43.dist-info → minecraft_datapack_language-16.0.1.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.4.43.dist-info → minecraft_datapack_language-16.0.1.dist-info}/RECORD +8 -8
- {minecraft_datapack_language-15.4.43.dist-info → minecraft_datapack_language-16.0.1.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.4.43.dist-info → minecraft_datapack_language-16.0.1.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.4.43.dist-info → minecraft_datapack_language-16.0.1.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.4.43.dist-info → minecraft_datapack_language-16.0.1.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 = '
|
32
|
-
__version_tuple__ = version_tuple = (
|
31
|
+
__version__ = version = '16.0.1'
|
32
|
+
__version_tuple__ = version_tuple = (16, 0, 1)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -369,8 +369,16 @@ class MDLCompiler:
|
|
369
369
|
# Return the command to set the target variable from the temp
|
370
370
|
return f"scoreboard players operation {scope} {objective} = @s {temp_var}"
|
371
371
|
else:
|
372
|
-
# Simple value - use direct assignment
|
372
|
+
# Simple value - use direct assignment or scoreboard copy
|
373
373
|
value = self._expression_to_value(assignment.value)
|
374
|
+
# If RHS resolves to a scoreboard reference (e.g., 'score @s some_obj'),
|
375
|
+
# emit an operation copy instead of an invalid 'set ... score ...'
|
376
|
+
if isinstance(value, str) and value.startswith("score "):
|
377
|
+
parts = value.split()
|
378
|
+
if len(parts) >= 3:
|
379
|
+
src_scope = parts[1]
|
380
|
+
src_objective = parts[2]
|
381
|
+
return f"scoreboard players operation {scope} {objective} = {src_scope} {src_objective}"
|
374
382
|
return f"scoreboard players set {scope} {objective} {value}"
|
375
383
|
|
376
384
|
def _variable_declaration_to_command(self, decl: VariableDeclaration) -> str:
|
@@ -388,6 +396,13 @@ class MDLCompiler:
|
|
388
396
|
except Exception:
|
389
397
|
init = None
|
390
398
|
if init is not None:
|
399
|
+
# Initialize from another scoreboard using operation copy
|
400
|
+
if isinstance(init, str) and init.startswith("score "):
|
401
|
+
parts = init.split()
|
402
|
+
if len(parts) >= 3:
|
403
|
+
src_scope = parts[1]
|
404
|
+
src_objective = parts[2]
|
405
|
+
return f"scoreboard players operation {scope} {objective} = {src_scope} {src_objective}"
|
391
406
|
return f"scoreboard players set {scope} {objective} {init}"
|
392
407
|
return f"# var {decl.name} declared"
|
393
408
|
|
@@ -772,7 +787,7 @@ class MDLCompiler:
|
|
772
787
|
self._store_temp_command(f"scoreboard players operation @s {temp_var} = @s {left_temp}")
|
773
788
|
else:
|
774
789
|
# Assign from left value (score or literal)
|
775
|
-
if isinstance(expression.left, VariableSubstitution) or (isinstance(
|
790
|
+
if isinstance(expression.left, VariableSubstitution) or (isinstance(left_value, str) and left_value.startswith("score ")):
|
776
791
|
parts = str(left_value).split()
|
777
792
|
scope = parts[1]
|
778
793
|
obj = parts[2]
|
@@ -780,7 +795,7 @@ class MDLCompiler:
|
|
780
795
|
else:
|
781
796
|
self._store_temp_command(f"scoreboard players set @s {temp_var} {left_value}")
|
782
797
|
# Add right value
|
783
|
-
if isinstance(expression.right, VariableSubstitution) or (isinstance(
|
798
|
+
if isinstance(expression.right, VariableSubstitution) or (isinstance(right_value, str) and right_value.startswith("score ")):
|
784
799
|
parts = str(right_value).split()
|
785
800
|
scope = parts[1]
|
786
801
|
obj = parts[2]
|
@@ -792,7 +807,7 @@ class MDLCompiler:
|
|
792
807
|
if isinstance(expression.left, BinaryExpression):
|
793
808
|
self._store_temp_command(f"scoreboard players operation @s {temp_var} = @s {left_temp}")
|
794
809
|
else:
|
795
|
-
if isinstance(expression.left, VariableSubstitution) or (isinstance(
|
810
|
+
if isinstance(expression.left, VariableSubstitution) or (isinstance(left_value, str) and left_value.startswith("score ")):
|
796
811
|
parts = str(left_value).split()
|
797
812
|
scope = parts[1]
|
798
813
|
obj = parts[2]
|
@@ -800,7 +815,7 @@ class MDLCompiler:
|
|
800
815
|
else:
|
801
816
|
self._store_temp_command(f"scoreboard players set @s {temp_var} {left_value}")
|
802
817
|
# Subtract right value
|
803
|
-
if isinstance(expression.right, VariableSubstitution) or (isinstance(
|
818
|
+
if isinstance(expression.right, VariableSubstitution) or (isinstance(right_value, str) and right_value.startswith("score ")):
|
804
819
|
parts = str(right_value).split()
|
805
820
|
scope = parts[1]
|
806
821
|
obj = parts[2]
|
@@ -812,7 +827,7 @@ class MDLCompiler:
|
|
812
827
|
if isinstance(expression.left, BinaryExpression):
|
813
828
|
self._store_temp_command(f"scoreboard players operation @s {temp_var} = @s {left_temp}")
|
814
829
|
else:
|
815
|
-
if isinstance(expression.left, VariableSubstitution) or (isinstance(
|
830
|
+
if isinstance(expression.left, VariableSubstitution) or (isinstance(left_value, str) and left_value.startswith("score ")):
|
816
831
|
parts = str(left_value).split()
|
817
832
|
scope = parts[1]
|
818
833
|
obj = parts[2]
|
@@ -825,15 +840,27 @@ class MDLCompiler:
|
|
825
840
|
else:
|
826
841
|
# For literal values, keep explicit multiply command for compatibility
|
827
842
|
if isinstance(expression.right, LiteralExpression):
|
828
|
-
|
843
|
+
# Normalize number formatting (e.g., 2.0 -> 2)
|
844
|
+
literal_str = self._expression_to_value(expression.right)
|
845
|
+
self._store_temp_command(f"scoreboard players multiply @s {temp_var} {literal_str}")
|
829
846
|
else:
|
830
|
-
|
847
|
+
# If right_value is a score reference string, strip the leading 'score '
|
848
|
+
if isinstance(right_value, str) and right_value.startswith("score "):
|
849
|
+
parts = right_value.split()
|
850
|
+
if len(parts) >= 3:
|
851
|
+
scope = parts[1]
|
852
|
+
obj = parts[2]
|
853
|
+
self._store_temp_command(f"scoreboard players operation @s {temp_var} *= {scope} {obj}")
|
854
|
+
else:
|
855
|
+
self._store_temp_command(f"scoreboard players operation @s {temp_var} *= {right_value}")
|
856
|
+
else:
|
857
|
+
self._store_temp_command(f"scoreboard players operation @s {temp_var} *= {right_value}")
|
831
858
|
|
832
859
|
elif expression.operator == "DIVIDE":
|
833
860
|
if isinstance(expression.left, BinaryExpression):
|
834
861
|
self._store_temp_command(f"scoreboard players operation @s {temp_var} = @s {left_temp}")
|
835
862
|
else:
|
836
|
-
if isinstance(expression.left, VariableSubstitution) or (isinstance(
|
863
|
+
if isinstance(expression.left, VariableSubstitution) or (isinstance(left_value, str) and left_value.startswith("score ")):
|
837
864
|
parts = str(left_value).split()
|
838
865
|
scope = parts[1]
|
839
866
|
obj = parts[2]
|
@@ -846,9 +873,21 @@ class MDLCompiler:
|
|
846
873
|
else:
|
847
874
|
# For literal values, keep explicit divide command for compatibility
|
848
875
|
if isinstance(expression.right, LiteralExpression):
|
849
|
-
|
876
|
+
# Normalize number formatting (e.g., 2.0 -> 2)
|
877
|
+
literal_str = self._expression_to_value(expression.right)
|
878
|
+
self._store_temp_command(f"scoreboard players divide @s {temp_var} {literal_str}")
|
850
879
|
else:
|
851
|
-
|
880
|
+
# If right_value is a score reference string, strip the leading 'score '
|
881
|
+
if isinstance(right_value, str) and right_value.startswith("score "):
|
882
|
+
parts = right_value.split()
|
883
|
+
if len(parts) >= 3:
|
884
|
+
scope = parts[1]
|
885
|
+
obj = parts[2]
|
886
|
+
self._store_temp_command(f"scoreboard players operation @s {temp_var} /= {scope} {obj}")
|
887
|
+
else:
|
888
|
+
self._store_temp_command(f"scoreboard players operation @s {temp_var} /= {right_value}")
|
889
|
+
else:
|
890
|
+
self._store_temp_command(f"scoreboard players operation @s {temp_var} /= {right_value}")
|
852
891
|
else:
|
853
892
|
# For other operators, just set the value
|
854
893
|
self._store_temp_command(f"scoreboard players set @s {temp_var} 0")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version:
|
3
|
+
Version: 16.0.1
|
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=
|
2
|
+
minecraft_datapack_language/_version.py,sha256=ZniqvLp7I_Cd39Rx5z6PaEC-7V_QCrvxW5reRnIeFA8,706
|
3
3
|
minecraft_datapack_language/ast_nodes.py,sha256=UzUxKLkjBisUd5Gu7sAiNXIIPIjNoRzELq4LfIFcnSY,4290
|
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=
|
6
|
+
minecraft_datapack_language/mdl_compiler.py,sha256=onDGhy5c2eMsnxM4YCUQQfa4VuwY3aPaDBUYw85IfjE,44872
|
7
7
|
minecraft_datapack_language/mdl_errors.py,sha256=r0Gu3KhoX1YLPAVW_iO7Q_fPgaf_Dv9tOGSOdKNSzmw,16114
|
8
8
|
minecraft_datapack_language/mdl_lexer.py,sha256=dVwdgUmdQI7EJaFtoKZpq6rj5156YVjt44mMee-MDIs,23388
|
9
9
|
minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYaLDcGNRAl-RAI,17253
|
10
10
|
minecraft_datapack_language/mdl_parser.py,sha256=axyjdrcgqeOpbmWolasiIZAjV_RpFaP5QiafLPXAhms,25223
|
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-
|
14
|
-
minecraft_datapack_language-
|
15
|
-
minecraft_datapack_language-
|
16
|
-
minecraft_datapack_language-
|
17
|
-
minecraft_datapack_language-
|
18
|
-
minecraft_datapack_language-
|
13
|
+
minecraft_datapack_language-16.0.1.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
14
|
+
minecraft_datapack_language-16.0.1.dist-info/METADATA,sha256=eEm_rYUTS1iJ24dBbWEZzF5U1ytBuQR8iBOX0jotmAg,8343
|
15
|
+
minecraft_datapack_language-16.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
16
|
+
minecraft_datapack_language-16.0.1.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
17
|
+
minecraft_datapack_language-16.0.1.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
18
|
+
minecraft_datapack_language-16.0.1.dist-info/RECORD,,
|
{minecraft_datapack_language-15.4.43.dist-info → minecraft_datapack_language-16.0.1.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|