@terrafirmagreg-team/dump 0.0.0-stage → 1.2.0
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.
- package/package.json +28 -3
- package/src/lib/dump/assets/atlas/dto.ts +51 -0
- package/src/lib/dump/assets/atlas/lookup.ts +207 -0
- package/src/lib/dump/assets/atlas/sprites.ts +132 -0
- package/src/lib/dump/assets/lang/load.ts +19 -0
- package/src/lib/dump/assets/lang/names.ts +244 -0
- package/src/lib/dump/assets/urls.ts +145 -0
- package/src/lib/dump/client/atlases.ts +85 -0
- package/src/lib/dump/client/dump.ts +132 -0
- package/src/lib/dump/client/groups.ts +27 -0
- package/src/lib/dump/client/keybinds.ts +16 -0
- package/src/lib/dump/client/mods.ts +18 -0
- package/src/lib/dump/client/registry.ts +121 -0
- package/src/lib/dump/client/tabs.ts +23 -0
- package/src/lib/dump/client/tags.ts +59 -0
- package/src/lib/dump/contract/kind.ts +62 -0
- package/src/lib/dump/contract/read.ts +76 -0
- package/src/lib/dump/contract/ref.ts +260 -0
- package/src/lib/dump/contract/text.ts +101 -0
- package/src/lib/dump/data/registry/dto.ts +57 -0
- package/src/lib/dump/data/registry/parse.ts +291 -0
- package/src/lib/dump/data/tab/dto.ts +14 -0
- package/src/lib/dump/data/tab/parse.ts +27 -0
- package/src/lib/dump/data/tag/dto.ts +8 -0
- package/src/lib/dump/data/tag/parse.ts +58 -0
- package/src/lib/dump/gen/data/guides/book.ts +57 -0
- package/src/lib/dump/gen/data/guides/category.ts +31 -0
- package/src/lib/dump/gen/data/guides/entry.ts +49 -0
- package/src/lib/dump/gen/data/models/model.ts +4 -0
- package/src/lib/dump/gen/data/quests/chapter.ts +127 -0
- package/src/lib/dump/gen/data/quests/chapter_groups.ts +12 -0
- package/src/lib/dump/gen/data/quests/data.ts +41 -0
- package/src/lib/dump/gen/data/recipes/recipe.ts +79 -0
- package/src/lib/dump/gen/index.ts +21 -0
- package/src/lib/dump/gen/keybinds.ts +4 -0
- package/src/lib/dump/gen/lang.ts +4 -0
- package/src/lib/dump/gen/manifest.ts +60 -0
- package/src/lib/dump/gen/registry/blocks.ts +61 -0
- package/src/lib/dump/gen/registry/entities.ts +50 -0
- package/src/lib/dump/gen/registry/fluids.ts +49 -0
- package/src/lib/dump/gen/registry/groups.ts +15 -0
- package/src/lib/dump/gen/registry/items.ts +52 -0
- package/src/lib/dump/gen/registry/recipe_categories.ts +65 -0
- package/src/lib/dump/gen/registry/recipes.ts +4 -0
- package/src/lib/dump/gen/registry/tabs.ts +47 -0
- package/src/lib/dump/gen/registry/tags.ts +12 -0
- package/src/lib/dump/json-reader.ts +254 -0
- package/src/lib/dump/manifest/dto.ts +12 -0
- package/src/lib/dump/manifest/parse.ts +168 -0
- package/src/lib/dump/mods/dto.ts +31 -0
- package/src/lib/dump/mods/index.ts +97 -0
- package/src/lib/dump/mods/load.ts +60 -0
- package/src/lib/dump/paths.ts +172 -0
- package/src/lib/dump/reader.ts +31 -0
- package/src/lib/dump-search.ts +125 -0
- package/src/lib/snbt.ts +247 -0
- package/README.md +0 -3
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import {
|
|
2
|
+
asEdgeList,
|
|
3
|
+
asNumber,
|
|
4
|
+
asRecord,
|
|
5
|
+
asString,
|
|
6
|
+
asStringList,
|
|
7
|
+
} from '@terrafirmagreg-team/dump/lib/dump/contract/read';
|
|
8
|
+
import {
|
|
9
|
+
asNbt,
|
|
10
|
+
asTaggedReference,
|
|
11
|
+
nbtSpecificity,
|
|
12
|
+
type DumpNbt,
|
|
13
|
+
} from '@terrafirmagreg-team/dump/lib/dump/contract/ref';
|
|
14
|
+
import { formatNbt } from '@terrafirmagreg-team/dump/lib/snbt';
|
|
15
|
+
import { asDisplay, type DumpDisplay } from '@terrafirmagreg-team/dump/lib/dump/contract/text';
|
|
16
|
+
import type {
|
|
17
|
+
DumpBlockEntry,
|
|
18
|
+
DumpEntityEntry,
|
|
19
|
+
DumpEntryVariant,
|
|
20
|
+
DumpFluidEntry,
|
|
21
|
+
DumpItemEntry,
|
|
22
|
+
DumpRegistryEntry,
|
|
23
|
+
DumpRegistryKind,
|
|
24
|
+
SpriteEntry,
|
|
25
|
+
} from '@terrafirmagreg-team/dump/lib/dump/data/registry/dto';
|
|
26
|
+
|
|
27
|
+
export function asSpriteEntry(value: unknown): SpriteEntry | undefined {
|
|
28
|
+
const row = asRecord(value);
|
|
29
|
+
if (!row) return undefined;
|
|
30
|
+
const image = asString(row.image);
|
|
31
|
+
const x = asNumber(row.x);
|
|
32
|
+
const y = asNumber(row.y);
|
|
33
|
+
const w = asNumber(row.w);
|
|
34
|
+
const h = asNumber(row.h);
|
|
35
|
+
const pw = asNumber(row.pw);
|
|
36
|
+
const ph = asNumber(row.ph);
|
|
37
|
+
if (
|
|
38
|
+
!image ||
|
|
39
|
+
x === undefined ||
|
|
40
|
+
y === undefined ||
|
|
41
|
+
w === undefined ||
|
|
42
|
+
h === undefined ||
|
|
43
|
+
pw === undefined ||
|
|
44
|
+
ph === undefined
|
|
45
|
+
) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const tint = asString(row.tint);
|
|
49
|
+
const tintColor = asString(row.tintColor);
|
|
50
|
+
return {
|
|
51
|
+
image,
|
|
52
|
+
x,
|
|
53
|
+
y,
|
|
54
|
+
w,
|
|
55
|
+
h,
|
|
56
|
+
pw,
|
|
57
|
+
ph,
|
|
58
|
+
...(tint ? { tint } : {}),
|
|
59
|
+
...(tintColor ? { tintColor } : {}),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function asVariant(value: unknown): DumpEntryVariant | undefined {
|
|
64
|
+
const row = asRecord(value);
|
|
65
|
+
if (!row) return undefined;
|
|
66
|
+
const tag = asNbt(row.tag);
|
|
67
|
+
if (tag === undefined) return undefined;
|
|
68
|
+
const display = asDisplay(row.display);
|
|
69
|
+
const sprite = asSpriteEntry(row.sprite);
|
|
70
|
+
const texture = asString(row.texture);
|
|
71
|
+
const model = asString(row.model);
|
|
72
|
+
return {
|
|
73
|
+
tag,
|
|
74
|
+
...(display ? { display } : {}),
|
|
75
|
+
...(sprite ? { sprite } : {}),
|
|
76
|
+
...(texture ? { texture } : {}),
|
|
77
|
+
...(model ? { model } : {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function asVariants(value: unknown): DumpEntryVariant[] | undefined {
|
|
82
|
+
if (!Array.isArray(value)) return undefined;
|
|
83
|
+
const out = value.flatMap((item) => {
|
|
84
|
+
const variant = asVariant(item);
|
|
85
|
+
return variant ? [variant] : [];
|
|
86
|
+
});
|
|
87
|
+
return out.length ? out : undefined;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const EXACT_SAFE_MAX_KEYS = 99;
|
|
91
|
+
|
|
92
|
+
const variantExactIndex = new WeakMap<
|
|
93
|
+
DumpEntryVariant[],
|
|
94
|
+
{ byTag: Map<string, DumpEntryVariant>; maxTagKeys: number }
|
|
95
|
+
>();
|
|
96
|
+
|
|
97
|
+
function exactVariantIndex(variants: DumpEntryVariant[]) {
|
|
98
|
+
let index = variantExactIndex.get(variants);
|
|
99
|
+
if (!index) {
|
|
100
|
+
const byTag = new Map<string, DumpEntryVariant>();
|
|
101
|
+
let maxTagKeys = 0;
|
|
102
|
+
for (const variant of variants) {
|
|
103
|
+
if (variant.tag === undefined) continue;
|
|
104
|
+
const keyCount =
|
|
105
|
+
variant.tag !== null &&
|
|
106
|
+
typeof variant.tag === 'object' &&
|
|
107
|
+
!Array.isArray(variant.tag)
|
|
108
|
+
? Object.keys(variant.tag).length
|
|
109
|
+
: 0;
|
|
110
|
+
if (keyCount > maxTagKeys) maxTagKeys = keyCount;
|
|
111
|
+
const key = formatNbt(variant.tag);
|
|
112
|
+
if (key !== undefined && !byTag.has(key)) byTag.set(key, variant);
|
|
113
|
+
}
|
|
114
|
+
index = { byTag, maxTagKeys };
|
|
115
|
+
variantExactIndex.set(variants, index);
|
|
116
|
+
}
|
|
117
|
+
return index;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function matchVariant(
|
|
121
|
+
variants: DumpEntryVariant[] | undefined,
|
|
122
|
+
nbt: DumpNbt | undefined,
|
|
123
|
+
): DumpEntryVariant | undefined {
|
|
124
|
+
if (!variants?.length) return undefined;
|
|
125
|
+
if (nbt === undefined) {
|
|
126
|
+
return variants.find((variant) => variant.tag === undefined);
|
|
127
|
+
}
|
|
128
|
+
const key = formatNbt(nbt);
|
|
129
|
+
const index =
|
|
130
|
+
variants.length > 16 && key !== undefined
|
|
131
|
+
? exactVariantIndex(variants)
|
|
132
|
+
: undefined;
|
|
133
|
+
if (index && index.maxTagKeys <= EXACT_SAFE_MAX_KEYS && key !== undefined) {
|
|
134
|
+
const exact = index.byTag.get(key);
|
|
135
|
+
if (exact) return exact;
|
|
136
|
+
}
|
|
137
|
+
let best: DumpEntryVariant | undefined;
|
|
138
|
+
let bestScore = -1;
|
|
139
|
+
for (const variant of variants) {
|
|
140
|
+
if (variant.tag === undefined) continue;
|
|
141
|
+
const score = nbtSpecificity(variant.tag, nbt);
|
|
142
|
+
if (score > bestScore) {
|
|
143
|
+
best = variant;
|
|
144
|
+
bestScore = score;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return best;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function displayOf(
|
|
151
|
+
entry: { display?: DumpDisplay; variants?: DumpEntryVariant[] },
|
|
152
|
+
nbt?: DumpNbt,
|
|
153
|
+
): DumpDisplay | undefined {
|
|
154
|
+
return matchVariant(entry.variants, nbt)?.display ?? entry.display;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function asId(value: unknown, fallbackId?: string): string | undefined {
|
|
158
|
+
const row = asRecord(value);
|
|
159
|
+
return asString(row?.id) ?? fallbackId;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function asEntryMeta(row: Record<string, unknown>, ids?: string[]) {
|
|
163
|
+
const tags = asStringList(row.tags);
|
|
164
|
+
const usedBy = asEdgeList(row.usedBy, ids);
|
|
165
|
+
const producedBy = asEdgeList(row.producedBy, ids);
|
|
166
|
+
const order = asNumber(row.order);
|
|
167
|
+
return {
|
|
168
|
+
...(tags.length ? { tags } : {}),
|
|
169
|
+
...(usedBy.length ? { usedBy } : {}),
|
|
170
|
+
...(producedBy.length ? { producedBy } : {}),
|
|
171
|
+
...(order !== undefined ? { order } : {}),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function asItemEntry(
|
|
176
|
+
value: unknown,
|
|
177
|
+
fallbackId?: string,
|
|
178
|
+
ids?: string[],
|
|
179
|
+
): DumpItemEntry | undefined {
|
|
180
|
+
const id = asId(value, fallbackId);
|
|
181
|
+
if (!id) return undefined;
|
|
182
|
+
const row = asRecord(value);
|
|
183
|
+
if (!row) return undefined;
|
|
184
|
+
const rarity = asString(row.rarity);
|
|
185
|
+
const block = asString(row.block);
|
|
186
|
+
const maxCount =
|
|
187
|
+
typeof row.maxCount === 'number' && Number.isFinite(row.maxCount)
|
|
188
|
+
? row.maxCount
|
|
189
|
+
: undefined;
|
|
190
|
+
const display = asDisplay(row.display);
|
|
191
|
+
const variants = asVariants(row.variants);
|
|
192
|
+
const sprite = asSpriteEntry(row.sprite);
|
|
193
|
+
return {
|
|
194
|
+
id,
|
|
195
|
+
...(maxCount !== undefined ? { maxCount } : {}),
|
|
196
|
+
...(rarity ? { rarity } : {}),
|
|
197
|
+
...(block ? { block } : {}),
|
|
198
|
+
...(display ? { display } : {}),
|
|
199
|
+
...(variants ? { variants } : {}),
|
|
200
|
+
...(sprite ? { sprite } : {}),
|
|
201
|
+
...asEntryMeta(row, ids),
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function asBlockEntry(
|
|
206
|
+
value: unknown,
|
|
207
|
+
fallbackId?: string,
|
|
208
|
+
ids?: string[],
|
|
209
|
+
): DumpBlockEntry | undefined {
|
|
210
|
+
const id = asId(value, fallbackId);
|
|
211
|
+
if (!id) return undefined;
|
|
212
|
+
const row = asRecord(value);
|
|
213
|
+
if (!row) return undefined;
|
|
214
|
+
const item = asTaggedReference(row.item);
|
|
215
|
+
const display = asDisplay(row.display);
|
|
216
|
+
const sprite = asSpriteEntry(row.sprite);
|
|
217
|
+
return {
|
|
218
|
+
id,
|
|
219
|
+
...(item ? { item } : {}),
|
|
220
|
+
...(display ? { display } : {}),
|
|
221
|
+
...(sprite ? { sprite } : {}),
|
|
222
|
+
...asEntryMeta(row, ids),
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
function asFluidEntry(
|
|
227
|
+
value: unknown,
|
|
228
|
+
fallbackId?: string,
|
|
229
|
+
ids?: string[],
|
|
230
|
+
): DumpFluidEntry | undefined {
|
|
231
|
+
const id = asId(value, fallbackId);
|
|
232
|
+
if (!id) return undefined;
|
|
233
|
+
const row = asRecord(value);
|
|
234
|
+
if (!row) return undefined;
|
|
235
|
+
const display = asDisplay(row.display);
|
|
236
|
+
const variants = asVariants(row.variants);
|
|
237
|
+
const sprite = asSpriteEntry(row.sprite);
|
|
238
|
+
return {
|
|
239
|
+
id,
|
|
240
|
+
...(display ? { display } : {}),
|
|
241
|
+
...(variants ? { variants } : {}),
|
|
242
|
+
...(sprite ? { sprite } : {}),
|
|
243
|
+
...asEntryMeta(row, ids),
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function asEntityEntry(
|
|
248
|
+
value: unknown,
|
|
249
|
+
fallbackId?: string,
|
|
250
|
+
ids?: string[],
|
|
251
|
+
): DumpEntityEntry | undefined {
|
|
252
|
+
const id = asId(value, fallbackId);
|
|
253
|
+
if (!id) return undefined;
|
|
254
|
+
const row = asRecord(value);
|
|
255
|
+
if (!row) return undefined;
|
|
256
|
+
const display = asDisplay(row.display);
|
|
257
|
+
const texture = asString(row.texture);
|
|
258
|
+
const model = asString(row.model);
|
|
259
|
+
const variants = asVariants(row.variants);
|
|
260
|
+
return {
|
|
261
|
+
id,
|
|
262
|
+
...(display ? { display } : {}),
|
|
263
|
+
...(texture ? { texture } : {}),
|
|
264
|
+
...(model ? { model } : {}),
|
|
265
|
+
...(variants ? { variants } : {}),
|
|
266
|
+
...asEntryMeta(row, ids),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export function asEntry(
|
|
271
|
+
value: unknown,
|
|
272
|
+
kind: DumpRegistryKind,
|
|
273
|
+
fallbackId?: string,
|
|
274
|
+
ids?: string[],
|
|
275
|
+
): DumpRegistryEntry | undefined {
|
|
276
|
+
switch (kind) {
|
|
277
|
+
case 'items':
|
|
278
|
+
return asItemEntry(value, fallbackId, ids);
|
|
279
|
+
case 'blocks':
|
|
280
|
+
return asBlockEntry(value, fallbackId, ids);
|
|
281
|
+
case 'fluids':
|
|
282
|
+
return asFluidEntry(value, fallbackId, ids);
|
|
283
|
+
case 'entities':
|
|
284
|
+
return asEntityEntry(value, fallbackId, ids);
|
|
285
|
+
default: {
|
|
286
|
+
const _never: never = kind;
|
|
287
|
+
return _never;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DumpDisplay } from '@terrafirmagreg-team/dump/lib/dump/contract/text';
|
|
2
|
+
import type { TaggedReference } from '@terrafirmagreg-team/dump/lib/dump/contract/ref';
|
|
3
|
+
import type { TabEntry } from '@terrafirmagreg-team/dump/lib/dump/gen';
|
|
4
|
+
|
|
5
|
+
export type DumpCreativeTab = Omit<TabEntry, 'display' | 'icon' | 'items'> & {
|
|
6
|
+
display: DumpDisplay;
|
|
7
|
+
icon?: TaggedReference;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type DumpCreativeTabs = {
|
|
11
|
+
tabs: DumpCreativeTab[];
|
|
12
|
+
members: Record<string, string[]>;
|
|
13
|
+
};
|
|
14
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { asRecord, asString } from '@terrafirmagreg-team/dump/lib/dump/contract/read';
|
|
2
|
+
import { asTaggedReference, compactRefId } from '@terrafirmagreg-team/dump/lib/dump/contract/ref';
|
|
3
|
+
import { asDisplay } from '@terrafirmagreg-team/dump/lib/dump/contract/text';
|
|
4
|
+
import type { DumpCreativeTab } from '@terrafirmagreg-team/dump/lib/dump/data/tab/dto';
|
|
5
|
+
|
|
6
|
+
export function asTab(value: unknown): DumpCreativeTab | undefined {
|
|
7
|
+
const row = asRecord(value);
|
|
8
|
+
if (!row) return undefined;
|
|
9
|
+
const id = asString(row.id);
|
|
10
|
+
const display = asDisplay(row.display);
|
|
11
|
+
const name = display?.name;
|
|
12
|
+
if (!id || !name) return undefined;
|
|
13
|
+
const order =
|
|
14
|
+
typeof row.order === 'number' && Number.isFinite(row.order) ? row.order : 0;
|
|
15
|
+
const icon = asTaggedReference(row.icon);
|
|
16
|
+
return { id, order, display: { ...display, name }, ...(icon ? { icon } : {}) };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function asTabItems(value: unknown): string[] {
|
|
20
|
+
const row = asRecord(value);
|
|
21
|
+
if (!row || !Array.isArray(row.items)) return [];
|
|
22
|
+
return row.items.flatMap((item) => {
|
|
23
|
+
const id = compactRefId(item);
|
|
24
|
+
return id ? [id] : [];
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
asEdgeList,
|
|
3
|
+
asRecord,
|
|
4
|
+
asString,
|
|
5
|
+
asStringList,
|
|
6
|
+
} from '@terrafirmagreg-team/dump/lib/dump/contract/read';
|
|
7
|
+
import type { DumpTag } from '@terrafirmagreg-team/dump/lib/dump/data/tag/dto';
|
|
8
|
+
|
|
9
|
+
const TAG_REGISTRIES = new Set(['items', 'blocks', 'fluids', 'entities']);
|
|
10
|
+
|
|
11
|
+
function registryFromCatalogKey(manifestKey: string): {
|
|
12
|
+
registry?: string;
|
|
13
|
+
path: string;
|
|
14
|
+
ns: string;
|
|
15
|
+
} {
|
|
16
|
+
const colon = manifestKey.indexOf(':');
|
|
17
|
+
const ns = colon > 0 ? manifestKey.slice(0, colon) : '';
|
|
18
|
+
const rest = colon > 0 ? manifestKey.slice(colon + 1) : manifestKey;
|
|
19
|
+
const slash = rest.indexOf('/');
|
|
20
|
+
if (slash <= 0) return { ns, path: rest };
|
|
21
|
+
const registry = rest.slice(0, slash);
|
|
22
|
+
return {
|
|
23
|
+
ns,
|
|
24
|
+
path: rest.slice(slash + 1),
|
|
25
|
+
...(TAG_REGISTRIES.has(registry) ? { registry } : {}),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function asTag(
|
|
30
|
+
raw: unknown,
|
|
31
|
+
manifestKey: string,
|
|
32
|
+
ids?: string[],
|
|
33
|
+
): DumpTag | undefined {
|
|
34
|
+
const row = asRecord(raw);
|
|
35
|
+
if (!row) return undefined;
|
|
36
|
+
const members = asStringList(row.members);
|
|
37
|
+
const usedBy = asEdgeList(row.usedBy, ids);
|
|
38
|
+
const producedBy = asEdgeList(row.producedBy, ids);
|
|
39
|
+
const parsed = registryFromCatalogKey(manifestKey);
|
|
40
|
+
const registry = asString(row.registry) ?? parsed.registry;
|
|
41
|
+
if (!registry) return undefined;
|
|
42
|
+
const id =
|
|
43
|
+
asString(row.id) ?? (parsed.ns && parsed.path ? `${parsed.ns}:${parsed.path}` : '');
|
|
44
|
+
if (!id) return undefined;
|
|
45
|
+
return {
|
|
46
|
+
id,
|
|
47
|
+
registry,
|
|
48
|
+
replace: row.replace === true,
|
|
49
|
+
members,
|
|
50
|
+
usedBy,
|
|
51
|
+
producedBy,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function firstTagItem(tag: DumpTag | undefined): string | undefined {
|
|
56
|
+
return tag?.members.find((value) => value && !value.startsWith('#'));
|
|
57
|
+
}
|
|
58
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type ResourceId = string;
|
|
2
|
+
export type ReferenceKind =
|
|
3
|
+
| "item"
|
|
4
|
+
| "block"
|
|
5
|
+
| "fluid"
|
|
6
|
+
| "entity"
|
|
7
|
+
| "itemTag"
|
|
8
|
+
| "blockTag"
|
|
9
|
+
| "fluidTag"
|
|
10
|
+
| "entityTag"
|
|
11
|
+
| "texture"
|
|
12
|
+
| "model"
|
|
13
|
+
| "recipe";
|
|
14
|
+
|
|
15
|
+
export interface DataGuidesBook {
|
|
16
|
+
categories: {
|
|
17
|
+
[k: string]: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
cover?: null | TaggedReference;
|
|
20
|
+
display: GuideDisplay;
|
|
21
|
+
entries: {
|
|
22
|
+
[k: string]: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
extensions?: {
|
|
25
|
+
[k: string]: JsonNode | undefined;
|
|
26
|
+
};
|
|
27
|
+
i18n?: boolean;
|
|
28
|
+
id?: string;
|
|
29
|
+
macros?: {
|
|
30
|
+
[k: string]: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
model?: string;
|
|
33
|
+
order: number;
|
|
34
|
+
schema: "data/guides/book";
|
|
35
|
+
slug?: string;
|
|
36
|
+
subtitle?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface TaggedReference {
|
|
39
|
+
id: ResourceId;
|
|
40
|
+
kind: ReferenceKind;
|
|
41
|
+
tag?: JsonNode;
|
|
42
|
+
}
|
|
43
|
+
export interface JsonNode {
|
|
44
|
+
[k: string]: unknown | undefined;
|
|
45
|
+
}
|
|
46
|
+
export interface GuideDisplay {
|
|
47
|
+
landing: DumpText[];
|
|
48
|
+
name: string;
|
|
49
|
+
}
|
|
50
|
+
export interface DumpText {
|
|
51
|
+
extra?: DumpText[];
|
|
52
|
+
keybind?: string;
|
|
53
|
+
text?: string;
|
|
54
|
+
translate?: string;
|
|
55
|
+
with?: DumpText[];
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type ResourceId = string;
|
|
2
|
+
export type ReferenceKind =
|
|
3
|
+
| "item"
|
|
4
|
+
| "block"
|
|
5
|
+
| "fluid"
|
|
6
|
+
| "entity"
|
|
7
|
+
| "itemTag"
|
|
8
|
+
| "blockTag"
|
|
9
|
+
| "fluidTag"
|
|
10
|
+
| "entityTag"
|
|
11
|
+
| "texture"
|
|
12
|
+
| "model"
|
|
13
|
+
| "recipe";
|
|
14
|
+
|
|
15
|
+
export interface DataGuidesCategory {
|
|
16
|
+
description?: string;
|
|
17
|
+
icon?: TaggedReference;
|
|
18
|
+
name?: string;
|
|
19
|
+
order: number;
|
|
20
|
+
schema: "data/guides/category";
|
|
21
|
+
[k: string]: unknown | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface TaggedReference {
|
|
24
|
+
id: ResourceId;
|
|
25
|
+
kind: ReferenceKind;
|
|
26
|
+
tag?: JsonNode;
|
|
27
|
+
}
|
|
28
|
+
export interface JsonNode {
|
|
29
|
+
[k: string]: unknown | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export type ResourceId = string;
|
|
2
|
+
export type ReferenceKind =
|
|
3
|
+
| "item"
|
|
4
|
+
| "block"
|
|
5
|
+
| "fluid"
|
|
6
|
+
| "entity"
|
|
7
|
+
| "itemTag"
|
|
8
|
+
| "blockTag"
|
|
9
|
+
| "fluidTag"
|
|
10
|
+
| "entityTag"
|
|
11
|
+
| "texture"
|
|
12
|
+
| "model"
|
|
13
|
+
| "recipe";
|
|
14
|
+
|
|
15
|
+
export interface DataGuidesEntry {
|
|
16
|
+
[k: string]: GuideEntry | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface GuideEntry {
|
|
19
|
+
category?: string;
|
|
20
|
+
display: GuideDisplay;
|
|
21
|
+
icon?: TaggedReference;
|
|
22
|
+
order?: number;
|
|
23
|
+
pages: GuidePage[];
|
|
24
|
+
[k: string]: unknown | undefined;
|
|
25
|
+
}
|
|
26
|
+
export interface GuideDisplay {
|
|
27
|
+
landing: DumpText[];
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
30
|
+
export interface DumpText {
|
|
31
|
+
extra?: DumpText[];
|
|
32
|
+
keybind?: string;
|
|
33
|
+
text?: string;
|
|
34
|
+
translate?: string;
|
|
35
|
+
with?: DumpText[];
|
|
36
|
+
}
|
|
37
|
+
export interface TaggedReference {
|
|
38
|
+
id: ResourceId;
|
|
39
|
+
kind: ReferenceKind;
|
|
40
|
+
tag?: JsonNode;
|
|
41
|
+
}
|
|
42
|
+
export interface JsonNode {
|
|
43
|
+
[k: string]: unknown | undefined;
|
|
44
|
+
}
|
|
45
|
+
export interface GuidePage {
|
|
46
|
+
type?: string;
|
|
47
|
+
[k: string]: unknown | undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export type ResourceId = string;
|
|
2
|
+
export type ReferenceKind =
|
|
3
|
+
| "item"
|
|
4
|
+
| "block"
|
|
5
|
+
| "fluid"
|
|
6
|
+
| "entity"
|
|
7
|
+
| "itemTag"
|
|
8
|
+
| "blockTag"
|
|
9
|
+
| "fluidTag"
|
|
10
|
+
| "entityTag"
|
|
11
|
+
| "texture"
|
|
12
|
+
| "model"
|
|
13
|
+
| "recipe";
|
|
14
|
+
|
|
15
|
+
export interface DataQuestsChapter {
|
|
16
|
+
autofocusId?: string;
|
|
17
|
+
defaultHideDependencyLines?: boolean;
|
|
18
|
+
defaultQuestShape?: string;
|
|
19
|
+
description?: string[];
|
|
20
|
+
filename?: string;
|
|
21
|
+
group?: string;
|
|
22
|
+
icon?: TaggedReference;
|
|
23
|
+
id?: string;
|
|
24
|
+
images?: ChapterImage[];
|
|
25
|
+
orderIndex?: number;
|
|
26
|
+
questLinks?: {
|
|
27
|
+
[k: string]: QuestLink | undefined;
|
|
28
|
+
};
|
|
29
|
+
quests?: {
|
|
30
|
+
[k: string]: QuestEntry | undefined;
|
|
31
|
+
};
|
|
32
|
+
schema?: "data/quests/chapter";
|
|
33
|
+
subtitle?: string;
|
|
34
|
+
title?: string;
|
|
35
|
+
[k: string]: unknown | undefined;
|
|
36
|
+
}
|
|
37
|
+
export interface TaggedReference {
|
|
38
|
+
id: ResourceId;
|
|
39
|
+
kind: ReferenceKind;
|
|
40
|
+
tag?: JsonNode;
|
|
41
|
+
}
|
|
42
|
+
export interface JsonNode {
|
|
43
|
+
[k: string]: unknown | undefined;
|
|
44
|
+
}
|
|
45
|
+
export interface ChapterImage {
|
|
46
|
+
alignToCorner?: boolean;
|
|
47
|
+
alpha?: number;
|
|
48
|
+
animated?: boolean;
|
|
49
|
+
click?: string;
|
|
50
|
+
color?: number;
|
|
51
|
+
frameCount?: number;
|
|
52
|
+
frameH?: number;
|
|
53
|
+
frameSequence?: number[];
|
|
54
|
+
frameTime?: number;
|
|
55
|
+
frameW?: number;
|
|
56
|
+
h: number;
|
|
57
|
+
image: string;
|
|
58
|
+
rotation?: number;
|
|
59
|
+
w: number;
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
[k: string]: unknown | undefined;
|
|
63
|
+
}
|
|
64
|
+
export interface QuestLink {
|
|
65
|
+
icon?: TaggedReference;
|
|
66
|
+
id: string;
|
|
67
|
+
linkedQuest: string;
|
|
68
|
+
shape?: string;
|
|
69
|
+
size?: number;
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
[k: string]: unknown | undefined;
|
|
73
|
+
}
|
|
74
|
+
export interface QuestEntry {
|
|
75
|
+
canRepeat?: boolean;
|
|
76
|
+
dependencies?: string[];
|
|
77
|
+
description?: string[];
|
|
78
|
+
guidePage?: string;
|
|
79
|
+
hideDependencyLines?: boolean;
|
|
80
|
+
icon?: TaggedReference;
|
|
81
|
+
id: string;
|
|
82
|
+
image?: string;
|
|
83
|
+
invisible?: boolean;
|
|
84
|
+
minWidth?: number;
|
|
85
|
+
optional?: boolean;
|
|
86
|
+
rewards?: {
|
|
87
|
+
[k: string]: QuestReward | undefined;
|
|
88
|
+
};
|
|
89
|
+
shape?: string;
|
|
90
|
+
size?: number;
|
|
91
|
+
subtitle?: string;
|
|
92
|
+
tasks?: {
|
|
93
|
+
[k: string]: QuestTask | undefined;
|
|
94
|
+
};
|
|
95
|
+
title?: string;
|
|
96
|
+
x?: number;
|
|
97
|
+
y?: number;
|
|
98
|
+
[k: string]: unknown | undefined;
|
|
99
|
+
}
|
|
100
|
+
export interface QuestReward {
|
|
101
|
+
count?: number;
|
|
102
|
+
id?: string;
|
|
103
|
+
items?: TaggedReference[];
|
|
104
|
+
ref?: TaggedReference;
|
|
105
|
+
title?: string;
|
|
106
|
+
type: string;
|
|
107
|
+
xp?: number;
|
|
108
|
+
[k: string]: unknown | undefined;
|
|
109
|
+
}
|
|
110
|
+
export interface QuestTask {
|
|
111
|
+
biome?: string;
|
|
112
|
+
count?: number;
|
|
113
|
+
dimension?: string;
|
|
114
|
+
filter?: string;
|
|
115
|
+
filterRaw?: string;
|
|
116
|
+
icon?: TaggedReference;
|
|
117
|
+
id?: string;
|
|
118
|
+
itemFilter?: string;
|
|
119
|
+
items?: TaggedReference[];
|
|
120
|
+
optional?: boolean;
|
|
121
|
+
ref?: TaggedReference;
|
|
122
|
+
stage?: string;
|
|
123
|
+
title?: string;
|
|
124
|
+
type: string;
|
|
125
|
+
[k: string]: unknown | undefined;
|
|
126
|
+
}
|
|
127
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface DataQuestsChapterGroups {
|
|
2
|
+
chapterGroups: {
|
|
3
|
+
[k: string]: QuestChapterGroup | undefined;
|
|
4
|
+
};
|
|
5
|
+
schema: "data/quests/chapter_groups";
|
|
6
|
+
}
|
|
7
|
+
export interface QuestChapterGroup {
|
|
8
|
+
id: string;
|
|
9
|
+
orderIndex?: number;
|
|
10
|
+
title?: string;
|
|
11
|
+
}
|
|
12
|
+
|