Skip to content

Commit

Permalink
Blur 2.3.0 - Update to MidnightLib v0.2.5
Browse files Browse the repository at this point in the history
Add live config preview
Russian translations by @Felix14-v2
Brazilian translations by @Percario
  • Loading branch information
Motschen committed Sep 24, 2021
1 parent 79814b4 commit 0eb076f
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 22 deletions.
12 changes: 4 additions & 8 deletions build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ repositories {
includeGroupByRegex 'io\\.github\\.onyxstudios.*'
}
}
maven {
url = 'https://maven.terraformersmc.com/releases'
content {
includeGroup 'com.terraformersmc'
}
flatDir {
dirs 'local_maven'
}
}

Expand All @@ -35,10 +32,9 @@ dependencies {
modImplementation "io.github.ladysnake:satin:${satin_version}"
include "io.github.ladysnake:satin:${satin_version}"

modCompileOnly "com.terraformersmc:modmenu:${project.modmenu_version}"
modRuntime "com.terraformersmc:modmenu:${project.modmenu_version}"

implementation 'com.google.code.findbugs:jsr305:3.0.2'
modImplementation "eu.midnightdust:midnightlib:${midnightlib_version}"
include "eu.midnightdust:midnightlib:${midnightlib_version}"
}

processResources {
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.17
yarn_mappings=1.17+build.13
loader_version=0.11.6
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.61
loader_version=0.11.7

# Mod Properties
mod_version = 2.2.1-1.17+fabric
mod_version = 2.3.0-1.17+fabric
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.38.0+1.17
modmenu_version = 2.0.4
fabric_version=0.40.1+1.17
satin_version = 1.6.4
midnightlib_version=0.2.5
Binary file added local_maven/midnightlib-0.2.5.jar
Binary file not shown.
4 changes: 1 addition & 3 deletions src/main/java/com/tterrag/blur/mixin/MixinMinecraftClient.java
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.At.Shift;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import com.tterrag.blur.Blur;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.resource.ReloadableResourceManager;

@Mixin(MinecraftClient.class)
public class MixinMinecraftClient {

@Inject(method = "openScreen",
@Inject(method = "setScreen",
at = @At(value = "FIELD",
target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;",
opcode = Opcodes.PUTFIELD))
Expand Down
20 changes: 19 additions & 1 deletion src/main/java/com/tterrag/blur/mixin/MixinScreen.java
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,15 +1,33 @@
package com.tterrag.blur.mixin;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.util.math.MatrixStack;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

import com.tterrag.blur.Blur;

import net.minecraft.client.gui.screen.Screen;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.Locale;

@Mixin(Screen.class)
public class MixinScreen {
public abstract class MixinScreen {

@Shadow @Nullable protected MinecraftClient client;

@Inject(at = @At("HEAD"), method = "render")
private void reloadShader(MatrixStack matrixStack, int i, int j, float f, CallbackInfo ci) {
if (this.getClass().toString().toLowerCase(Locale.ROOT).contains("midnight") && this.client != null) {
Blur.INSTANCE.onScreenChange(this.client.currentScreen);
}
}

@ModifyConstant(
method = "renderBackground(Lnet/minecraft/client/util/math/MatrixStack;I)V",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/blur/lang/en_us.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"blur.midnightconfig.title": "Blur Config",
"blur.midnightconfig.blurExclusions": "Blur Exclusions are currently not configurable in-game!",
"blur.midnightconfig.blurExclusions": "§cBlur Exclusions are currently not configurable in-game!",
"blur.midnightconfig.fadeTimeMillis": "Fade Time (in milliseconds)",
"blur.midnightconfig.radius": "Radius",
"blur.midnightconfig.gradientStartColor": "Gradient Start Color",
Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/fabric.mod.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"entrypoints": {
"client": [
"com.tterrag.blur.Blur::INSTANCE"
],
"modmenu": [
"com.tterrag.blur.config.ModMenuIntegration"
]
},
"contact": {
Expand Down

0 comments on commit 0eb076f

Please sign in to comment.