13 Commits

Author SHA1 Message Date
Martin Prokoph
fa6fd82e4d fix: move gradient z-coordinate further back 2025-04-23 10:18:55 +02:00
Martin Prokoph
528958fa8c fix: improve gradient handling 2025-04-19 09:58:54 +02:00
Martin Prokoph
552f1e619e feat: improve config screen with comments 2025-03-29 19:30:38 +01:00
Martin Prokoph
c9c630ac11 fix: less invasive gradient injection
- Should fix various compatibility issues with other mods
2025-03-29 18:45:19 +01:00
Martin Prokoph
695fa67270 feat: various improvements
- Update to MidnightLib 1.7.0 and use its features to make the config screen more reliable
- Fix background gradient being opaque briefly when fading out while not in a world
- Fix 1.21.5 compat (still compatible with 1.21.4 as well :D)
2025-03-28 23:35:46 +01:00
Martin Prokoph
5f9738da38 fix: add null-check for Minecraft options
- Fixes #119
2025-02-02 21:00:03 +01:00
Martin Prokoph
881709c165 readme: remove duplicate banner 2025-01-27 16:39:08 +01:00
Martin Prokoph
50ed77006d chore: bump version 2025-01-27 12:24:13 +01:00
Martin Prokoph
e99572eb4d fix: crash in production when opening config screen 2025-01-27 12:23:07 +01:00
Martin Prokoph
f7465ee08e feat: title screen blur
- Also fix config changes not being saved
2025-01-25 18:53:32 +01:00
Martin Prokoph
75bfeb2ce3 feat: add mirror of blur radius to config screen
- The blur radius can normally be configured in Minecraft's Accessibility settings. However, this has caused confusion for some users, so it can now also be configured via the config screen.
2025-01-20 16:44:35 +01:00
Martin Prokoph
e5c2a542f4 fix: container blur not working on NeoForge 2025-01-14 11:50:04 +01:00
Martin Prokoph
a13cdd11a7 Update dependencies to 1.21.4 2024-12-08 18:11:51 +01:00
16 changed files with 219 additions and 78 deletions

View File

@@ -1,9 +1,7 @@
![Banner art for the mod Blur+](https://i.ibb.co/GM4HVDC/PoBrnNM.png)
Ever thought that the world behind your inventory was just too distracting?
Or that the default Minecraft blur effect is just too boring?
Then this mod is just right for you!
![Image showing the Minecraft inventory with a blur effect in the background](https://cdn.modrinth.com/data/NK39zBp2/images/213f18fcf3d6c55cad164077d569e2f0339551da.webp)
Download now on [Modrinth](https://modrinth.com/mod/blur-plus)
Download now on [Modrinth](https://modrinth.com/mod/blur-plus)

View File

@@ -3,6 +3,7 @@ package eu.midnightdust.blur;
import eu.midnightdust.blur.config.BlurConfig;
import eu.midnightdust.blur.util.RainbowColor;
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;
@@ -15,12 +16,28 @@ import static eu.midnightdust.blur.util.RainbowColor.hue;
import static eu.midnightdust.blur.util.RainbowColor.hue2;
public class Blur {
public static final String MOD_ID = "blur";
public static void init() {
BlurConfig.init("blur", BlurConfig.class);
BlurConfig.init(MOD_ID, BlurConfig.class);
}
public static boolean doFade = false;
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) Blur.renderRotatedGradient(context, width, height);
}
}
public static void onScreenChange() {
if (screenHasBlur) {
if (doFade) {
@@ -61,10 +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() {
@@ -75,11 +92,12 @@ public class Blur {
float diagonal = Math.sqrt((float) width*width + height*height);
int smallestDimension = Math.min(width, height);
context.getMatrices().push();
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
posMatrix.setTranslation(width / 2f, height / 2f, -1000); // 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().pop();
}
}

View File

@@ -2,6 +2,7 @@ package eu.midnightdust.blur.config;
import com.google.common.collect.Lists;
import eu.midnightdust.lib.config.MidnightConfig;
import net.minecraft.client.MinecraftClient;
import java.util.List;
import java.util.function.Function;
@@ -14,28 +15,17 @@ 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 = 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)
public static boolean useGradient = true;
@Entry(category = STYLE, isColor = true, width = 7, min = 7)
public static String gradientStart = "#000000";
@Entry(category = STYLE, isSlider = true, min = 0, max = 255)
public static int gradientStartAlpha = 75;
@Entry(category = STYLE, isColor = true, width = 7, min = 7)
public static String gradientEnd = "#000000";
@Entry(category = STYLE, isSlider = true, min = 0, max = 255)
public static int gradientEndAlpha = 75;
@Entry(category = STYLE, isSlider = true, min = 0, max = 360)
public static int gradientRotation = 0;
@Entry(category = STYLE)
public static boolean rainbowMode = false;
@Entry(category = SCREENS)
public static boolean blurTitleScreen = false;
@Condition(requiredOption = "blurTitleScreen", visibleButLocked = true)
@Entry(category = SCREENS)
public static boolean darkenTitleScreen = false;
@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
@@ -43,6 +33,48 @@ public class BlurConfig extends MidnightConfig {
@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 _blur;
@Entry(category = STYLE, isSlider = true, min = 0, max = 20)
public static int radius = 5;
@Comment(category = STYLE, centered = true)
public static Comment _gradient;
@Entry(category = STYLE)
public static boolean useGradient = true;
@Condition(requiredOption = "useGradient", visibleButLocked = true)
@Entry(category = STYLE, isColor = true, width = 7, min = 7)
public static String gradientStart = "#000000";
@Condition(requiredOption = "useGradient", visibleButLocked = true)
@Entry(category = STYLE, isSlider = true, min = 0, max = 255)
public static int gradientStartAlpha = 75;
@Condition(requiredOption = "useGradient", visibleButLocked = true)
@Entry(category = STYLE, isColor = true, width = 7, min = 7)
public static String gradientEnd = "#000000";
@Condition(requiredOption = "useGradient", visibleButLocked = true)
@Entry(category = STYLE, isSlider = true, min = 0, max = 255)
public static int gradientEndAlpha = 75;
@Condition(requiredOption = "useGradient", visibleButLocked = true)
@Entry(category = STYLE, isSlider = true, min = 0, max = 360)
public static int gradientRotation = 0;
@Entry(category = STYLE)
public static boolean rainbowMode = false;
@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;
@Override
public void writeChanges(String modid) {
super.writeChanges(modid);
if (MinecraftClient.getInstance().options != null)
MinecraftClient.getInstance().options.getMenuBackgroundBlurriness().setValue(radius);
}
public enum Easing {
// Based on https://gist.github.com/dev-hydrogen/21a66f83f0386123e0c0acf107254843
// Thank you very much!

View File

@@ -1,6 +1,8 @@
package eu.midnightdust.blur.mixin;
import eu.midnightdust.blur.Blur;
import eu.midnightdust.blur.config.BlurConfig;
import eu.midnightdust.lib.util.PlatformFunctions;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
@@ -20,4 +22,8 @@ public class MixinHandledScreen extends Screen {
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();
}
@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();
}
}

View File

@@ -23,7 +23,6 @@ public class MixinInGameHud {
BlurInfo.doTest = false;
BlurInfo.screenChanged = false;
this.client.gameRenderer.renderBlur();
this.client.getFramebuffer().beginWrite(false);
if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
}

View File

@@ -0,0 +1,26 @@
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);
}
}

View File

@@ -0,0 +1,17 @@
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();
}
}

