mirror of
https://github.com/misode/misode.github.io.git
synced 2026-05-01 01:59:33 +00:00
Update Lithostitched partner (#539)
* Add enchantment tag generator * Update Lithostitched partner * fix config.json * Refactor a bit --------- Co-authored-by: Misode <misoloo64@gmail.com>
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import type { CollectionRegistry, ResourceType, SchemaRegistry } from '@mcschema/core'
|
||||
import { BooleanNode, Case, ChoiceNode, ListNode, Mod, NumberNode, ObjectNode, Opt, Reference as RawReference, StringNode as RawStringNode, Switch } from '@mcschema/core'
|
||||
import type { VersionId } from '../services/Schemas.js'
|
||||
|
||||
|
||||
const ID = 'lithostitched'
|
||||
|
||||
export function initLithostitched(schemas: SchemaRegistry, collections: CollectionRegistry) {
|
||||
export function initLithostitched(schemas: SchemaRegistry, collections: CollectionRegistry, version: VersionId) {
|
||||
const Reference = RawReference.bind(undefined, schemas)
|
||||
const StringNode = RawStringNode.bind(undefined, collections)
|
||||
|
||||
@@ -69,6 +70,9 @@ export function initLithostitched(schemas: SchemaRegistry, collections: Collecti
|
||||
collections.register(`${ID}:modifier_type`, [
|
||||
'lithostitched:add_biome_spawns',
|
||||
'lithostitched:add_features',
|
||||
...(version === '1.20.5' || version === '1.21')
|
||||
? ['lithostitched:add_pool_aliases']
|
||||
: [],
|
||||
'lithostitched:add_structure_set_entries',
|
||||
'lithostitched:add_surface_rule',
|
||||
'lithostitched:add_template_pool_elements',
|
||||
@@ -91,7 +95,9 @@ export function initLithostitched(schemas: SchemaRegistry, collections: Collecti
|
||||
|
||||
schemas.register(`${ID}:worldgen_modifier`, Mod(ObjectNode({
|
||||
type: StringNode({ validator: 'resource', params: { pool: `${ID}:modifier_type` as any } }),
|
||||
predicate: Opt(Reference(`${ID}:modifier_predicate`)),
|
||||
predicate: Mod(Opt(Reference(`${ID}:modifier_predicate`)), {
|
||||
enabled: () => version !== '1.21',
|
||||
}),
|
||||
[Switch]: [{ push: 'type' }],
|
||||
[Case]: {
|
||||
'lithostitched:add_biome_spawns': {
|
||||
@@ -114,6 +120,10 @@ export function initLithostitched(schemas: SchemaRegistry, collections: Collecti
|
||||
features: Tag('$worldgen/configured_feature'),
|
||||
step: StringNode({ enum: 'decoration_step' }),
|
||||
},
|
||||
'lithostitched:add_pool_aliases': {
|
||||
structure: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure' } }),
|
||||
pool_aliases: Reference('pool_alias_binding'),
|
||||
},
|
||||
'lithostitched:add_structure_set_entries': {
|
||||
structure_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
|
||||
entries: ListNode(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { CollectionRegistry, SchemaRegistry } from '@mcschema/core'
|
||||
import type { VersionId } from '../services/Schemas.js'
|
||||
import { initImmersiveWeathering } from './ImmersiveWeathering.js'
|
||||
import { initLithostitched } from './Lithostitched.js'
|
||||
import { initObsidian } from './Obsidian.js'
|
||||
@@ -7,9 +8,9 @@ import { initOhTheTreesYoullGrow } from './OhTheTreesYoullGrow.js'
|
||||
export * from './ImmersiveWeathering.js'
|
||||
export * from './Lithostitched.js'
|
||||
|
||||
export function initPartners(schemas: SchemaRegistry, collections: CollectionRegistry) {
|
||||
export function initPartners(schemas: SchemaRegistry, collections: CollectionRegistry, version: VersionId) {
|
||||
initImmersiveWeathering(schemas, collections)
|
||||
initLithostitched(schemas, collections)
|
||||
initLithostitched(schemas, collections, version)
|
||||
initObsidian(schemas, collections)
|
||||
initOhTheTreesYoullGrow(schemas, collections)
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
|
||||
"lithostitched:modifier_type.lithostitched:add_biome_spawns": "Add biome spawns",
|
||||
"lithostitched:modifier_type.lithostitched:add_features": "Add features",
|
||||
"lithostitched:modifier_type.lithostitched:add_pool_aliases": "Add pool aliases",
|
||||
"lithostitched:modifier_type.lithostitched:add_structure_set_entries": "Add structure set entries",
|
||||
"lithostitched:modifier_type.lithostitched:add_surface_rule": "Add surface rule",
|
||||
"lithostitched:modifier_type.lithostitched:add_template_pool_elements": "Add template pool elements",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { CollectionRegistry, INode, SchemaRegistry } from '@mcschema/core'
|
||||
import { ChoiceNode, DataModel, Reference, StringNode } from '@mcschema/core'
|
||||
import config from '../Config.js'
|
||||
import { initPartners } from '../partners/index.js'
|
||||
import { message } from '../Utils.js'
|
||||
import { initPartners } from '../partners/index.js'
|
||||
import { fetchData } from './DataFetcher.js'
|
||||
|
||||
export const VersionIds = ['1.15', '1.16', '1.17', '1.18', '1.18.2', '1.19', '1.19.3', '1.19.4', '1.20', '1.20.2', '1.20.3', '1.20.5', '1.21'] as const
|
||||
@@ -69,7 +69,7 @@ async function getVersion(id: VersionId): Promise<VersionData> {
|
||||
const blockStates: BlockStateRegistry = {}
|
||||
await fetchData(id, collections, blockStates)
|
||||
const schemas = mcschema.getSchemas(collections)
|
||||
initPartners(schemas, collections)
|
||||
initPartners(schemas, collections, id)
|
||||
Versions[id] = { collections, schemas, blockStates }
|
||||
return Versions[id]
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user