mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-13 10:25:09 +01:00
Compare commits
8 Commits
695fa67270
...
plus-1.21.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d207e8197 | ||
|
|
5e4f4abd3b | ||
|
|
97c3a1c2ac | ||
|
|
bc62322743 | ||
|
|
fa6fd82e4d | ||
|
|
528958fa8c | ||
|
|
552f1e619e | ||
|
|
c9c630ac11 |
@@ -3,7 +3,7 @@ import groovy.json.JsonOutput
|
||||
|
||||
plugins {
|
||||
id "architectury-plugin" version "3.4-SNAPSHOT"
|
||||
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
|
||||
id "dev.architectury.loom" version "1.10-SNAPSHOT" apply false
|
||||
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
|
||||
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import eu.midnightdust.lib.util.MidnightColorUtil;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import org.joml.Math;
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Matrix3x2f;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.lang.Double;
|
||||
@@ -23,20 +23,19 @@ public class Blur {
|
||||
|
||||
public static boolean doFade = false;
|
||||
|
||||
static float lastDelta;
|
||||
public static void onRender(DrawContext context, int width, int height, MinecraftClient client, float delta) {
|
||||
public static void onRender() {
|
||||
if (!BlurInfo.doTest && BlurInfo.screenChanged) { // After the tests for blur and background color have been completed
|
||||
Blur.onScreenChange();
|
||||
BlurInfo.screenChanged = false;
|
||||
}
|
||||
|
||||
BlurInfo.doTest = false; // Set the test state to completed, as tests will happen in the same tick.
|
||||
}
|
||||
public static void renderFadeout(DrawContext context, int width, int height, MinecraftClient client) {
|
||||
if (BlurInfo.start >= 0 && !BlurInfo.screenHasBlur && BlurInfo.prevScreenHasBlur) { // Fade out in non-blurred screens
|
||||
client.gameRenderer.renderBlur();
|
||||
|
||||
if (BlurInfo.prevScreenHasBackground && BlurConfig.useGradient && lastDelta != delta) Blur.renderRotatedGradient(context, width, height);
|
||||
lastDelta = delta;
|
||||
if (BlurInfo.prevScreenHasBackground && BlurConfig.useGradient) Blur.renderRotatedGradient(context, width, height);
|
||||
}
|
||||
BlurInfo.doTest = false; // Set the test state to completed, as tests will happen in the same tick.
|
||||
}
|
||||
|
||||
public static void onScreenChange() {
|
||||
@@ -79,7 +78,10 @@ public class Blur {
|
||||
int b = (col.getRGB() >> 8) & 0xFF;
|
||||
int g = col.getRGB() & 0xFF;
|
||||
float prog = progress;
|
||||
a *= prog; r *= prog; g *= prog; b *= prog;
|
||||
a = (int) (prog * a);
|
||||
r = (int) (prog * r);
|
||||
g = (int) (prog * g);
|
||||
b = (int) (prog * b);
|
||||
return a << 24 | r << 16 | b << 8 | g;
|
||||
}
|
||||
public static int getRotation() {
|
||||
@@ -90,11 +92,12 @@ public class Blur {
|
||||
float diagonal = Math.sqrt((float) width*width + height*height);
|
||||
int smallestDimension = Math.min(width, height);
|
||||
|
||||
Matrix4f posMatrix = context.getMatrices().peek().getPositionMatrix();
|
||||
posMatrix.rotationZ(Math.toRadians(getRotation()));
|
||||
posMatrix.setTranslation(width / 2f, height / 2f, 0); // Make the gradient's center the pivot point
|
||||
context.getMatrices().pushMatrix();
|
||||
Matrix3x2f posMatrix = context.getMatrices();
|
||||
posMatrix.rotate(Math.toRadians(getRotation()));
|
||||
posMatrix.setTranslation(width / 2f, height / 2f); // Make the gradient's center the pivot point
|
||||
posMatrix.scale(diagonal / smallestDimension); // Scales the gradient to the maximum diagonal value needed
|
||||
context.fillGradient(-width / 2, -height / 2, width / 2, height / 2, Blur.getBackgroundColor(false), Blur.getBackgroundColor(true)); // Actually draw the gradient
|
||||
posMatrix.rotationZ(0);
|
||||
context.getMatrices().popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
package eu.midnightdust.blur.config;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import eu.midnightdust.blur.Blur;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.widget.SliderWidget;
|
||||
import net.minecraft.client.gui.widget.TextIconButtonWidget;
|
||||
import net.minecraft.client.option.GameOptions;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.lang.Math.*;
|
||||
@@ -15,6 +23,8 @@ public class BlurConfig extends MidnightConfig {
|
||||
public static final String SCREENS = "screens";
|
||||
@Entry @Hidden public static int configVersion = 2;
|
||||
|
||||
@Comment(category = SCREENS, centered = true)
|
||||
public static Comment _general;
|
||||
@Entry(category = SCREENS)
|
||||
public static boolean blurContainers = true;
|
||||
@Entry(category = SCREENS)
|
||||
@@ -22,14 +32,17 @@ public class BlurConfig extends MidnightConfig {
|
||||
@Condition(requiredOption = "blurTitleScreen", visibleButLocked = true)
|
||||
@Entry(category = SCREENS)
|
||||
public static boolean darkenTitleScreen = false;
|
||||
@Entry(category = ANIMATIONS, min = 0, max = 2000, isSlider = true)
|
||||
public static int fadeTimeMillis = 300;
|
||||
@Entry(category = ANIMATIONS, min = 0, max = 2000, isSlider = true)
|
||||
public static int fadeOutTimeMillis = 300;
|
||||
@Entry(category = ANIMATIONS)
|
||||
public static BlurConfig.Easing animationCurve = Easing.FLAT;
|
||||
@Entry(category = STYLE, isSlider = true, min = 0, max = 20)
|
||||
public static int radius = 5;
|
||||
@Comment(category = SCREENS, centered = true)
|
||||
public static Comment _advanced;
|
||||
@Entry(category = SCREENS) // Screens where Blur+ should not apply transition effects (mostly dynamically blurred screens)
|
||||
public static List<String> excludedScreens = Lists.newArrayList("net.irisshaders.iris.gui.screen.ShaderPackScreen");
|
||||
@Entry(category = SCREENS) // Screens where the vanilla blur effect should be force enabled
|
||||
public static List<String> forceEnabledScreens = Lists.newArrayList("dev.emi.emi.screen.RecipeScreen");
|
||||
@Entry(category = SCREENS) // Screens where the vanilla blur effect should be force disabled
|
||||
public static List<String> forceDisabledScreens = Lists.newArrayList();
|
||||
|
||||
@Comment(category = STYLE, centered = true)
|
||||
public static Comment _gradient;
|
||||
@Entry(category = STYLE)
|
||||
public static boolean useGradient = true;
|
||||
@Condition(requiredOption = "useGradient", visibleButLocked = true)
|
||||
@@ -49,19 +62,15 @@ public class BlurConfig extends MidnightConfig {
|
||||
public static int gradientRotation = 0;
|
||||
@Entry(category = STYLE)
|
||||
public static boolean rainbowMode = false;
|
||||
@Entry(category = SCREENS) // Screens where Blur+ should not apply transition effects (mostly dynamically blurred screens)
|
||||
public static List<String> excludedScreens = Lists.newArrayList("net.irisshaders.iris.gui.screen.ShaderPackScreen");
|
||||
@Entry(category = SCREENS) // Screens where the vanilla blur effect should be force enabled
|
||||
public static List<String> forceEnabledScreens = Lists.newArrayList("dev.emi.emi.screen.RecipeScreen");
|
||||
@Entry(category = SCREENS) // Screens where the vanilla blur effect should be force disabled
|
||||
public static List<String> forceDisabledScreens = Lists.newArrayList();
|
||||
|
||||
@Override
|
||||
public void writeChanges(String modid) {
|
||||
super.writeChanges(modid);
|
||||
if (MinecraftClient.getInstance().options != null)
|
||||
MinecraftClient.getInstance().options.getMenuBackgroundBlurriness().setValue(radius);
|
||||
}
|
||||
@Comment(category = ANIMATIONS, centered = true)
|
||||
public static Comment _animations;
|
||||
@Entry(category = ANIMATIONS, min = 0, max = 2000, isSlider = true)
|
||||
public static int fadeTimeMillis = 300;
|
||||
@Entry(category = ANIMATIONS, min = 0, max = 2000, isSlider = true)
|
||||
public static int fadeOutTimeMillis = 300;
|
||||
@Entry(category = ANIMATIONS)
|
||||
public static BlurConfig.Easing animationCurve = Easing.FLAT;
|
||||
|
||||
public enum Easing {
|
||||
// Based on https://gist.github.com/dev-hydrogen/21a66f83f0386123e0c0acf107254843
|
||||
@@ -90,4 +99,51 @@ public class BlurConfig extends MidnightConfig {
|
||||
return functionOut.apply(x).doubleValue();
|
||||
}
|
||||
}
|
||||
private static GameOptions options;
|
||||
|
||||
@Override
|
||||
public void onTabInit(String tabName, MidnightConfigListWidget list, MidnightConfigScreen screen) {
|
||||
options = MinecraftClient.getInstance().options;
|
||||
if (Objects.equals(tabName, STYLE)) {
|
||||
EntryInfo centered = new EntryInfo(null, Blur.MOD_ID);
|
||||
centered.comment = new Comment(){
|
||||
@Override
|
||||
public boolean centered() {
|
||||
return true;
|
||||
}
|
||||
public Class<? extends Annotation> annotationType() {return null;}
|
||||
public String category() {return "";}
|
||||
public String name() {return "";}
|
||||
public String url() {return "";}
|
||||
public String requiredMod() {return "";}
|
||||
};
|
||||
RadiusSliderWidget slider = new RadiusSliderWidget(screen.width - 185, 0, 150, 20);
|
||||
|
||||
TextIconButtonWidget resetButton = TextIconButtonWidget.builder(Text.translatable("controls.reset"), (button -> {
|
||||
options.getMenuBackgroundBlurriness().setValue(5);
|
||||
screen.updateList();
|
||||
}), true).texture(Identifier.of("midnightlib","icon/reset"), 12, 12).dimension(20, 20).build();
|
||||
resetButton.setPosition(screen.width - 205 + 150 + 25, 0);
|
||||
slider.resetButton = resetButton;
|
||||
slider.updateMessage();
|
||||
|
||||
list.addButton(Lists.newArrayList(), Text.translatable("blur.midnightconfig._blur"), centered);
|
||||
list.addButton(Lists.newArrayList(slider, resetButton), Text.translatable("blur.midnightconfig.radius"), new EntryInfo(null, Blur.MOD_ID));
|
||||
}
|
||||
}
|
||||
|
||||
public static class RadiusSliderWidget extends SliderWidget {
|
||||
TextIconButtonWidget resetButton;
|
||||
public RadiusSliderWidget(int x, int y, int width, int height) {
|
||||
super(x, y, width, height, Text.empty(), options.getMenuBackgroundBlurrinessValue() / 20d);
|
||||
}
|
||||
public void updateMessage() {
|
||||
this.setMessage(Text.of(String.valueOf(options.getMenuBackgroundBlurrinessValue())));
|
||||
if (resetButton != null) resetButton.active = options.getMenuBackgroundBlurrinessValue() != 5;
|
||||
}
|
||||
|
||||
public void applyValue() {
|
||||
options.getMenuBackgroundBlurriness().setValue(Double.valueOf(this.value * 20).intValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ public abstract class MixinGameOptions {
|
||||
@Shadow @Final private SimpleOption<Integer> menuBackgroundBlurriness;
|
||||
@Shadow @Final private SimpleOption<Double> chatLineSpacing;
|
||||
|
||||
@Redirect(method = "<init>", at = @At(value = "NEW", target = "net/minecraft/client/option/SimpleOption$ValidatingIntSliderCallbacks", ordinal = 2))
|
||||
@Redirect(method = "<init>", at = @At(value = "NEW", target = "net/minecraft/client/option/SimpleOption$ValidatingIntSliderCallbacks", ordinal = 3))
|
||||
private SimpleOption.ValidatingIntSliderCallbacks blur$increaseMaxBlurriness(int minInclusive, int maxInclusive) {
|
||||
if (this.menuBackgroundBlurriness == null && this.chatLineSpacing != null)
|
||||
return new SimpleOption.ValidatingIntSliderCallbacks(minInclusive, 20);
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
package eu.midnightdust.blur.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import eu.midnightdust.blur.Blur;
|
||||
import eu.midnightdust.blur.BlurInfo;
|
||||
import net.minecraft.client.option.GameOptions;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(GameRenderer.class)
|
||||
public class MixinGameRenderer {
|
||||
@ModifyVariable(method = "renderBlur", at = @At("STORE"), ordinal = 0)
|
||||
private float blur$modifyRadius(float radius) { // Modify the radius based on the animation progress
|
||||
@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/GameOptions;getMenuBackgroundBlurrinessValue()I"))
|
||||
private int blur$modifyRadius(GameOptions instance, Operation<Integer> original) {
|
||||
int radius = instance.getMenuBackgroundBlurrinessValue();
|
||||
if (!BlurInfo.screenChanged && BlurInfo.start >= 0) // Only update the progress after all tests have been completed
|
||||
Blur.updateProgress(BlurInfo.screenHasBlur);
|
||||
return radius * BlurInfo.progress;
|
||||
return (int) (radius * BlurInfo.progress);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,10 +20,10 @@ public class MixinHandledScreen extends Screen {
|
||||
|
||||
@Inject(method = "renderBackground", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawBackground(Lnet/minecraft/client/gui/DrawContext;FII)V", shift = At.Shift.BEFORE))
|
||||
private void blur$renderContainerBlur(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { // Applies the blur effect in containers (Inventory, Chest, etc.)
|
||||
if (BlurConfig.blurContainers) this.applyBlur();
|
||||
if (BlurConfig.blurContainers) this.applyBlur(context);
|
||||
}
|
||||
@Inject(at = @At("HEAD"), method = "render")
|
||||
public void blur$processScreenChange(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (PlatformFunctions.getPlatformName().equals("neoforge")) Blur.onRender(context, width, height, this.client, delta);
|
||||
if (PlatformFunctions.getPlatformName().equals("neoforge")) Blur.onRender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class MixinInGameHud {
|
||||
if (client.currentScreen == null && client.world != null && BlurInfo.start >= 0 && BlurInfo.prevScreenHasBlur) {
|
||||
BlurInfo.doTest = false;
|
||||
BlurInfo.screenChanged = false;
|
||||
this.client.gameRenderer.renderBlur();
|
||||
context.applyBlur();
|
||||
|
||||
if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package eu.midnightdust.blur.mixin;
|
||||
|
||||
import eu.midnightdust.blur.Blur;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
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.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@Mixin(value = MidnightConfig.EntryInfo.class, remap = false)
|
||||
public abstract class MixinMidnightConfig$EntryInfo {
|
||||
@Shadow @Final public String modid;
|
||||
@Shadow @Final public String fieldName;
|
||||
@Shadow Object value;
|
||||
|
||||
@Inject(at = @At(value = "TAIL"), method = "updateFieldValue")
|
||||
private void blur$instantlyApplyRadius(CallbackInfo ci) {
|
||||
if (Objects.equals(modid, Blur.MOD_ID) && Objects.equals(fieldName, "radius"))
|
||||
MinecraftClient.getInstance().options.getMenuBackgroundBlurriness().setValue((int) value);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package eu.midnightdust.blur.mixin;
|
||||
|
||||
import eu.midnightdust.blur.config.BlurConfig;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
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.callback.CallbackInfo;
|
||||
|
||||
@Mixin(MidnightConfig.class)
|
||||
public abstract class MixinMidnightConfig {
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lcom/google/gson/Gson;fromJson(Ljava/io/Reader;Ljava/lang/Class;)Ljava/lang/Object;", shift = At.Shift.AFTER), remap = false, method = "loadValuesFromJson")
|
||||
private static void blur$syncRadius(CallbackInfo ci) {
|
||||
BlurConfig.radius = MinecraftClient.getInstance().options.getMenuBackgroundBlurrinessValue();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
package eu.midnightdust.blur.mixin;
|
||||
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
|
||||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
|
||||
import eu.midnightdust.blur.BlurInfo;
|
||||
import eu.midnightdust.blur.config.BlurConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
|
||||
@@ -20,18 +24,16 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
public abstract class MixinScreen {
|
||||
@Shadow @Final protected Text title;
|
||||
@Shadow protected MinecraftClient client;
|
||||
@Shadow public abstract void renderInGameBackground(DrawContext context);
|
||||
@Shadow public int width;
|
||||
@Shadow public int height;
|
||||
@Shadow protected abstract void applyBlur(DrawContext context);
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "render")
|
||||
public void blur$processScreenChange(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
Blur.onRender(context, width, height, this.client, delta);
|
||||
}
|
||||
@Inject(at = @At("HEAD"), method = "renderInGameBackground")
|
||||
public void blur$getBackgroundEnabled(DrawContext context, CallbackInfo ci) {
|
||||
BlurInfo.screenHasBackground = true; // Test if the screen has a background
|
||||
Blur.onRender();
|
||||
Blur.renderFadeout(context, width, height, client);
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "applyBlur", cancellable = true)
|
||||
public void blur$getBlurEnabled(CallbackInfo ci) {
|
||||
if (BlurConfig.forceDisabledScreens.contains(this.getClass().getCanonicalName())) {
|
||||
@@ -41,20 +43,23 @@ public abstract class MixinScreen {
|
||||
BlurInfo.screenHasBlur = true; // Test if the screen has blur
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "renderDarkening(Lnet/minecraft/client/gui/DrawContext;IIII)V", cancellable = true)
|
||||
public void blur$applyGradient(DrawContext context, int x, int y, int width, int height, CallbackInfo ci) {
|
||||
if (BlurConfig.useGradient) { // Replaces the background texture with a gradient
|
||||
renderInGameBackground(context);
|
||||
ci.cancel();
|
||||
}
|
||||
@WrapOperation(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/Screen;renderBackgroundTexture(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/util/Identifier;IIFFII)V"), method = "renderDarkening(Lnet/minecraft/client/gui/DrawContext;IIII)V")
|
||||
private void blur$applyGradient(DrawContext context, Identifier texture, int x, int y, float u, float v, int width, int height, Operation<Void> original) {
|
||||
if (BlurConfig.useGradient) {
|
||||
blur$renderGradient(context); // Replaces the background texture with a gradient
|
||||
} else original.call(context, texture, x, y, u, v, width, height);
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "renderInGameBackground", cancellable = true)
|
||||
public void blur$rotatedGradient(DrawContext context, CallbackInfo ci) {
|
||||
@WrapOperation(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;fillGradient(IIIIII)V"), method = "renderInGameBackground")
|
||||
public void blur$rotatedGradient(DrawContext context, int startX, int startY, int endX, int endY, int colorStart, int colorEnd, Operation<Void> original) {
|
||||
blur$renderGradient(context);
|
||||
}
|
||||
@Unique
|
||||
private void blur$renderGradient(DrawContext context) {
|
||||
BlurInfo.screenHasBackground = true; // Test if the screen has a background
|
||||
if (BlurConfig.forceEnabledScreens.contains(this.getClass().getCanonicalName()))
|
||||
((ScreenAccessor)this).forceApplyBlur();
|
||||
this.applyBlur(context);
|
||||
|
||||
Blur.renderRotatedGradient(context, width, height); // Replaces the default gradient with our rotated one
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ public abstract class MixinTitleScreen extends Screen {
|
||||
super(title);
|
||||
}
|
||||
|
||||
@Inject(method = "renderPanoramaBackground", at = @At("TAIL"))
|
||||
private void blur$renderTitleBlur(DrawContext context, float delta, CallbackInfo ci) { // Applies the blur effect in containers (Inventory, Chest, etc.)
|
||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/TitleScreen;renderPanoramaBackground(Lnet/minecraft/client/gui/DrawContext;F)V"))
|
||||
private void blur$renderTitleBlur(DrawContext context, int mouseX, int mouseY, float deltaTicks, CallbackInfo ci) {
|
||||
if (BlurConfig.blurTitleScreen) {
|
||||
Blur.updateProgress(true);
|
||||
this.applyBlur();
|
||||
this.applyBlur(context);
|
||||
if (BlurConfig.darkenTitleScreen) this.renderDarkening(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
package eu.midnightdust.blur.mixin;
|
||||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
@Mixin(Screen.class)
|
||||
public interface ScreenAccessor {
|
||||
@Invoker("applyBlur")
|
||||
void forceApplyBlur();
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"blur.midnightconfig.title": "Blur+ Konfiguration",
|
||||
"blur.midnightconfig.category.animations": "Animationen",
|
||||
"blur.midnightconfig.category.screens": "Bildschirme",
|
||||
"blur.midnightconfig.category.style": "Stil",
|
||||
"blur.midnightconfig.blurContainers": "Unschärfe in Containern",
|
||||
"blur.midnightconfig.blurTitleScreen": "Unschärfe im Titelbildschirm",
|
||||
@@ -26,5 +27,10 @@
|
||||
"blur.midnightconfig.gradientStartAlpha": "Farbverlauf-Anfangstransparenz",
|
||||
"blur.midnightconfig.gradientEndAlpha": "Farbverlauf-Endstransparenz",
|
||||
"blur.midnightconfig.gradientRotation": "Farbverlauf-Rotation",
|
||||
"blur.midnightconfig.excludedScreens": "Ausgeschlossene Bildschirme"
|
||||
"blur.midnightconfig.excludedScreens": "Ausgeschlossene Bildschirme",
|
||||
"blur.midnightconfig._general": "⛏ Generell",
|
||||
"blur.midnightconfig._advanced": "⚒ Fortgeschritten",
|
||||
"blur.midnightconfig._blur": "▒ Unschärfe",
|
||||
"blur.midnightconfig._gradient": "\uD83D\uDFE2 Farbverlauf",
|
||||
"blur.midnightconfig._animations": "\uD83D\uDCFD Animationen"
|
||||
}
|
||||
@@ -33,5 +33,10 @@
|
||||
"blur.midnightconfig.forceEnabledScreens": "Force-enabled Screens",
|
||||
"blur.midnightconfig.forceEnabledScreens.tooltip": "Screens where the vanilla blur effect should be force-enabled\nMight not work 100% of the time",
|
||||
"blur.midnightconfig.forceDisabledScreens": "Force-disabled Screens",
|
||||
"blur.midnightconfig.forceDisabledScreens.tooltip": "Screens where the vanilla blur effect should be force-disabled"
|
||||
"blur.midnightconfig.forceDisabledScreens.tooltip": "Screens where the vanilla blur effect should be force-disabled",
|
||||
"blur.midnightconfig._general": "⛏ General",
|
||||
"blur.midnightconfig._advanced": "⚒ Advanced",
|
||||
"blur.midnightconfig._blur": "▒ Blur",
|
||||
"blur.midnightconfig._gradient": "\uD83D\uDFE2 Gradient",
|
||||
"blur.midnightconfig._animations": "\uD83D\uDCFD Animations"
|
||||
}
|
||||
41
common/src/main/resources/assets/blur/lang/es_ar.json
Normal file
41
common/src/main/resources/assets/blur/lang/es_ar.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"blur.midnightconfig.title": "Configuración de Blur+",
|
||||
"blur.midnightconfig.category.animations": "Animaciones",
|
||||
"blur.midnightconfig.category.style": "Estilo",
|
||||
"blur.midnightconfig.category.screens": "Pantallas",
|
||||
|
||||
"blur.midnightconfig.blurContainers": "Aplicar Desenfoque a Contenedores",
|
||||
"blur.midnightconfig.fadeTimeMillis": "Tiempo de Aparición (en milisegundos)",
|
||||
"blur.midnightconfig.fadeOutTimeMillis": "Tiempo de Desaparición (en milisegundos)",
|
||||
"blur.midnightconfig.animationCurve": "Curva de Animación",
|
||||
|
||||
"blur.midnightconfig.enum.Easing.FLAT": "Plano",
|
||||
"blur.midnightconfig.enum.Easing.SINE": "Seno",
|
||||
"blur.midnightconfig.enum.Easing.QUAD": "Cuadrática",
|
||||
"blur.midnightconfig.enum.Easing.CUBIC": "Cúbica",
|
||||
"blur.midnightconfig.enum.Easing.QUART": "Cuártica",
|
||||
"blur.midnightconfig.enum.Easing.QUINT": "Quíntica",
|
||||
"blur.midnightconfig.enum.Easing.EXPO": "Exponencial",
|
||||
"blur.midnightconfig.enum.Easing.CIRC": "Circular",
|
||||
"blur.midnightconfig.enum.Easing.BACK": "Retroceso",
|
||||
"blur.midnightconfig.enum.Easing.ELASTIC": "Elástica",
|
||||
|
||||
"blur.midnightconfig.radius": "Radio",
|
||||
"blur.midnightconfig.rainbowMode": "Modo Arcoíris \ud83c\udf08",
|
||||
|
||||
"blur.midnightconfig.useGradient": "Usar Gradiente como Fondo",
|
||||
"blur.midnightconfig.gradientStart": "Color Inicial del Gradiente",
|
||||
"blur.midnightconfig.gradientEnd": "Color Final del Gradiente",
|
||||
"blur.midnightconfig.gradientStartAlpha": "Transparencia Inicial del Gradiente",
|
||||
"blur.midnightconfig.gradientEndAlpha": "Transparencia Final del Gradiente",
|
||||
"blur.midnightconfig.gradientRotation": "Rotación del Gradiente",
|
||||
|
||||
"blur.midnightconfig.excludedScreens": "Pantallas Excluidas",
|
||||
"blur.midnightconfig.excludedScreens.tooltip": "Pantallas donde Blur+ no debería animar",
|
||||
|
||||
"blur.midnightconfig.forceEnabledScreens": "Pantallas con Blur Forzado",
|
||||
"blur.midnightconfig.forceEnabledScreens.tooltip": "Pantallas donde el desenfoque vanilla debería forzarse habilitado\nPuede que no funcione siempre al 100%",
|
||||
|
||||
"blur.midnightconfig.forceDisabledScreens": "Pantallas con Blur Deshabilitado",
|
||||
"blur.midnightconfig.forceDisabledScreens.tooltip": "Pantallas donde el desenfoque vanilla debería forzarse deshabilitado"
|
||||
}
|
||||
@@ -8,12 +8,9 @@
|
||||
"MixinGameRenderer",
|
||||
"MixinHandledScreen",
|
||||
"MixinInGameHud",
|
||||
"MixinMidnightConfig",
|
||||
"MixinMidnightConfig$EntryInfo",
|
||||
"MixinMinecraftClient",
|
||||
"MixinScreen",
|
||||
"MixinTitleScreen",
|
||||
"ScreenAccessor"
|
||||
"MixinTitleScreen"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
"authors": [
|
||||
"Motschen",
|
||||
"tterrag1098",
|
||||
"Pyrofab",
|
||||
"Pyrofab"
|
||||
],
|
||||
"contributors": [
|
||||
"backryun",
|
||||
"byquanton"
|
||||
],
|
||||
@@ -31,6 +33,7 @@
|
||||
"blur.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"minecraft": ">=1.21.2"
|
||||
"minecraft": ">=1.21.2",
|
||||
"midnightlib": ">=1.7.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
org.gradle.parallel=true
|
||||
|
||||
minecraft_version=1.21.4
|
||||
supported_versions=1.21.5
|
||||
yarn_mappings=1.21.4+build.1
|
||||
minecraft_version=1.21.6
|
||||
supported_versions=
|
||||
yarn_mappings=1.21.6+build.1
|
||||
enabled_platforms=fabric,neoforge
|
||||
|
||||
# Mod Properties
|
||||
mod_version=5.2.0
|
||||
mod_version=5.2.2
|
||||
maven_group=eu.midnightdust.blur
|
||||
archives_base_name=blur
|
||||
release_type=release
|
||||
@@ -16,12 +16,12 @@ curseforge_id=393563
|
||||
modrinth_id=NK39zBp2
|
||||
|
||||
# Modloaders
|
||||
fabric_loader_version=0.16.9
|
||||
fabric_api_version=0.111.0+1.21.4
|
||||
fabric_loader_version=0.16.14
|
||||
fabric_api_version=0.127.0+1.21.6
|
||||
|
||||
neoforge_version=21.4.10-beta
|
||||
neoforge_version=21.6.0-beta
|
||||
yarn_mappings_patch_neoforge_version = 1.21+build.4
|
||||
|
||||
# Libraries
|
||||
midnightlib_version = 1.7.0+1.21.4
|
||||
midnightlib_version = 1.7.4+1.21.6
|
||||
modmenu_version = 11.0.2
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -28,4 +28,11 @@ modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.21.2,)"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
|
||||
[[dependencies.blur]]
|
||||
modId = "midnightlib"
|
||||
mandatory = true
|
||||
versionRange = "[1.7.3,)"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
Reference in New Issue
Block a user