View File

@@ -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,29 +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();
@Inject(at = @At("HEAD"), method = "render")
public void blur$processScreenChange(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (!BlurInfo.doTest && BlurInfo.screenChanged) { // After the tests for blur and background color have been completed
Blur.onScreenChange();
BlurInfo.screenChanged = false;
}
if (BlurInfo.start >= 0 && !BlurInfo.screenHasBlur && BlurInfo.prevScreenHasBlur) { // Fade out in non-blurred screens
this.client.gameRenderer.renderBlur();
this.client.getFramebuffer().beginWrite(false);
if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, width, height);
}
BlurInfo.doTest = false; // Set the test state to completed, as tests will happen in the same tick.
}
@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())) {
@@ -52,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();
Blur.renderRotatedGradient(context, width, height); // Replaces the default gradient with our rotated one
ci.cancel();
}
}

View File

@@ -0,0 +1,28 @@
package eu.midnightdust.blur.mixin;
import eu.midnightdust.blur.Blur;
import eu.midnightdust.blur.config.BlurConfig;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.text.Text;
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(TitleScreen.class)
public abstract class MixinTitleScreen extends Screen {
protected MixinTitleScreen(Text title) {
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.)
if (BlurConfig.blurTitleScreen) {
Blur.updateProgress(true);
this.applyBlur();
if (BlurConfig.darkenTitleScreen) this.renderDarkening(context);
}
}
}

View File

@@ -1,8 +1,11 @@
{
"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",
"blur.midnightconfig.darkenTitleScreen": "Abgedunkelter Titelhintergrund",
"blur.midnightconfig.fadeTimeMillis": "Überblendzeit (in Millisekunden)",
"blur.midnightconfig.fadeOutTimeMillis": "Ausblendzeit (in Millisekunden)",
"blur.midnightconfig.animationCurve": "Animationskurve",
@@ -24,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": "§7⛏ Generell",
"blur.midnightconfig._advanced": "§7⚒ Fortgeschritten",
"blur.midnightconfig._blur": "§7▒ Unschärfe",
"blur.midnightconfig._gradient": "§7\uD83D\uDFE2 Farbverlauf",
"blur.midnightconfig._animations": "§7\uD83D\uDCFD Animationen"
}

View File

