Skip to content

Commit c98b770

Browse files
committed
✨ Add a warning for calling the move function while auto update is enabled.
1 parent 80d9653 commit c98b770

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ IF (!auto_update_rig_orientation) {
147147

148148
execute at @s on passengers run tp @s ~ ~ ~ ~ ~
149149
}
150+
} ELSE {
151+
function move {
152+
tellraw @a <%TELLRAW.AUTO_UPDATE_RIG_ORIENTATION_MOVE_WARNING()%>
153+
}
150154
}
151155

152156
dir animations {

src/systems/datapackCompiler/tellraw.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,15 @@ const TELLRAW_PREFIX = () =>
1919
const TELLRAW_SUFFIX = () => '\n'
2020

2121
const TELLRAW_ERROR = (errorName: string, details: TextElement) =>
22-
new JsonText({
23-
text: '',
24-
color: 'red',
25-
extra: [
26-
TELLRAW_PREFIX(),
27-
'ᴇʀʀᴏʀ: ',
28-
{ text: errorName, underlined: true },
29-
'\n\n ',
30-
...(Array.isArray(details) ? details : [details]),
31-
TELLRAW_SUFFIX(),
32-
],
33-
})
22+
new JsonText([
23+
{ text: '', color: 'red' },
24+
TELLRAW_PREFIX(),
25+
'ᴇʀʀᴏʀ: ',
26+
{ text: errorName, underlined: true },
27+
'\n\n ',
28+
...(Array.isArray(details) ? details : [details]),
29+
TELLRAW_SUFFIX(),
30+
])
3431

3532
const CREATE_TELLRAW_HELP_LINK = (url: string) =>
3633
new JsonText([
@@ -281,6 +278,20 @@ namespace TELLRAW {
281278
'.',
282279
'\n Please ensure the command is valid.',
283280
])
281+
282+
export const AUTO_UPDATE_RIG_ORIENTATION_MOVE_WARNING = () =>
283+
TELLRAW_ERROR('Called Move Function while Auto Update Rig Orientation is Enabled', [
284+
'The ',
285+
{ text: 'move', color: 'yellow' },
286+
' function cannot be called while ',
287+
{ text: 'Auto Update Rig Orientation', color: 'yellow' },
288+
' is enabled.',
289+
'\n Please either disable ',
290+
{ text: 'Auto Update Rig Orientation', color: 'yellow' },
291+
' or avoid calling the ',
292+
{ text: 'move', color: 'yellow' },
293+
' function.',
294+
])
284295
}
285296

286297
export default TELLRAW

test-packs/1.20.4/blueprints/armor_stand_1.20.4.ajblueprint

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,7 +1851,7 @@
18511851
"override": false,
18521852
"length": 2,
18531853
"snapping": 20,
1854-
"selected": true,
1854+
"selected": false,
18551855
"saved": true,
18561856
"path": "",
18571857
"anim_time_update": "",
@@ -2027,7 +2027,7 @@
20272027
"override": false,
20282028
"length": 1,
20292029
"snapping": 20,
2030-
"selected": false,
2030+
"selected": true,
20312031
"saved": true,
20322032
"path": "",
20332033
"anim_time_update": "",

0 commit comments

Comments
 (0)