minecraft-datapack-language 15.3.19__py3-none-any.whl → 15.3.21__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 +31 -4
- minecraft_datapack_language/cli_new.py +44 -43
- {minecraft_datapack_language-15.3.19.dist-info → minecraft_datapack_language-15.3.21.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.3.19.dist-info → minecraft_datapack_language-15.3.21.dist-info}/RECORD +9 -9
- {minecraft_datapack_language-15.3.19.dist-info → minecraft_datapack_language-15.3.21.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.3.19.dist-info → minecraft_datapack_language-15.3.21.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.3.19.dist-info → minecraft_datapack_language-15.3.21.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.3.19.dist-info → minecraft_datapack_language-15.3.21.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.3.
|
32
|
-
__version_tuple__ = version_tuple = (15, 3,
|
31
|
+
__version__ = version = '15.3.21'
|
32
|
+
__version_tuple__ = version_tuple = (15, 3, 21)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -581,13 +581,32 @@ def _generate_hook_files(ast: Dict[str, Any], output_dir: Path, namespace: str,
|
|
581
581
|
if hook['hook_type'] == 'load':
|
582
582
|
load_values.append(hook['function_name'])
|
583
583
|
|
584
|
-
# Add pack-specific load function if pack name is available
|
584
|
+
# Add pack-specific load function if pack name is available and different from namespace
|
585
585
|
if 'pack' in ast and 'name' in ast['pack']:
|
586
586
|
pack_name = ast['pack']['name']
|
587
|
-
|
587
|
+
pack_load_function = f"{pack_name}:load"
|
588
|
+
# Debug: Show what we're checking
|
589
|
+
print(f"DEBUG: Pack name: {pack_name}, pack_load_function: {pack_load_function}")
|
590
|
+
print(f"DEBUG: Current load_values: {load_values}")
|
591
|
+
print(f"DEBUG: Is pack_load_function in load_values? {pack_load_function in load_values}")
|
592
|
+
# Only add if it's not already in the list (avoids duplicates when pack name == namespace)
|
593
|
+
if pack_load_function not in load_values:
|
594
|
+
load_values.append(pack_load_function)
|
595
|
+
print(f"DEBUG: Added pack load function: {pack_load_function}")
|
596
|
+
else:
|
597
|
+
# Debug: This should prevent duplicates
|
598
|
+
print(f"DEBUG: Skipping duplicate pack load function: {pack_load_function}")
|
599
|
+
|
600
|
+
# Remove duplicates while preserving order
|
601
|
+
seen = set()
|
602
|
+
unique_load_values = []
|
603
|
+
for value in load_values:
|
604
|
+
if value not in seen:
|
605
|
+
seen.add(value)
|
606
|
+
unique_load_values.append(value)
|
588
607
|
|
589
608
|
load_tag_content = {
|
590
|
-
"values":
|
609
|
+
"values": unique_load_values
|
591
610
|
}
|
592
611
|
write_json(str(load_tag_dir / "load.json"), load_tag_content)
|
593
612
|
|
@@ -599,8 +618,16 @@ def _generate_hook_files(ast: Dict[str, Any], output_dir: Path, namespace: str,
|
|
599
618
|
tick_functions.append(f"{namespace}:{func['name']}")
|
600
619
|
|
601
620
|
if tick_functions:
|
621
|
+
# Remove duplicates while preserving order
|
622
|
+
seen = set()
|
623
|
+
unique_tick_functions = []
|
624
|
+
for value in tick_functions:
|
625
|
+
if value not in seen:
|
626
|
+
seen.add(value)
|
627
|
+
unique_tick_functions.append(value)
|
628
|
+
|
602
629
|
tick_tag_content = {
|
603
|
-
"values":
|
630
|
+
"values": unique_tick_functions
|
604
631
|
}
|
605
632
|
write_json(str(load_tag_dir / "tick.json"), tick_tag_content)
|
606
633
|
|
@@ -86,51 +86,51 @@ namespace "{pack_name}";
|
|
86
86
|
var num score = 0;
|
87
87
|
var num lives = 3;
|
88
88
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
// Example conditional statement
|
102
|
-
if "$score$ > 5" {{
|
103
|
-
say Great score!;
|
104
|
-
}} else {{
|
105
|
-
say Keep trying!;
|
106
|
-
}};
|
107
|
-
|
108
|
-
// Example while loop
|
109
|
-
while "$lives$ > 0" {{
|
110
|
-
say You have $lives$ lives remaining;
|
111
|
-
lives = lives - 1;
|
112
|
-
}};
|
113
|
-
|
114
|
-
say Game over!;
|
115
|
-
}}
|
89
|
+
// Main function - this runs when called
|
90
|
+
function "main" {{
|
91
|
+
say Hello from {project_name}!;
|
92
|
+
|
93
|
+
// Set initial values
|
94
|
+
score = 10;
|
95
|
+
lives = 3;
|
96
|
+
|
97
|
+
// Display current values
|
98
|
+
say Score: $score$;
|
99
|
+
say Lives: $lives$;
|
116
100
|
|
117
|
-
//
|
118
|
-
|
119
|
-
say
|
120
|
-
|
121
|
-
|
101
|
+
// Example conditional statement
|
102
|
+
if "$score$ > 5" {{
|
103
|
+
say Great score!;
|
104
|
+
}} else {{
|
105
|
+
say Keep trying!;
|
106
|
+
}};
|
122
107
|
|
123
|
-
//
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
}}
|
108
|
+
// Example while loop
|
109
|
+
while "$lives$ > 0" {{
|
110
|
+
say You have $lives$ lives remaining;
|
111
|
+
lives = lives - 1;
|
112
|
+
}};
|
128
113
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
114
|
+
say Game over!;
|
115
|
+
}}
|
116
|
+
|
117
|
+
// Init function - this runs when the datapack loads
|
118
|
+
function "init" {{
|
119
|
+
say [GAME] {pack_name} loaded successfully!;
|
120
|
+
say Type: /function {project_name}:main;
|
121
|
+
}}
|
122
|
+
|
123
|
+
// Tick function - this runs every tick (20 times per second)
|
124
|
+
function "tick" {{
|
125
|
+
// Add your tick logic here
|
126
|
+
// Be careful with performance!
|
127
|
+
}}
|
128
|
+
|
129
|
+
// Example function with parameters
|
130
|
+
function "greet_player" {{
|
131
|
+
say Welcome to {pack_name}!;
|
132
|
+
say Have fun playing!;
|
133
|
+
}}
|
134
134
|
|
135
135
|
// Raw Minecraft commands example
|
136
136
|
$!raw
|
@@ -149,7 +149,8 @@ raw!$
|
|
149
149
|
// Example advancement (optional)
|
150
150
|
// advancement "first_diamond" "first_diamond.json";
|
151
151
|
|
152
|
-
|
152
|
+
// Hook the init function to run when the datapack loads
|
153
|
+
on_load "{project_name}:init";
|
153
154
|
'''
|
154
155
|
|
155
156
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version: 15.3.
|
3
|
+
Version: 15.3.21
|
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,11 +1,11 @@
|
|
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=k2E1Idksg59IThqhTTqxE4KeyIbLfNCm0q9-lUKo9lY,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=ZEcZfPtXlvE3JGnm5eNjuFqcf4FEFHYTshr_3mZanjM,48132
|
6
6
|
minecraft_datapack_language/cli_check.py,sha256=bPq9gHsxQ1CIiftkrAtRCifWkVAyjp5c8Oay2NNQ1qs,6277
|
7
7
|
minecraft_datapack_language/cli_help.py,sha256=jUTHUQBONAZKVTdQK9tNPXq4c_6xpsafNOvHDjkEldg,12243
|
8
|
-
minecraft_datapack_language/cli_new.py,sha256=
|
8
|
+
minecraft_datapack_language/cli_new.py,sha256=Uw-xuW6KTTRTeOsnS3wgoZnna7xA203SM8qvUUDFHTk,8112
|
9
9
|
minecraft_datapack_language/cli_utils.py,sha256=nl22j96vpCW0XRMpD_zjwamnMU4e4LXEjACsnwiFGzs,9931
|
10
10
|
minecraft_datapack_language/dir_map.py,sha256=HmxFkuvWGkzHF8o_GFb4BpuMCRc6QMw8UbmcAI8JVdY,1788
|
11
11
|
minecraft_datapack_language/expression_processor.py,sha256=GN6cuRNvgI8TrV6YnEHrA9P0X-ACTT7rCBh4WlOPjSI,20140
|
@@ -16,9 +16,9 @@ minecraft_datapack_language/mdl_linter.py,sha256=z85xoAglENurCh30bR7kEHZ_JeMxcYa
|
|
16
16
|
minecraft_datapack_language/mdl_parser_js.py,sha256=SQzc67pKls3NVnQaT0xIILGqpZYAmcZn78TQ0KIM4TE,40216
|
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.3.
|
20
|
-
minecraft_datapack_language-15.3.
|
21
|
-
minecraft_datapack_language-15.3.
|
22
|
-
minecraft_datapack_language-15.3.
|
23
|
-
minecraft_datapack_language-15.3.
|
24
|
-
minecraft_datapack_language-15.3.
|
19
|
+
minecraft_datapack_language-15.3.21.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
20
|
+
minecraft_datapack_language-15.3.21.dist-info/METADATA,sha256=ulWsrfkEf74jhrqcACd6GVt7xob8ygbjH1SdW7YrxvM,35230
|
21
|
+
minecraft_datapack_language-15.3.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
22
|
+
minecraft_datapack_language-15.3.21.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
23
|
+
minecraft_datapack_language-15.3.21.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
24
|
+
minecraft_datapack_language-15.3.21.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|