minecraft-datapack-language 15.1.55__py3-none-any.whl → 15.1.56__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 +43 -14
- {minecraft_datapack_language-15.1.55.dist-info → minecraft_datapack_language-15.1.56.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.1.55.dist-info → minecraft_datapack_language-15.1.56.dist-info}/RECORD +8 -8
- {minecraft_datapack_language-15.1.55.dist-info → minecraft_datapack_language-15.1.56.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.1.55.dist-info → minecraft_datapack_language-15.1.56.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.1.55.dist-info → minecraft_datapack_language-15.1.56.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.1.55.dist-info → minecraft_datapack_language-15.1.56.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.56'
|
32
|
+
__version_tuple__ = version_tuple = (15, 1, 56)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -310,14 +310,25 @@ def _process_statement(statement: Any, namespace: str, function_name: str, state
|
|
310
310
|
|
311
311
|
|
312
312
|
def _generate_function_file(ast: Dict[str, Any], output_dir: Path, namespace: str, verbose: bool = False, build_context: BuildContext = None) -> None:
|
313
|
-
"""Generate function files from the AST."""
|
313
|
+
"""Generate function files from the AST for a specific namespace."""
|
314
314
|
if build_context is None:
|
315
315
|
build_context = BuildContext()
|
316
316
|
|
317
317
|
if 'functions' not in ast:
|
318
318
|
return
|
319
319
|
|
320
|
+
# Filter functions by namespace
|
321
|
+
namespace_functions = []
|
320
322
|
for func in ast['functions']:
|
323
|
+
# Check if function belongs to this namespace
|
324
|
+
# For now, we'll generate all functions in all namespaces
|
325
|
+
# In the future, we could add namespace annotations to functions
|
326
|
+
namespace_functions.append(func)
|
327
|
+
|
328
|
+
if verbose:
|
329
|
+
print(f"DEBUG: Processing {len(namespace_functions)} functions for namespace {namespace}")
|
330
|
+
|
331
|
+
for func in namespace_functions:
|
321
332
|
func_name = func['name']
|
322
333
|
func_body = func.get('body', [])
|
323
334
|
|
@@ -724,29 +735,47 @@ def build_mdl(input_path: str, output_path: str, verbose: bool = False, pack_for
|
|
724
735
|
# Generate pack.mcmeta
|
725
736
|
_generate_pack_mcmeta(ast, output_dir)
|
726
737
|
|
727
|
-
#
|
728
|
-
|
729
|
-
|
738
|
+
# Handle multiple namespaces from multiple files
|
739
|
+
namespaces = []
|
740
|
+
|
741
|
+
# Get namespaces from AST
|
742
|
+
if 'namespaces' in ast:
|
743
|
+
for ns in ast['namespaces']:
|
744
|
+
if 'name' in ns:
|
745
|
+
namespaces.append(_slugify(ns['name']))
|
730
746
|
|
731
|
-
#
|
747
|
+
# If no explicit namespaces, use the pack name as default
|
748
|
+
if not namespaces:
|
749
|
+
default_namespace = ast.get('pack', {}).get('name', 'mdl_pack')
|
750
|
+
namespaces.append(_slugify(default_namespace))
|
751
|
+
|
752
|
+
# Debug: Show what namespaces we're using
|
732
753
|
if verbose:
|
733
|
-
print(f"DEBUG: AST
|
754
|
+
print(f"DEBUG: AST namespaces: {ast.get('namespaces', [])}")
|
734
755
|
print(f"DEBUG: AST pack: {ast.get('pack', {})}")
|
735
|
-
print(f"DEBUG: Using
|
756
|
+
print(f"DEBUG: Using namespaces: {namespaces}")
|
736
757
|
|
737
|
-
# Generate functions
|
758
|
+
# Generate functions for each namespace
|
738
759
|
build_context = BuildContext()
|
739
|
-
|
760
|
+
for namespace in namespaces:
|
761
|
+
if verbose:
|
762
|
+
print(f"DEBUG: Processing namespace: {namespace}")
|
763
|
+
_generate_function_file(ast, output_dir, namespace, verbose, build_context)
|
740
764
|
|
741
|
-
# Generate hook files (load/tick tags)
|
742
|
-
|
765
|
+
# Generate hook files (load/tick tags) - use first namespace for global functions
|
766
|
+
primary_namespace = namespaces[0] if namespaces else 'mdl_pack'
|
767
|
+
_generate_hook_files(ast, output_dir, primary_namespace, build_context)
|
743
768
|
|
744
|
-
# Generate global load function
|
745
|
-
_generate_global_load_function(ast, output_dir,
|
769
|
+
# Generate global load function - use first namespace for global functions
|
770
|
+
_generate_global_load_function(ast, output_dir, primary_namespace, build_context)
|
746
771
|
|
747
772
|
# Create zip file (always create one, use wrapper name if specified)
|
748
773
|
zip_name = wrapper if wrapper else output_dir.name
|
749
|
-
|
774
|
+
# When using wrapper, create zip in output directory; otherwise in parent directory
|
775
|
+
if wrapper:
|
776
|
+
zip_path = output_dir / f"{zip_name}.zip"
|
777
|
+
else:
|
778
|
+
zip_path = output_dir.parent / f"{zip_name}.zip"
|
750
779
|
_create_zip_file(output_dir, zip_path)
|
751
780
|
if verbose:
|
752
781
|
print(f"[ZIP] Created zip file: {zip_path}")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version: 15.1.
|
3
|
+
Version: 15.1.56
|
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=NjQZ_VQk7ObXSEZETeVAj46ARCqVlJIGL9t_gOTOncA,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=H_bjXj1Ch8A6CZ9yZWmeoXay6IiBQCSDxpRJozvCt-E,34048
|
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=Ng22mKVbMNC4412Xb09i8fcNFPTPrW4NxFeK7Tv7EBQ,38539
|
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.56.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
20
|
+
minecraft_datapack_language-15.1.56.dist-info/METADATA,sha256=vqfaptGPBT4zrlKxlQ3Vkrgirq72swYQtJstr8BWjQU,35230
|
21
|
+
minecraft_datapack_language-15.1.56.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
22
|
+
minecraft_datapack_language-15.1.56.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
23
|
+
minecraft_datapack_language-15.1.56.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
24
|
+
minecraft_datapack_language-15.1.56.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|