Skip to content
Merged

. #79

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datapacks/dataLib/data/datalib/dialog/input_prompt.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"action": {
"type": "minecraft:dynamic/run_command",
"template": "/function datalib:input/_private/dialog_capture {value:$(dl_input_text)}"
"template": "/function datalib:input/private/dialog_capture {value:$(dl_input_text)}"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
# Fast exit — nothing tagged, nothing to scan this tick.
execute unless entity @e[type=minecraft:command_block_minecart,tag=datalib_input] run return 0

execute as @e[type=minecraft:command_block_minecart,tag=datalib_input] run function datalib:input/_private/cbm_process
execute as @e[type=minecraft:command_block_minecart,tag=datalib_input] run function datalib:input/private/cbm_process

return 1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# e.g. 'execute as <player> run function datalib:input/dialog', or bound
# to a right-click/other trigger by the caller). Submitted text lands in
# datalib:input_prompt's action, which macro-calls
# datalib:input/_private/dialog_capture — capture only, no execution.
# datalib:input/private/dialog_capture — capture only, no execution.
#
# ASSUMPTION FLAGGED — CONFIRM WITH LEGENDS11:
# This function assumes the caller decides WHEN to open the dialog
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ======================================================================================
# datalib:input/_private/book_capture [INTERNAL — do not call directly]
# datalib:input/private/book_capture [INTERNAL — do not call directly]
# ======================================================================================
#
# Runs with @s bound to a single player holding the marked written_book.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ======================================================================================
# datalib:input/_private/cbm_align_tp [INTERNAL — call explicitly, not auto-ticked]
# datalib:input/private/cbm_align_tp [INTERNAL — call explicitly, not auto-ticked]
# ======================================================================================
#
# Legends11's tested pattern: teleports the executing player to the nearest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ======================================================================================
# datalib:input/_private/cbm_capture [INTERNAL — do not call directly]
# datalib:input/private/cbm_capture [INTERNAL — do not call directly]
# ======================================================================================
#
# Only reached when cbm_process confirmed Command is non-empty. Runs with
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ======================================================================================
# datalib:input/_private/cbm_process [INTERNAL — do not call directly]
# datalib:input/private/cbm_process [INTERNAL — do not call directly]
# ======================================================================================
#
# Runs with @s bound to a single tagged command_block_minecart. Reads its
Expand All @@ -13,4 +13,4 @@ data modify storage datalib:input _cbm.current set from entity @s Command

# Compare the actual VALUE to "" — a compound match, not a path-existence
# check. This is the fix for the false-positive-on-empty-Command bug.
execute unless data storage datalib:input {_cbm:{current:""}} run function datalib:input/_private/cbm_capture
execute unless data storage datalib:input {_cbm:{current:""}} run function datalib:input/private/cbm_capture
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ======================================================================================
# datalib:input/_private/dialog_capture [INTERNAL — do not call directly]
# datalib:input/private/dialog_capture [INTERNAL — do not call directly]
# ======================================================================================
#
# Called by the dialog system itself via its "run_command" action template
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
# Fast exit — skip entirely if no player is holding the marked book
execute unless entity @a[nbt={SelectedItem:{components:{"minecraft:custom_data":{dataLib:{input:1b}}}}}] run return 0

execute as @a[nbt={SelectedItem:{components:{"minecraft:custom_data":{dataLib:{input:1b}}}}}] run function datalib:input/_private/book_capture
execute as @a[nbt={SelectedItem:{components:{"minecraft:custom_data":{dataLib:{input:1b}}}}}] run function datalib:input/private/book_capture

return 1
2 changes: 1 addition & 1 deletion datapacks/dataLib/data/datalib/tags/function/loop.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"datalib:input/writable_book",
"datalib:input/command_block_minecart",
"datalib:core/internal/api/cmd/freeze/tick",
"datalib:input/_private/cbm_align_tp"
"datalib:input/private/cbm_align_tp"
]
}