mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-17 04:05:10 +01:00
Add preliminary resourcepack creation system
This commit is contained in:
38
build.gradle
38
build.gradle
@@ -52,3 +52,41 @@ jar.manifest {
|
|||||||
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
attributes 'FMLCorePluginContainsFMLMod': 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import org.apache.tools.ant.filters.ReplaceTokens
|
||||||
|
import groovy.json.JsonSlurper
|
||||||
|
|
||||||
|
task createResourcePacks {
|
||||||
|
def inputFile = new File("resource_packs.json")
|
||||||
|
def json = new JsonSlurper().parseText(inputFile.text)
|
||||||
|
json.each {
|
||||||
|
def pack_id = it.key
|
||||||
|
def pack_name = it.value.name
|
||||||
|
def pack_desc = it.value.description
|
||||||
|
def pack_radius = it.value.radius
|
||||||
|
|
||||||
|
def taskName = "createPack" + pack_id.capitalize();
|
||||||
|
task "${taskName}" (type: Zip) {
|
||||||
|
from ('pack_template') {
|
||||||
|
filter(ReplaceTokens, tokens: [
|
||||||
|
mod_version: project.version.toString(),
|
||||||
|
pack_version: '3',
|
||||||
|
description: pack_desc.toString(),
|
||||||
|
radius: pack_radius.toString()
|
||||||
|
])
|
||||||
|
|
||||||
|
rename(/(.+)\.template/, '$1')
|
||||||
|
}
|
||||||
|
|
||||||
|
from ('pack_icons') {
|
||||||
|
include "${pack_id}.png"
|
||||||
|
rename '.+', 'pack.png'
|
||||||
|
}
|
||||||
|
|
||||||
|
baseName = "Blur " + pack_name
|
||||||
|
}
|
||||||
|
|
||||||
|
createResourcePacks.finalizedBy taskName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.build.dependsOn createResourcePacks
|
||||||
|
|||||||
BIN
pack_icons/lite.png
Normal file
BIN
pack_icons/lite.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
BIN
pack_icons/strong.png
Normal file
BIN
pack_icons/strong.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
BIN
pack_icons/ultra_lite.png
Normal file
BIN
pack_icons/ultra_lite.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
BIN
pack_icons/ultra_strong.png
Normal file
BIN
pack_icons/ultra_strong.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 63 KiB |
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"targets": [
|
||||||
|
"swap"
|
||||||
|
],
|
||||||
|
"passes": [
|
||||||
|
{
|
||||||
|
"name": "fade_in_blur",
|
||||||
|
"intarget": "minecraft:main",
|
||||||
|
"outtarget": "swap",
|
||||||
|
"uniforms": [
|
||||||
|
{
|
||||||
|
"name": "BlurDir",
|
||||||
|
"values": [ 1.0, 0.0 ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Radius",
|
||||||
|
"values": [ @radius@.0 ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_in_blur",
|
||||||
|
"intarget": "swap",
|
||||||
|
"outtarget": "minecraft:main",
|
||||||
|
"uniforms": [
|
||||||
|
{
|
||||||
|
"name": "BlurDir",
|
||||||
|
"values": [ 0.0, 1.0 ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Radius",
|
||||||
|
"values": [ @radius@.0 ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_in_blur",
|
||||||
|
"intarget": "minecraft:main",
|
||||||
|
"outtarget": "swap",
|
||||||
|
"uniforms": [
|
||||||
|
{
|
||||||
|
"name": "BlurDir",
|
||||||
|
"values": [ 1.0, 0.0 ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Radius",
|
||||||
|
"values": [ @radius@.0 ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "fade_in_blur",
|
||||||
|
"intarget": "swap",
|
||||||
|
"outtarget": "minecraft:main",
|
||||||
|
"uniforms": [
|
||||||
|
{
|
||||||
|
"name": "BlurDir",
|
||||||
|
"values": [ 0.0, 1.0 ]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Radius",
|
||||||
|
"values": [ @radius@.0 ]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
7
pack_template/pack.mcmeta.template
Normal file
7
pack_template/pack.mcmeta.template
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"pack": {
|
||||||
|
"_comment": "This pack was made for Blur version @mod_version@",
|
||||||
|
"pack_format": @pack_version@,
|
||||||
|
"description": "@description@"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
resource_packs.json
Normal file
22
resource_packs.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"ultra_lite": {
|
||||||
|
"name": "Ultra Lite",
|
||||||
|
"radius": 2,
|
||||||
|
"description": "Least passes, weakest effect, greatest performance. It's like having a smudge on your glasses."
|
||||||
|
},
|
||||||
|
"lite": {
|
||||||
|
"name": "Lite",
|
||||||
|
"radius": 7,
|
||||||
|
"description": "Less passes, weaker effect, greater performance."
|
||||||
|
},
|
||||||
|
"strong": {
|
||||||
|
"name": "Strong",
|
||||||
|
"radius": 40,
|
||||||
|
"description" : "More passes, stronger effect, lesser performance."
|
||||||
|
},
|
||||||
|
"ultra_strong": {
|
||||||
|
"name": "Ultra Strong",
|
||||||
|
"radius": 100,
|
||||||
|
"description": "Too many passes, strongest effect, worst performance. It's like having Vaseline in your eyes."
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user