mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-13 02:15:09 +01:00
Update to 1.21.3
This commit is contained in:
@@ -9,7 +9,7 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(GameRenderer.class)
|
||||
public class MixinGameRenderer {
|
||||
@ModifyVariable(method = "renderBlur", at = @At("STORE"), ordinal = 1)
|
||||
@ModifyVariable(method = "renderBlur", at = @At("STORE"), ordinal = 0)
|
||||
private float blur$modifyRadius(float radius) { // Modify the radius based on the animation progress
|
||||
if (!BlurInfo.screenChanged && BlurInfo.start >= 0) // Only update the progress after all tests have been completed
|
||||
Blur.updateProgress(BlurInfo.screenHasBlur);
|
||||
|
||||
@@ -18,6 +18,6 @@ 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(delta);
|
||||
if (BlurConfig.blurContainers) this.applyBlur();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(tickCounter.getTickDelta(true));
|
||||
this.client.gameRenderer.renderBlur();
|
||||
this.client.getFramebuffer().beginWrite(false);
|
||||
|
||||
if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
|
||||
|
||||
@@ -32,7 +32,7 @@ public abstract class MixinScreen {
|
||||
}
|
||||
|
||||
if (BlurInfo.start >= 0 && !BlurInfo.screenHasBlur && BlurInfo.prevScreenHasBlur) { // Fade out in non-blurred screens
|
||||
this.client.gameRenderer.renderBlur(delta);
|
||||
this.client.gameRenderer.renderBlur();
|
||||
this.client.getFramebuffer().beginWrite(false);
|
||||
|
||||
if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, width, height);
|
||||
@@ -44,7 +44,7 @@ public abstract class MixinScreen {
|
||||
BlurInfo.screenHasBackground = true; // Test if the screen has a background
|
||||
}
|
||||
@Inject(at = @At("HEAD"), method = "applyBlur", cancellable = true)
|
||||
public void blur$getBlurEnabled(float delta, CallbackInfo ci) {
|
||||
public void blur$getBlurEnabled(CallbackInfo ci) {
|
||||
if (BlurConfig.forceDisabledScreens.contains(this.getClass().getCanonicalName())) {
|
||||
ci.cancel(); return;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public abstract class MixinScreen {
|
||||
@Inject(at = @At("HEAD"), method = "renderInGameBackground", cancellable = true)
|
||||
public void blur$rotatedGradient(DrawContext context, CallbackInfo ci) {
|
||||
if (BlurConfig.forceEnabledScreens.contains(this.getClass().getCanonicalName()))
|
||||
((ScreenAccessor)this).forceApplyBlur(client.getRenderTickCounter().getTickDelta(true));
|
||||
((ScreenAccessor)this).forceApplyBlur();
|
||||
|
||||
Blur.renderRotatedGradient(context, width, height); // Replaces the default gradient with our rotated one
|
||||
ci.cancel();
|
||||
|
||||
@@ -7,5 +7,5 @@ import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
@Mixin(Screen.class)
|
||||
public interface ScreenAccessor {
|
||||
@Invoker("applyBlur")
|
||||
void forceApplyBlur(float delta);
|
||||
void forceApplyBlur();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "blur",
|
||||
"name": "Blur+ (Fabric)",
|
||||
"name": "Blur+",
|
||||
"version": "$version",
|
||||
"environment": "client",
|
||||
"license": "MIT",
|
||||
@@ -31,6 +31,6 @@
|
||||
"blur.mixins.json"
|
||||
],
|
||||
"depends": {
|
||||
"minecraft": ">=1.20.5"
|
||||
"minecraft": ">=1.21.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
org.gradle.jvmargs=-Xmx2G
|
||||
org.gradle.parallel=true
|
||||
|
||||
minecraft_version=1.21
|
||||
supported_versions=1.21.1
|
||||
yarn_mappings=1.21+build.2
|
||||
minecraft_version=1.21.3
|
||||
supported_versions=1.21.2
|
||||
yarn_mappings=1.21.3+build.2
|
||||
enabled_platforms=fabric,neoforge
|
||||
|
||||
# Mod Properties
|
||||
mod_version=5.0.0
|
||||
mod_version=5.0.1
|
||||
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.15.11
|
||||
fabric_api_version=0.100.1+1.21
|
||||
fabric_loader_version=0.16.9
|
||||
fabric_api_version=0.107.0+1.21.3
|
||||
|
||||
neoforge_version=21.0.143
|
||||
neoforge_version=21.3.11-beta
|
||||
yarn_mappings_patch_neoforge_version = 1.21+build.4
|
||||
|
||||
# Libraries
|
||||
midnightlib_version = 1.6.3
|
||||
midnightlib_version = 1.6.4
|
||||
modmenu_version = 11.0.2
|
||||
|
||||
@@ -26,6 +26,6 @@ side = "CLIENT"
|
||||
[[dependencies.blur]]
|
||||
modId = "minecraft"
|
||||
mandatory = true
|
||||
versionRange = "[1.21,)"
|
||||
versionRange = "[1.21.2,)"
|
||||
ordering = "NONE"
|
||||
side = "CLIENT"
|
||||
Reference in New Issue
Block a user