diff --git a/build.gradle b/build.gradle index 51a576b..9e81cf4 100644 --- a/build.gradle +++ b/build.gradle @@ -52,3 +52,41 @@ jar.manifest { 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 diff --git a/pack_icons/lite.png b/pack_icons/lite.png new file mode 100644 index 0000000..ac7d032 Binary files /dev/null and b/pack_icons/lite.png differ diff --git a/pack_icons/strong.png b/pack_icons/strong.png new file mode 100644 index 0000000..58d336e Binary files /dev/null and b/pack_icons/strong.png differ diff --git a/pack_icons/ultra_lite.png b/pack_icons/ultra_lite.png new file mode 100644 index 0000000..b287e04 Binary files /dev/null and b/pack_icons/ultra_lite.png differ diff --git a/pack_icons/ultra_strong.png b/pack_icons/ultra_strong.png new file mode 100644 index 0000000..dbe72de Binary files /dev/null and b/pack_icons/ultra_strong.png differ diff --git a/pack_template/assets/minecraft/shaders/post/fade_in_blur.json.template b/pack_template/assets/minecraft/shaders/post/fade_in_blur.json.template new file mode 100644 index 0000000..b0efb87 --- /dev/null +++ b/pack_template/assets/minecraft/shaders/post/fade_in_blur.json.template @@ -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 ] + } + ] + } + ] +} diff --git a/pack_template/pack.mcmeta.template b/pack_template/pack.mcmeta.template new file mode 100644 index 0000000..37b216d --- /dev/null +++ b/pack_template/pack.mcmeta.template @@ -0,0 +1,7 @@ +{ + "pack": { + "_comment": "This pack was made for Blur version @mod_version@", + "pack_format": @pack_version@, + "description": "@description@" + } +} diff --git a/resource_packs.json b/resource_packs.json new file mode 100644 index 0000000..1fb4eb4 --- /dev/null +++ b/resource_packs.json @@ -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." + } +} \ No newline at end of file