Add shapenator to gradle build file

This commit is contained in:
DBotThePony 2021-08-18 17:28:46 +07:00
parent 7a303f07e2
commit c2931d03c2
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 11 additions and 1 deletions

View File

@ -23,6 +23,12 @@ archivesBaseName = 'overdrive_that_matters'
java.toolchain.languageVersion = JavaLanguageVersion.of(16) java.toolchain.languageVersion = JavaLanguageVersion.of(16)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
exec {
executable 'node'
args 'shapenator.js'
}
minecraft { minecraft {
// The mappings can be changed at any time and must be in the following format. // The mappings can be changed at any time and must be in the following format.
// Channel: Version: // Channel: Version:

View File

@ -13,10 +13,12 @@ const fs = require('fs')
const _root = './src/main/resources/assets/overdrive_that_matters/' const _root = './src/main/resources/assets/overdrive_that_matters/'
const root = _root + 'models/block/' const root = _root + 'models/block/'
const time = Date.now()
process.stdout.write('Generating data files\n')
const handle = fs.openSync('./src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShapes.java', 'w') const handle = fs.openSync('./src/main/java/ru/dbotthepony/mc/otm/shapes/BlockShapes.java', 'w')
fs.writeSync(handle, 'package ru.dbotthepony.mc.otm.shapes;\n\n\n') fs.writeSync(handle, 'package ru.dbotthepony.mc.otm.shapes;\n\n\n')
fs.writeSync(handle, `// Auto generated at ${new Date().toUTCString()}\n`) fs.writeSync(handle, `// This file is regenerated on each gradle run. Do not edit it!\n`)
fs.writeSync(handle, 'public class BlockShapes {\n') fs.writeSync(handle, 'public class BlockShapes {\n')
for (const model of models) { for (const model of models) {
@ -107,3 +109,5 @@ const facings = [
fs.writeFileSync(_root + 'blockstates/pattern_storage.json', JSON.stringify(blockstate, null, '\t')) fs.writeFileSync(_root + 'blockstates/pattern_storage.json', JSON.stringify(blockstate, null, '\t'))
} }
process.stdout.write(`Generated data files in ${Date.now() - time}ms\n`)