mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-16 11:45:09 +01:00
Use official Satin build, Gradle cleanup, Remove unneeded dependencies
This commit is contained in:
114
build.gradle
114
build.gradle
@@ -1,33 +1,26 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'java'
|
id 'fabric-loom' version '0.5-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'idea'
|
|
||||||
id 'eclipse'
|
|
||||||
id 'com.matthewprenger.cursegradle' version '1.4.0'
|
|
||||||
id 'fabric-loom' version '0.4-SNAPSHOT'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
ext.buildnumber = System.getenv().BUILD_NUMBER ?: 'custom';
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
|
||||||
group = 'com.tterrag.blur'
|
archivesBaseName = project.archives_base_name
|
||||||
archivesBaseName = "Blur"
|
version = project.mod_version
|
||||||
version = "${mod_version}-${minecraft_version}+fabric"
|
group = project.maven_group
|
||||||
|
|
||||||
sourceCompatibility = '1.8'
|
|
||||||
targetCompatibility = '1.8'
|
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
maven { url "https://jitpack.io" }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft "com.mojang:minecraft:${minecraft_version}"
|
minecraft "com.mojang:minecraft:${minecraft_version}"
|
||||||
mappings "net.fabricmc:yarn:${mappings_version}"
|
mappings "net.fabricmc:yarn:${yarn_mappings}"
|
||||||
modCompile "net.fabricmc:fabric-loader:${fabric_loader_version}"
|
modCompile "net.fabricmc:fabric-loader:${loader_version}"
|
||||||
modCompile "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
modCompile "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
||||||
modCompile "io.github.ladysnake:Satin:${satin_version}"
|
modCompile "io.github.ladysnake:Satin:${satin_version}"
|
||||||
include "io.github.ladysnake:Satin:${satin_version}"
|
include "io.github.ladysnake:Satin:${satin_version}"
|
||||||
@@ -40,13 +33,12 @@ dependencies {
|
|||||||
|
|
||||||
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
inputs.property "version", mod_version
|
inputs.property "version", project.version
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
include "fabric.mod.json"
|
include "fabric.mod.json"
|
||||||
expand "version": mod_version
|
expand "version": project.version
|
||||||
}
|
}
|
||||||
|
|
||||||
from(sourceSets.main.resources.srcDirs) {
|
from(sourceSets.main.resources.srcDirs) {
|
||||||
@@ -54,69 +46,43 @@ processResources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
import org.apache.tools.ant.filters.ReplaceTokens
|
// ensure that the encoding is set to UTF-8, no matter what the system default is
|
||||||
import groovy.json.JsonSlurper
|
// this fixes some edge cases with special characters not displaying correctly
|
||||||
|
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
|
||||||
task createResourcePacks {
|
tasks.withType(JavaCompile) {
|
||||||
def inputFile = new File("resource_packs.json")
|
options.encoding = "UTF-8"
|
||||||
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') {
|
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||||
include "${pack_id}.png"
|
// if it is present.
|
||||||
rename '.+', 'icon.png'
|
// If you remove this task, sources will not be generated.
|
||||||
|
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||||
|
classifier = "sources"
|
||||||
|
from sourceSets.main.allSource
|
||||||
}
|
}
|
||||||
|
|
||||||
baseName = "Blur " + pack_name
|
jar {
|
||||||
|
from "LICENSE"
|
||||||
}
|
}
|
||||||
|
|
||||||
createResourcePacks.finalizedBy taskName
|
// configure the maven publication
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
mavenJava(MavenPublication) {
|
||||||
|
// add all the jars that should be included when publishing to maven
|
||||||
|
artifact(remapJar) {
|
||||||
|
builtBy remapJar
|
||||||
}
|
}
|
||||||
}
|
artifact(sourcesJar) {
|
||||||
|
builtBy remapSourcesJar
|
||||||
// Not necessary atm
|
|
||||||
// tasks.build.dependsOn createResourcePacks
|
|
||||||
|
|
||||||
tasks.curseforge.enabled = !dev && project.hasProperty('curseforge_key')
|
|
||||||
|
|
||||||
curseforge {
|
|
||||||
if (project.hasProperty('curseforge_key')) {
|
|
||||||
apiKey = project.curseforge_key
|
|
||||||
}
|
|
||||||
|
|
||||||
project {
|
|
||||||
id = project.project_id
|
|
||||||
changelogType = 'html'
|
|
||||||
changelog = System.getenv('CHANGELOG')
|
|
||||||
if (changelog == null || 'none'.equals(changelog)) {
|
|
||||||
changelog = getChangelog() ?: ''
|
|
||||||
changelogType = 'text'
|
|
||||||
}
|
|
||||||
releaseType = project.release_type
|
|
||||||
addGameVersion '1.9.4'
|
|
||||||
addGameVersion '1.11.2'
|
|
||||||
addGameVersion '1.12'
|
|
||||||
addGameVersion '1.12.1'
|
|
||||||
mainArtifact(jar) {
|
|
||||||
displayName = "Blur ${mod_version}"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// select the repositories you want to publish to
|
||||||
|
repositories {
|
||||||
|
// uncomment to publish to the local maven
|
||||||
|
// mavenLocal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,23 @@
|
|||||||
minecraft_version=1.16.2
|
# Done to increase the memory available to gradle.
|
||||||
|
org.gradle.jvmargs=-Xmx1G
|
||||||
|
|
||||||
mod_version=2.0.0
|
# Fabric Properties
|
||||||
|
# check these on https://fabricmc.net/use
|
||||||
|
minecraft_version=20w51a
|
||||||
|
yarn_mappings=20w51a+build.5
|
||||||
|
loader_version=0.10.8
|
||||||
|
fabric_version=0.28.3+1.17
|
||||||
|
|
||||||
fabric_loader_version=0.9.1+build.205
|
# Mod Properties
|
||||||
fabric_version=0.18.0+build.397-1.16
|
mod_version = 2.0.0-20w51a+fabric
|
||||||
mappings_version=1.16.2+build.19
|
maven_group = com.tterrag.blur
|
||||||
|
archives_base_name = Blur
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
|
fabric_version=0.26.1+1.16
|
||||||
|
|
||||||
auto_config_version = 3.2.0-unstable
|
auto_config_version = 3.2.0-unstable
|
||||||
cloth_config_version = 4.7.0-unstable
|
cloth_config_version = 4.7.0-unstable
|
||||||
mod_menu_version = 1.14.6+build.31
|
mod_menu_version = 1.14.6+build.31
|
||||||
|
satin_version = 1.6.0-nightly.20w48a
|
||||||
# Satin library
|
|
||||||
satin_version = 1.5.1
|
|
||||||
|
|
||||||
project_id=268324
|
|
||||||
release_type=release
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ public class Blur implements ClientModInitializer {
|
|||||||
public static final String MODID = "blur";
|
public static final String MODID = "blur";
|
||||||
|
|
||||||
private long start;
|
private long start;
|
||||||
|
|
||||||
public int colorFirst, colorSecond;
|
public int colorFirst, colorSecond;
|
||||||
|
|
||||||
private final ManagedShaderEffect blur = ShaderEffectManager.getInstance().manage(new Identifier(MODID, "shaders/post/fade_in_blur.json"),
|
private final ManagedShaderEffect blur = ShaderEffectManager.getInstance().manage(new Identifier(MODID, "shaders/post/fade_in_blur.json"),
|
||||||
|
|||||||
@@ -1,21 +1,11 @@
|
|||||||
package com.tterrag.blur.config;
|
package com.tterrag.blur.config;
|
||||||
|
|
||||||
import com.sun.org.apache.xerces.internal.xs.StringList;
|
|
||||||
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
|
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
|
||||||
import me.sargunvohra.mcmods.autoconfig1u.ConfigHolder;
|
|
||||||
import me.sargunvohra.mcmods.autoconfig1u.ConfigManager;
|
|
||||||
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
|
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
|
||||||
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry;
|
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry;
|
||||||
import me.sargunvohra.mcmods.autoconfig1u.gui.registry.DefaultGuiRegistryAccess;
|
|
||||||
import me.shedaniel.clothconfig2.api.ConfigScreen;
|
|
||||||
import net.minecraft.client.gui.screen.ChatScreen;
|
import net.minecraft.client.gui.screen.ChatScreen;
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Config(name = "blur")
|
@Config(name = "blur")
|
||||||
@SuppressWarnings("No GUI provider registered")
|
|
||||||
public class BlurConfig implements ConfigData {
|
public class BlurConfig implements ConfigData {
|
||||||
@ConfigEntry.Gui.Excluded
|
@ConfigEntry.Gui.Excluded
|
||||||
public String[] blurExclusions = new String[]{ ChatScreen.class.getName() };
|
public String[] blurExclusions = new String[]{ ChatScreen.class.getName() };
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import net.fabricmc.api.EnvType;
|
|||||||
import net.fabricmc.api.Environment;
|
import net.fabricmc.api.Environment;
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
@SuppressWarnings("No GUI provider registered")
|
|
||||||
public class ModMenuIntegration implements ModMenuApi {
|
public class ModMenuIntegration implements ModMenuApi {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user