@@ -4,6 +4,8 @@
"blur.midnightconfig.category.style": "Style",
"blur.midnightconfig.category.screens": "Screens",
"blur.midnightconfig.blurContainers": "Apply Blur to Containers",
"blur.midnightconfig.blurTitleScreen": "Apply Blur to Title Screen",
"blur.midnightconfig.darkenTitleScreen": "Darken Title Screen Background",
"blur.midnightconfig.fadeTimeMillis": "Fade Time (in milliseconds)",
"blur.midnightconfig.fadeOutTimeMillis": "Fade Out Time (in milliseconds)",
"blur.midnightconfig.animationCurve": "Animation Curve",
@@ -18,6 +20,7 @@
"blur.midnightconfig.enum.Easing.BACK": "Back",
"blur.midnightconfig.enum.Easing.ELASTIC": "Elastic",
"blur.midnightconfig.radius": "Radius",
"blur.midnightconfig.radius.label.tooltip": "Mirror of \"Menu Background Blur\" found in Minecraft's Accessibility Settings",
"blur.midnightconfig.rainbowMode": "Rainbow Mode \uD83C\uDF08",
"blur.midnightconfig.useGradient": "Gradient as Background",
"blur.midnightconfig.gradientStart": "Gradient Start Color",
@@ -30,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": "§7⛏ General",
"blur.midnightconfig._advanced": "§7⚒ Advanced",
"blur.midnightconfig._blur": "§7▒ Blur",
"blur.midnightconfig._gradient": "§7\uD83D\uDFE2 Gradient",
"blur.midnightconfig._animations": "§7\uD83D\uDCFD Animations"
}

View File

@@ -4,13 +4,16 @@
"package": "eu.midnightdust.blur.mixin",
"compatibilityLevel": "JAVA_21",
"client": [
"MixinScreen",
"ScreenAccessor",
"MixinHandledScreen",
"MixinMinecraftClient",
"MixinGameOptions",
"MixinGameRenderer",
"MixinHandledScreen",
"MixinInGameHud",
"MixinGameOptions"
"MixinMidnightConfig",
"MixinMidnightConfig$EntryInfo",
"MixinMinecraftClient",
"MixinScreen",
"MixinTitleScreen",
"ScreenAccessor"
],
"injectors": {
"defaultRequire": 1

View File

@@ -83,7 +83,8 @@ unifiedPublishing {
curseforge {
token = CURSEFORGE_TOKEN
id = rootProject.curseforge_id
gameVersions.addAll "Java 21", project.minecraft_version, project.supported_versions
gameVersions.addAll "Java 21", project.minecraft_version
if (project.supported_versions != "") gameVersions.addAll project.supported_versions
}
}
@@ -93,7 +94,8 @@ unifiedPublishing {
token = MODRINTH_TOKEN
id = rootProject.modrinth_id
version = "$rootProject.version-$project.name"
gameVersions.addAll project.minecraft_version, project.supported_versions
gameVersions.addAll project.minecraft_version
if (project.supported_versions != "") gameVersions.addAll project.supported_versions
}
}
}

View File

@@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true
minecraft_version=1.21.3
supported_versions=1.21.2
yarn_mappings=1.21.3+build.2
minecraft_version=1.21.4
supported_versions=1.21.5
yarn_mappings=1.21.4+build.1
enabled_platforms=fabric,neoforge
# Mod Properties
mod_version=5.0.1
mod_version=5.2.0
maven_group=eu.midnightdust.blur
archives_base_name=blur
release_type=release
@@ -17,11 +17,11 @@ modrinth_id=NK39zBp2
# Modloaders
fabric_loader_version=0.16.9
fabric_api_version=0.107.0+1.21.3
fabric_api_version=0.111.0+1.21.4
neoforge_version=21.3.11-beta
neoforge_version=21.4.10-beta
yarn_mappings_patch_neoforge_version = 1.21+build.4
# Libraries
midnightlib_version = 1.6.4
midnightlib_version = 1.7.0+1.21.4
modmenu_version = 11.0.2

View File

@@ -96,7 +96,8 @@ unifiedPublishing {
curseforge {
token = CURSEFORGE_TOKEN
id = rootProject.curseforge_id
gameVersions.addAll "Java 21", project.minecraft_version, project.supported_versions
gameVersions.addAll "Java 21", project.minecraft_version
if (project.supported_versions != "") gameVersions.addAll project.supported_versions
}
}
@@ -106,7 +107,8 @@ unifiedPublishing {
token = MODRINTH_TOKEN
id = rootProject.modrinth_id
version = "$rootProject.version-$project.name"
gameVersions.addAll project.minecraft_version, project.supported_versions
gameVersions.addAll project.minecraft_version
if (project.supported_versions != "") gameVersions.addAll project.supported_versions
}
}
}

View File

@@ -8,13 +8,13 @@ import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.fml.common.Mod;
import net.neoforged.neoforge.client.event.ClientTickEvent;
@Mod(value = "blur", dist = Dist.CLIENT)
@Mod(value = Blur.MOD_ID, dist = Dist.CLIENT)
public class BlurNeoForge {
public BlurNeoForge() {
Blur.init();
}
@EventBusSubscriber(modid = "blur", bus = EventBusSubscriber.Bus.GAME, value = Dist.CLIENT)
@EventBusSubscriber(modid = Blur.MOD_ID, bus = EventBusSubscriber.Bus.GAME, value = Dist.CLIENT)
public static class ClientGameEvents {
@SubscribeEvent
public static void endClientTick(ClientTickEvent.Post event) {