minecraft-datapack-language 15.1.80__py3-none-any.whl → 15.1.81__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 +26 -13
- {minecraft_datapack_language-15.1.80.dist-info → minecraft_datapack_language-15.1.81.dist-info}/METADATA +1 -1
- {minecraft_datapack_language-15.1.80.dist-info → minecraft_datapack_language-15.1.81.dist-info}/RECORD +8 -8
- {minecraft_datapack_language-15.1.80.dist-info → minecraft_datapack_language-15.1.81.dist-info}/WHEEL +0 -0
- {minecraft_datapack_language-15.1.80.dist-info → minecraft_datapack_language-15.1.81.dist-info}/entry_points.txt +0 -0
- {minecraft_datapack_language-15.1.80.dist-info → minecraft_datapack_language-15.1.81.dist-info}/licenses/LICENSE +0 -0
- {minecraft_datapack_language-15.1.80.dist-info → minecraft_datapack_language-15.1.81.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.81'
|
32
|
+
__version_tuple__ = version_tuple = (15, 1, 81)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -237,20 +237,35 @@ def _process_say_command_with_variables(content: str, selector: str) -> str:
|
|
237
237
|
# No variables, return simple tellraw
|
238
238
|
return f'tellraw @a [{{"text":"{content}"}}]'
|
239
239
|
|
240
|
-
#
|
241
|
-
|
240
|
+
# Use re.sub to replace variables with placeholders, then split by placeholders
|
241
|
+
# This avoids the issue with re.split including captured groups
|
242
|
+
placeholder_content = content
|
243
|
+
var_placeholders = []
|
244
|
+
|
245
|
+
for i, match in enumerate(matches):
|
246
|
+
placeholder = f"__VAR_{i}__"
|
247
|
+
var_placeholders.append((placeholder, match))
|
248
|
+
placeholder_content = placeholder_content.replace(f"${match}$", placeholder, 1)
|
249
|
+
|
250
|
+
# Split by placeholders to get text parts
|
251
|
+
text_parts = placeholder_content
|
252
|
+
for placeholder, var_name in var_placeholders:
|
253
|
+
text_parts = text_parts.replace(placeholder, f"|{var_name}|")
|
254
|
+
|
255
|
+
# Now split by the pipe delimiters
|
256
|
+
parts = text_parts.split('|')
|
242
257
|
|
243
258
|
# Build tellraw components
|
244
259
|
components = []
|
245
|
-
var_index = 0
|
246
260
|
|
247
261
|
for i, part in enumerate(parts):
|
248
|
-
if
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
262
|
+
if i % 2 == 0:
|
263
|
+
# Text part
|
264
|
+
if part: # Add text component if not empty
|
265
|
+
components.append(f'{{"text":"{part}"}}')
|
266
|
+
else:
|
267
|
+
# Variable part
|
268
|
+
var_name = part
|
254
269
|
|
255
270
|
# Check if variable has scope selector
|
256
271
|
if '<' in var_name and var_name.endswith('>'):
|
@@ -262,8 +277,6 @@ def _process_say_command_with_variables(content: str, selector: str) -> str:
|
|
262
277
|
else:
|
263
278
|
# Simple variable: $variable$ - use server armor stand
|
264
279
|
components.append(f'{{"score":{{"name":"@e[type=armor_stand,tag=mdl_server,limit=1]","objective":"{var_name}"}}}}')
|
265
|
-
|
266
|
-
var_index += 1
|
267
280
|
|
268
281
|
# Combine all components
|
269
282
|
components_str = ','.join(components)
|
@@ -604,8 +617,8 @@ def _process_while_loop_recursion(while_statement, namespace: str, function_name
|
|
604
617
|
body = while_statement['body']
|
605
618
|
|
606
619
|
# Generate unique function names
|
607
|
-
loop_func_name = f"{function_name}_while_{statement_index}"
|
608
|
-
loop_body_func_name = f"{function_name}
|
620
|
+
loop_func_name = f"{namespace}_{function_name}_while_{statement_index}"
|
621
|
+
loop_body_func_name = f"{namespace}_{function_name}_while_{statement_index}"
|
609
622
|
|
610
623
|
# Process loop body
|
611
624
|
body_commands = []
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: minecraft-datapack-language
|
3
|
-
Version: 15.1.
|
3
|
+
Version: 15.1.81
|
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=PouTZRlXiJiT85KKzWG-K7UwauiTv-ftV3RaLTyPh64,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=aPlyB5DKoafCpxbFl597kR5-m3eP1YGqtsKOqrQD68Y,42212
|
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.81.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
20
|
+
minecraft_datapack_language-15.1.81.dist-info/METADATA,sha256=ewdotxZ8pwgR6MIp3oHVTvZDPIORWkLlGKv5mrJfFqw,35230
|
21
|
+
minecraft_datapack_language-15.1.81.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
22
|
+
minecraft_datapack_language-15.1.81.dist-info/entry_points.txt,sha256=c6vjBeCiyQflvPHBRyBk2nJCSfYt3Oc7Sc9V87ySi_U,108
|
23
|
+
minecraft_datapack_language-15.1.81.dist-info/top_level.txt,sha256=ADtFI476tbKLLxEAA-aJQAfg53MA3k_DOb0KTFiggfw,28
|
24
|
+
minecraft_datapack_language-15.1.81.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|