copy entity directly from assets, various generator fixes
This commit is contained in:
parent
1e0d0f5edc
commit
c0d3b2905a
3 changed files with 5 additions and 3 deletions
|
|
@ -22,7 +22,7 @@ const warnings = new Set<string>()
|
|||
Promise.resolve().then(async () => {
|
||||
generateItemsAtlases()
|
||||
console.time('generateTextures')
|
||||
for (const version of ['1.14.4'] as typeof mcAssets['versions']) {
|
||||
for (const version of mcAssets.versions as typeof mcAssets['versions']) {
|
||||
// for debugging (e.g. when above is overridden)
|
||||
if (!mcAssets.versions.includes(version)) {
|
||||
throw new Error(`Version ${version} is not supported by minecraft-assets`)
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ function prepareModel (model: BlockModel, texturesJson) {
|
|||
const getFinalTexture = (originalBlockName) => {
|
||||
// texture name e.g. blocks/anvil_base
|
||||
const cleanBlockName = cleanupBlockName(originalBlockName);
|
||||
return { ...texturesJson[cleanBlockName], __debugName: cleanBlockName }
|
||||
return { ...texturesJson[cleanBlockName], /* __debugName: cleanBlockName */ }
|
||||
}
|
||||
|
||||
const finalTextures = []
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@ const glob = require('glob')
|
|||
const fs = require('fs')
|
||||
const crypto = require('crypto')
|
||||
const path = require('path')
|
||||
const McAssets = require('minecraft-assets')
|
||||
|
||||
const prismarineViewerBase = "./node_modules/prismarine-viewer"
|
||||
const entityMcAssets = McAssets('1.16.4')
|
||||
|
||||
// these files could be copied at build time eg with copy plugin, but copy plugin slows down the config so we copy them there, alternative we could inline it in esbuild config
|
||||
const filesToCopy = [
|
||||
|
|
@ -14,7 +16,7 @@ const filesToCopy = [
|
|||
{ from: `${prismarineViewerBase}/public/worker.js`, to: 'dist/worker.js' },
|
||||
{ from: './assets/', to: './dist/' },
|
||||
{ from: './config.json', to: 'dist/config.json' },
|
||||
{ from: `${prismarineViewerBase}/public/textures/1.16.4/entity`, to: 'dist/textures/1.16.4/entity' },
|
||||
{ from: path.join(entityMcAssets.directory, 'entity'), to: 'dist/textures/1.16.4/entity' },
|
||||
]
|
||||
exports.filesToCopy = filesToCopy
|
||||
exports.copyFiles = (dev = false) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue