Skip to content

Commit b15ccce

Browse files
committed
🩹 Fix incorrect storage name in tellraws
1 parent 4991f66 commit b15ccce

File tree

2 files changed

+32
-12
lines changed

2 files changed

+32
-12
lines changed

src/systems/datapackCompiler/tellraw.ts

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { TAGS } from './tags'
77
const TELLRAW_PREFIX = () =>
88
new JsonText([
99
{ text: '\n ', color: 'gray' },
10-
{ text: 'ᴀɴɪᴍᴀᴛᴇᴅ ᴊᴀᴠᴀ', color: '#00aced' },
10+
{ text: toSmallCaps('Animated Java'), color: '#00aced' },
1111
{
1212
text: `\n (animated_java:${Project!.animated_java.export_namespace})`,
1313
color: 'dark_gray',
@@ -22,13 +22,24 @@ const TELLRAW_ERROR = (errorName: string, details: TextElement) =>
2222
new JsonText([
2323
{ text: '', color: 'red' },
2424
TELLRAW_PREFIX(),
25-
'ᴇʀʀᴏʀ: ',
25+
toSmallCaps('error') + ': ',
2626
{ text: errorName, underlined: true },
2727
'\n\n ',
2828
...(Array.isArray(details) ? details : [details]),
2929
TELLRAW_SUFFIX(),
3030
])
3131

32+
const TELLRAW_WARNING = (warningName: string, details: TextElement) =>
33+
new JsonText([
34+
{ text: '', color: 'yellow' },
35+
TELLRAW_PREFIX(),
36+
toSmallCaps('warning') + ': ',
37+
{ text: warningName, underlined: true },
38+
'\n\n ',
39+
...(Array.isArray(details) ? details : [details]),
40+
TELLRAW_SUFFIX(),
41+
])
42+
3243
const CREATE_TELLRAW_HELP_LINK = (url: string) =>
3344
new JsonText([
3445
'\n\n ',
@@ -157,7 +168,7 @@ namespace TELLRAW {
157168
export const INVALID_VARIANT = (variants: Record<string, IRenderedVariant>) =>
158169
TELLRAW_ERROR('Invalid Variant', [
159170
'The variant ',
160-
{ nbt: 'args.variant', storage: 'aj:temp', color: 'yellow' },
171+
{ nbt: 'args.variant', storage: 'animated_java:temp', color: 'yellow' },
161172
' does not exist.',
162173
'\n ',
163174
{ text: ' ≡ ', color: 'white' },
@@ -181,7 +192,7 @@ namespace TELLRAW {
181192
export const INVALID_ANIMATION = (animations: IRenderedAnimation[]) =>
182193
TELLRAW_ERROR('Invalid Animation', [
183194
'The animation ',
184-
{ nbt: 'args.animation', storage: 'aj:temp', color: 'yellow' },
195+
{ nbt: 'args.animation', storage: 'animated_java:temp', color: 'yellow' },
185196
' does not exist.',
186197
'\n ',
187198
{ text: ' ≡ ', color: 'white' },
@@ -236,15 +247,15 @@ namespace TELLRAW {
236247
export const LOCATOR_NOT_FOUND = () =>
237248
TELLRAW_ERROR('Locator Not Found', [
238249
'Locator ',
239-
{ nbt: 'args.name', storage: 'aj:temp', color: 'aqua' },
250+
{ nbt: 'args.name', storage: 'animated_java:temp', color: 'aqua' },
240251
' not found!',
241252
'\n Please ensure that the name is spelled correctly.',
242253
])
243254

244255
export const LOCATOR_ENTITY_NOT_FOUND = () =>
245256
TELLRAW_ERROR('Locator Not Found', [
246257
'Locator ',
247-
{ nbt: 'args.name', storage: 'aj:temp', color: 'aqua' },
258+
{ nbt: 'args.name', storage: 'animated_java:temp', color: 'aqua' },
248259
' does not exist!',
249260
{ text: '\n Please ensure that the name is spelled correctly, and ' },
250261
{ text: '"Use Entity"', color: 'yellow' },
@@ -254,27 +265,27 @@ namespace TELLRAW {
254265
export const LOCATOR_COMMAND_FAILED_TO_EXECUTE = () =>
255266
TELLRAW_ERROR('Failed to Execute Command as Locator', [
256267
'Failed to execute command ',
257-
{ nbt: 'args.command', storage: 'aj:temp', color: 'yellow' },
268+
{ nbt: 'args.command', storage: 'animated_java:temp', color: 'yellow' },
258269
' as Locator ',
259-
{ nbt: 'args.name', storage: 'aj:temp', color: 'aqua' },
270+
{ nbt: 'args.name', storage: 'animated_java:temp', color: 'aqua' },
260271
'.',
261272
'\n Please ensure the command is valid.',
262273
])
263274

264275
export const CAMERA_ENTITY_NOT_FOUND = () =>
265276
TELLRAW_ERROR('Camera Not Found', [
266277
'Camera ',
267-
{ nbt: 'args.name', storage: 'aj:temp', color: 'aqua' },
278+
{ nbt: 'args.name', storage: 'animated_java:temp', color: 'aqua' },
268279
' does not exist!',
269280
'\n Please ensure that its name is spelled correctly.',
270281
])
271282

272283
export const CAMERA_COMMAND_FAILED_TO_EXECUTE = () =>
273284
TELLRAW_ERROR('Failed to Execute Command as Camera', [
274285
'Failed to execute command ',
275-
{ nbt: 'args.command', storage: 'aj:temp', color: 'yellow' },
286+
{ nbt: 'args.command', storage: 'animated_java:temp', color: 'yellow' },
276287
' as Camera ',
277-
{ nbt: 'args.name', storage: 'aj:temp', color: 'aqua' },
288+
{ nbt: 'args.name', storage: 'animated_java:temp', color: 'aqua' },
278289
'.',
279290
'\n Please ensure the command is valid.',
280291
])
@@ -292,6 +303,15 @@ namespace TELLRAW {
292303
{ text: 'move', color: 'yellow' },
293304
' function.',
294305
])
306+
307+
export const DEPRECATED_FUNCTION_WARNING = (functionName: string, alternative: string) =>
308+
TELLRAW_WARNING('Deprecated Function', [
309+
'The function ',
310+
{ text: functionName, color: 'aqua' },
311+
' is deprecated.\nPlease use ',
312+
{ text: alternative, color: 'aqua' },
313+
' instead.',
314+
])
295315
}
296316

297317
export default TELLRAW

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"meta": {
33
"format": "animated-java:format/blueprint",
4-
"format_version": "1.8.0",
4+
"format_version": "1.8.0-beta.1",
55
"uuid": "167b27cd-b559-3f13-a97c-0841fe21f1d1",
66
"save_location": "D:\\github-repos\\animated-java\\old-animated-java\\test-packs\\1.20.4\\blueprints\\armor_stand_1.20.4.ajblueprint",
77
"last_used_export_namespace": "armor_stand"

0 commit comments

Comments
 (0)