forked from TAIGA/TAIGA
Added nuggets + json files. F
Removed unnecessary lignite ores. Fixed oreDict
This commit is contained in:
83
build.gradle
83
build.gradle
@@ -133,4 +133,85 @@ curseforge {
|
||||
displayName = "taiga-${project.buildInfo.revision}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* FOR AUTO JSON
|
||||
ext.args = [:]
|
||||
|
||||
ext.requireArgument = {String property, String displayValue ->
|
||||
def value = args[property]
|
||||
if (value == null) {
|
||||
throw new InvalidUserDataException("$property must be set with \'$property=$displayValue\'")
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
tasks.addRule("Pattern: <property>=<value>: Passes arguments to the scripts") { String taskName ->
|
||||
def match = taskName =~ /(.*?)=(.*?$)/
|
||||
if (match) {
|
||||
def property = match[0][1]
|
||||
def value = match[0][2]
|
||||
ext.args[property] = value;
|
||||
task(taskName) << {
|
||||
println "Passes value \'$value\' to args[\'$property\']"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
import org.apache.tools.ant.filters.FixCrLfFilter
|
||||
|
||||
class CopyJsonTemplate extends DefaultTask {
|
||||
@Input
|
||||
def template
|
||||
|
||||
@Input
|
||||
def arguments
|
||||
|
||||
@Input
|
||||
def jsonRename
|
||||
|
||||
@TaskAction
|
||||
def build() {
|
||||
def args = arguments()
|
||||
project.copy {
|
||||
from("templates/${template}") {
|
||||
expand(args)
|
||||
filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf'))
|
||||
}
|
||||
into 'src/main/resources'
|
||||
rename { String filename ->
|
||||
def match = filename =~ /(.*)\.json/
|
||||
if (match) {
|
||||
def prevFilename = match[0][1]
|
||||
def newFilename = jsonRename.call(prevFilename)
|
||||
return "${newFilename}.json"
|
||||
}
|
||||
else {
|
||||
return filename
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
task generateBlockModel(type: CopyJsonTemplate) {
|
||||
template 'block'
|
||||
arguments {
|
||||
def blockName = requireArgument('blockName', 'block_name')
|
||||
return ['modid':archivesBaseName, 'block_name':blockName]
|
||||
}
|
||||
jsonRename {
|
||||
return args['blockName']
|
||||
}
|
||||
}
|
||||
|
||||
task generateItemModel(type: CopyJsonTemplate) {
|
||||
template 'item'
|
||||
arguments {
|
||||
def itemName = requireArgument('itemName', 'item_name')
|
||||
return ['modid':archivesBaseName, 'item_name':itemName]
|
||||
}
|
||||
jsonRename {
|
||||
return args['itemName']
|
||||
}
|
||||
}*/
|
Reference in New Issue
Block a user