This commit is contained in:
Misode
2024-05-10 23:15:41 +02:00
parent bf36ecd3e0
commit 44b97e357f
8 changed files with 57 additions and 43 deletions

View File

@@ -8,7 +8,10 @@ import { quat, vec2 } from 'gl-matrix'
import yaml from 'js-yaml'
import { route } from 'preact-router'
import rfdc from 'rfdc'
import type { ConfigGenerator } from './Config.js'
import config from './Config.js'
import type { VersionId } from './services/index.js'
import { checkVersion } from './services/index.js'
export function isPromise(obj: any): obj is Promise<any> {
return typeof (obj as any)?.then === 'function'
@@ -581,3 +584,12 @@ export function parseGitPatch(patch: string) {
}
return result
}
const legacyTags = new Set(['tag/item', 'tag/block', 'tag/fluid', 'tag/entity_type', 'tag/game_event'])
export function genPath(gen: ConfigGenerator, version: VersionId) {
const path = gen.path ?? gen.id
if (!checkVersion(version, '1.21') && legacyTags.has(gen.id)) {
return path + 's'
}
return path
}