Datapack support (#815)

* Shader support PR

* Make search page work

* Fix env showing

* Make moderation look reasonable

* Fix search for shaders

* Datapack support

* Make file types work + datapack inferring

* Add editing to file types

* Finish datapack file generation

* Fix bugs, make forge support work

* Fix inconsistent data pack label

* Final fixes
This commit is contained in:
Geometrically
2022-12-29 09:59:41 -07:00
committed by GitHub
parent 879576b613
commit 1f133dbcd0
22 changed files with 978 additions and 262 deletions

View File

@@ -153,24 +153,46 @@ export default (ctx, inject) => {
const isMod = categories.some((category) => {
return ctx.store.state.tag.loaderData.modLoaders.includes(category)
})
return isPlugin && isMod ? 'mod and plugin' : isPlugin ? 'plugin' : 'mod'
} else {
return formatProjectType(type)
const isDataPack = categories.some((category) => {
return ctx.store.state.tag.loaderData.dataPackLoaders.includes(category)
})
if (isMod && isPlugin && isDataPack) {
return 'mod, plugin, and data pack'
} else if (isMod && isPlugin) {
return 'mod and plugin'
} else if (isMod && isDataPack) {
return 'mod and datapack'
}
}
return type
})
inject('getProjectTypeForUrl', (type, categories) => {
if (type === 'mod') {
const isMod = categories.some((category) => {
return ctx.store.state.tag.loaderData.modLoaders.includes(category)
})
const isPlugin = categories.some((category) => {
return ctx.store.state.tag.loaderData.allPluginLoaders.includes(
category
)
})
const isMod = categories.some((category) => {
return ctx.store.state.tag.loaderData.modLoaders.includes(category)
const isDataPack = categories.some((category) => {
return ctx.store.state.tag.loaderData.dataPackLoaders.includes(category)
})
return isPlugin && isMod ? 'mod' : isPlugin ? 'plugin' : 'mod'
if (isDataPack) {
return 'datapack'
} else if (isPlugin) {
return 'plugin'
} else if (isMod) {
return 'mod'
} else {
return 'mod'
}
} else {
return type
}
@@ -232,7 +254,10 @@ export const formatWallet = (name) => {
export const formatProjectType = (name) => {
if (name === 'resourcepack') {
return 'Resource Pack'
} else if (name === 'datapack') {
return 'Data Pack'
}
return capitalizeString(name)
}
@@ -261,6 +286,8 @@ export const formatCategory = (name) => {
return 'Path Tracing'
} else if (name === 'pbr') {
return 'PBR'
} else if (name === 'datapack') {
return 'Data pack'
}
return capitalizeString(name)