Skip to content

Commit 2dce027

Browse files
committed
🛠️ Static Export Locator / Camera Fixes
- Fixed use entity locators and cameras not summoning properly in static mode
1 parent 66986b7 commit 2dce027

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

src/systems/datapackCompiler/1.20.4/static.mcb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ dir <%export_namespace%> {
229229
tag @s remove <%TAGS.NEW()%>
230230

231231
function *global/internal/gu/convert_uuid_array_to_string with entity @s
232+
tp @s \
233+
^<%roundTo(locator.default_transform.pos[0], 10)%> \
234+
^<%roundTo(locator.default_transform.pos[1], 10)%> \
235+
^<%roundTo(locator.default_transform.pos[2], 10)%> \
236+
~<%roundTo(locator.default_transform.head_rot[1], 10)%> \
237+
~<%roundTo(locator.default_transform.head_rot[0], 10)%>
232238
<%%
233239
if (locator.config.summon_commands) {
234240
emit.mcb(locator.config.summon_commands)
@@ -245,6 +251,12 @@ dir <%export_namespace%> {
245251
tag @s remove <%TAGS.NEW()%>
246252

247253
function *global/internal/gu/convert_uuid_array_to_string with entity @s
254+
tp @s \
255+
^<%roundTo(camera.default_transform.pos[0], 10)%> \
256+
^<%roundTo(camera.default_transform.pos[1], 10)%> \
257+
^<%roundTo(camera.default_transform.pos[2], 10)%> \
258+
~<%roundTo(camera.default_transform.head_rot[1], 10)%> \
259+
~<%roundTo(camera.default_transform.head_rot[0], 10)%>
248260
}
249261
data modify entity @s data.cameras.<%camera.name%>.uuid set from storage aj:uuid main.out
250262
}

src/systems/datapackCompiler/1.20.5/static.mcb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ dir <%export_namespace%> {
229229
tag @s remove <%TAGS.NEW()%>
230230

231231
function *global/internal/gu/convert_uuid_array_to_string with entity @s
232+
tp @s \
233+
^<%roundTo(locator.default_transform.pos[0], 10)%> \
234+
^<%roundTo(locator.default_transform.pos[1], 10)%> \
235+
^<%roundTo(locator.default_transform.pos[2], 10)%> \
236+
~<%roundTo(locator.default_transform.head_rot[1], 10)%> \
237+
~<%roundTo(locator.default_transform.head_rot[0], 10)%>
232238
<%%
233239
if (locator.config.summon_commands) {
234240
emit.mcb(locator.config.summon_commands)
@@ -245,6 +251,12 @@ dir <%export_namespace%> {
245251
tag @s remove <%TAGS.NEW()%>
246252

247253
function *global/internal/gu/convert_uuid_array_to_string with entity @s
254+
tp @s \
255+
^<%roundTo(camera.default_transform.pos[0], 10)%> \
256+
^<%roundTo(camera.default_transform.pos[1], 10)%> \
257+
^<%roundTo(camera.default_transform.pos[2], 10)%> \
258+
~<%roundTo(camera.default_transform.head_rot[1], 10)%> \
259+
~<%roundTo(camera.default_transform.head_rot[0], 10)%>
248260
}
249261
data modify entity @s data.cameras.<%camera.name%>.uuid set from storage aj:uuid main.out
250262
}

src/systems/datapackCompiler/1.21.2/static.mcb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ dir <%export_namespace%> {
174174
}
175175
}
176176
# Rotation Logic
177-
execute at @s on passengers run tp @s ~ ~ ~ ~ ~
177+
execute at @s on passengers run rotate @s ~ ~
178178
IF (root_ticking_commands) {
179179
<%%
180180
emit.mcb(root_ticking_commands)
@@ -224,11 +224,17 @@ dir <%export_namespace%> {
224224

225225
REPEAT (Object.values(rig.nodes).filter(v => v.type === 'locator')) as locator {
226226
IF (locator.config && locator.config.use_entity) {
227-
summon <%locator.config.entity_type%> ~ ~ ~ {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.LOCAL_LOCATOR(export_namespace, locator.name)%>']}
227+
summon <%locator.config.entity_type%> ^<%locator.default_transform.pos[0]%> ^<%locator.default_transform.pos[1]%> ^<%locator.default_transform.pos[2]%> {Tags:['<%TAGS.NEW()%>', '<%TAGS.GLOBAL_LOCATOR()%>', '<%TAGS.PROJECT_LOCATOR(export_namespace)%>', '<%TAGS.LOCAL_LOCATOR(export_namespace, locator.name)%>']}
228228
execute as @e[type=<%locator.config.entity_type%>,tag=<%TAGS.NEW()%>,tag=<%TAGS.GLOBAL_LOCATOR()%>,limit=1,distance=..0.01] run {
229229
tag @s remove <%TAGS.NEW()%>
230230

231231
function *global/internal/gu/convert_uuid_array_to_string with entity @s
232+
tp @s \
233+
^<%roundTo(locator.default_transform.pos[0], 10)%> \
234+
^<%roundTo(locator.default_transform.pos[1], 10)%> \
235+
^<%roundTo(locator.default_transform.pos[2], 10)%> \
236+
~<%roundTo(locator.default_transform.head_rot[1], 10)%> \
237+
~<%roundTo(locator.default_transform.head_rot[0], 10)%>
232238
<%%
233239
if (locator.config.summon_commands) {
234240
emit.mcb(locator.config.summon_commands)
@@ -245,6 +251,12 @@ dir <%export_namespace%> {
245251
tag @s remove <%TAGS.NEW()%>
246252

247253
function *global/internal/gu/convert_uuid_array_to_string with entity @s
254+
tp @s \
255+
^<%roundTo(camera.default_transform.pos[0], 10)%> \
256+
^<%roundTo(camera.default_transform.pos[1], 10)%> \
257+
^<%roundTo(camera.default_transform.pos[2], 10)%> \
258+
~<%roundTo(camera.default_transform.head_rot[1], 10)%> \
259+
~<%roundTo(camera.default_transform.head_rot[0], 10)%>
248260
}
249261
data modify entity @s data.cameras.<%camera.name%>.uuid set from storage aj:uuid main.out
250262
}
@@ -286,7 +298,7 @@ dir <%export_namespace%> {
286298
function *<%export_namespace%>/set_default_pose
287299

288300
tp @s ~ ~ ~ ~ ~
289-
execute at @s on passengers run tp @s ~ ~ ~ ~ ~
301+
execute at @s on passengers run rotate @s ~ ~
290302
data modify entity @s teleport_duration set value <%teleportation_duration%>
291303
execute on passengers run data modify entity @s teleport_duration set value <%teleportation_duration%>
292304
# Custom Summon Commands

0 commit comments

Comments
 (0)