mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-15 11:15:09 +01:00
Update to 1.16.2
This commit is contained in:
@@ -3,7 +3,7 @@ plugins {
|
||||
id 'maven-publish'
|
||||
id 'idea'
|
||||
id 'eclipse'
|
||||
id 'com.matthewprenger.cursegradle' version '1.0.9'
|
||||
id 'com.matthewprenger.cursegradle' version '1.4.0'
|
||||
id 'fabric-loom' version '0.4-SNAPSHOT'
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ minecraft {
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven { url 'https://jitpack.io' }
|
||||
jcenter()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -29,8 +29,8 @@ dependencies {
|
||||
mappings "net.fabricmc:yarn:${mappings_version}"
|
||||
modCompile "net.fabricmc:fabric-loader:${fabric_loader_version}"
|
||||
modCompile "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
||||
modCompile "com.github.Ladysnake:Satin:${satin_version}"
|
||||
include "com.github.Ladysnake:Satin:${satin_version}"
|
||||
modCompile "io.github.ladysnake:Satin:${satin_version}"
|
||||
include "io.github.ladysnake:Satin:${satin_version}"
|
||||
|
||||
implementation 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
minecraft_version=1.16-rc1
|
||||
minecraft_version=1.16.2
|
||||
|
||||
mod_version=1.0.5
|
||||
mod_version=1.0.6
|
||||
|
||||
fabric_loader_version=0.8.8+build.202
|
||||
fabric_version=0.12.5+build.367-1.16
|
||||
mappings_version=1.16-rc1+build.8
|
||||
fabric_loader_version=0.9.1+build.205
|
||||
fabric_version=0.18.0+build.397-1.16
|
||||
mappings_version=1.16.2+build.19
|
||||
|
||||
# Satin library
|
||||
satin_version = 1.16-SNAPSHOT
|
||||
satin_version = 1.4.1
|
||||
|
||||
project_id=268324
|
||||
release_type=release
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.tterrag.blur;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import ladysnake.satin.api.event.ShaderEffectRenderCallback;
|
||||
import ladysnake.satin.api.experimental.managed.Uniform1f;
|
||||
import ladysnake.satin.api.managed.ManagedShaderEffect;
|
||||
import ladysnake.satin.api.managed.ShaderEffectManager;
|
||||
import ladysnake.satin.api.managed.uniform.Uniform1f;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
@@ -14,17 +14,15 @@ import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
|
||||
public class Blur implements ClientModInitializer {
|
||||
|
||||
public static final String MODID = "blur";
|
||||
public static final String MOD_NAME = "Blur";
|
||||
public static final String VERSION = "@VERSION@";
|
||||
|
||||
static class ConfigJson {
|
||||
String[] blurExclusions = new String[]{ ChatScreen.class.getName() };
|
||||
@@ -47,19 +45,20 @@ public class Blur implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
File configFile = new File(FabricLoader.getInstance().getConfigDirectory(), Blur.MODID + ".json");
|
||||
Path configFile = FabricLoader.getInstance().getConfigDir().resolve(Blur.MODID + ".json");
|
||||
try {
|
||||
if (!configFile.exists()) {
|
||||
configFile.getParentFile().mkdirs();
|
||||
Files.write(configFile.toPath(), new GsonBuilder().setPrettyPrinting().create().toJson(configs).getBytes(), StandardOpenOption.CREATE_NEW);
|
||||
if (!Files.exists(configFile)) {
|
||||
Files.createDirectories(configFile.getParent());
|
||||
Files.write(configFile, new GsonBuilder().setPrettyPrinting().create().toJson(configs).getBytes(), StandardOpenOption.CREATE_NEW);
|
||||
} else {
|
||||
configs = new Gson().fromJson(new FileReader(configFile), ConfigJson.class);
|
||||
configs = new Gson().fromJson(Files.newBufferedReader(configFile), ConfigJson.class);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
colorFirst = Integer.parseUnsignedInt(configs.gradientStartColor, 16);
|
||||
colorSecond = Integer.parseUnsignedInt(configs.gradientEndColor, 16);
|
||||
|
||||
ShaderEffectRenderCallback.EVENT.register((deltaTick) -> {
|
||||
if (start > 0) {
|
||||
blurProgress.set(getProgress());
|
||||
|
||||
@@ -20,7 +20,7 @@ public class MixinMinecraftClient {
|
||||
at = @At(value = "FIELD",
|
||||
target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;",
|
||||
opcode = Opcodes.PUTFIELD))
|
||||
public void onScreenOpen(Screen newScreen, CallbackInfo info) {
|
||||
private void onScreenOpen(Screen newScreen, CallbackInfo info) {
|
||||
Blur.INSTANCE.onScreenChange(newScreen);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@ public class MixinScreen {
|
||||
@ModifyConstant(
|
||||
method = "renderBackground(Lnet/minecraft/client/util/math/MatrixStack;I)V",
|
||||
constant = @Constant(intValue = -1072689136))
|
||||
public int getFirstBackgroundColor(int color) {
|
||||
private int getFirstBackgroundColor(int color) {
|
||||
return Blur.INSTANCE.getBackgroundColor(false);
|
||||
}
|
||||
|
||||
@ModifyConstant(
|
||||
method = "renderBackground(Lnet/minecraft/client/util/math/MatrixStack;I)V",
|
||||
constant = @Constant(intValue = -804253680))
|
||||
public int getSecondBackgroundColor(int color) {
|
||||
private int getSecondBackgroundColor(int color) {
|
||||
return Blur.INSTANCE.getBackgroundColor(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user