├── .github └── workflows │ └── gradle.yml ├── .gitignore ├── LICENSE ├── README.md ├── build.gradle ├── common ├── build.gradle └── src │ └── main │ ├── java │ └── eu │ │ └── midnightdust │ │ └── blur │ │ ├── Blur.java │ │ ├── BlurInfo.java │ │ ├── config │ │ └── BlurConfig.java │ │ ├── mixin │ │ ├── MixinGameOptions.java │ │ ├── MixinGameRenderer.java │ │ ├── MixinHandledScreen.java │ │ ├── MixinInGameHud.java │ │ ├── MixinMinecraftClient.java │ │ ├── MixinScreen.java │ │ ├── MixinTitleScreen.java │ │ └── ScreenAccessor.java │ │ └── util │ │ └── RainbowColor.java │ └── resources │ ├── assets │ └── blur │ │ ├── icon.png │ │ └── lang │ │ ├── de_de.json │ │ ├── en_gb.json │ │ ├── en_us.json │ │ ├── es_ar.json │ │ ├── es_mx.json │ │ ├── fr_fr.json │ │ ├── ko_kr.json │ │ ├── pt_br.json │ │ ├── ru_ru.json │ │ ├── sv_se.json │ │ ├── uk_ua.json │ │ ├── zh_cn.json │ │ └── zh_tw.json │ └── blur.mixins.json ├── fabric ├── build.gradle └── src │ └── main │ ├── java │ └── eu │ │ └── midnightdust │ │ └── blur │ │ └── fabric │ │ └── BlurFabric.java │ └── resources │ └── fabric.mod.json ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── neoforge ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── java │ └── eu │ │ └── midnightdust │ │ └── blur │ │ └── neoforge │ │ └── BlurNeoForge.java │ └── resources │ ├── META-INF │ └── neoforge.mods.toml │ └── blur.png └── settings.gradle /.github/workflows/gradle.yml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [ "fabric-1.20.4" ] 4 | pull_request: 5 | branches: [ "fabric-1.20.4" ] 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-22.04 13 | steps: 14 | - uses: actions/checkout@v3 15 | - name: Set up JDK 17 16 | uses: actions/setup-java@v3 17 | with: 18 | java-version: '17' 19 | distribution: 'temurin' 20 | - name: Grant execute permission for gradlew 21 | run: chmod +x gradlew 22 | - name: Build with Gradle 23 | run: ./gradlew build --stacktrace --info 24 | - name: Upload a Build Artifact 25 | uses: actions/upload-artifact@v3 26 | with: 27 | name: Blur-Artifact 28 | path: build/libs/blur-*.*.jar 29 | if-no-files-found: error 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *.ipr 3 | run/ 4 | *.iws 5 | out/ 6 | *.iml 7 | .gradle/ 8 | output/ 9 | bin/ 10 | libs/ 11 | 12 | .classpath 13 | .project 14 | .idea/ 15 | classes/ 16 | .metadata 17 | .vscode 18 | .settings 19 | *.launch 20 | .architectury-transformer/debug.log 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 tterrag 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Ever thought that the world behind your inventory was just too distracting? 2 | Or that the default Minecraft blur effect is just too boring? 3 | Then this mod is just right for you! 4 | 5 | ![Image showing the Minecraft inventory with a blur effect in the background](https://cdn.modrinth.com/data/NK39zBp2/images/213f18fcf3d6c55cad164077d569e2f0339551da.webp) 6 | 7 | Download now on [Modrinth](https://modrinth.com/mod/blur-plus) 8 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | import groovy.json.JsonSlurper 2 | import groovy.json.JsonOutput 3 | 4 | plugins { 5 | id "architectury-plugin" version "3.4-SNAPSHOT" 6 | id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false 7 | id "me.shedaniel.unified-publishing" version "0.1.+" apply false 8 | id 'com.github.johnrengelman.shadow' version '8.1.1' apply false 9 | } 10 | 11 | architectury { 12 | minecraft = rootProject.minecraft_version 13 | } 14 | 15 | subprojects { 16 | apply plugin: "dev.architectury.loom" 17 | repositories { 18 | maven { 19 | url = "https://api.modrinth.com/maven" 20 | } 21 | } 22 | 23 | dependencies { 24 | minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" 25 | // The following line declares the yarn mappings you may select this one as well. 26 | mappings loom.layered { 27 | it.mappings("net.fabricmc:yarn:$rootProject.yarn_mappings:v2") 28 | it.mappings("dev.architectury:yarn-mappings-patch-neoforge:$rootProject.yarn_mappings_patch_neoforge_version") 29 | } 30 | } 31 | } 32 | 33 | allprojects { 34 | apply plugin: "java" 35 | apply plugin: "architectury-plugin" 36 | apply plugin: "maven-publish" 37 | 38 | archivesBaseName = rootProject.archives_base_name 39 | version = rootProject.mod_version 40 | group = rootProject.maven_group 41 | 42 | tasks.withType(JavaCompile) { 43 | options.encoding = "UTF-8" 44 | options.release = 21 45 | } 46 | ext { 47 | releaseChangelog = { 48 | def changes = new StringBuilder() 49 | changes << "## Blur+ v$project.version for $project.minecraft_version\n[View the changelog](https://www.github.com/Motschen/Blur/commits/)" 50 | def proc = "git log --max-count=1 --pretty=format:%s".execute() 51 | proc.in.eachLine { line -> 52 | def processedLine = line.toString() 53 | if (!processedLine.contains("New translations") && !processedLine.contains("Merge") && !processedLine.contains("branch")) { 54 | changes << "\n- ${processedLine.capitalize()}" 55 | } 56 | } 57 | proc.waitFor() 58 | return changes.toString() 59 | } 60 | } 61 | processResources { 62 | // Minify json resources 63 | doLast { 64 | fileTree(dir: outputs.files.asPath, include: "**/*.json").each { 65 | File file -> file.text = JsonOutput.toJson(new JsonSlurper().parse(file)) 66 | } 67 | } 68 | } 69 | 70 | java { 71 | withSourcesJar() 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /common/build.gradle: -------------------------------------------------------------------------------- 1 | architectury { 2 | common(rootProject.enabled_platforms.split(",")) 3 | } 4 | 5 | dependencies { 6 | // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies 7 | // Do NOT use other classes from fabric loader 8 | modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" 9 | modCompileOnly "maven.modrinth:midnightlib:${rootProject.midnightlib_version}-fabric" 10 | } 11 | 12 | publishing { 13 | publications { 14 | mavenCommon(MavenPublication) { 15 | artifactId = rootProject.archives_base_name 16 | from components.java 17 | } 18 | } 19 | 20 | // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. 21 | repositories { 22 | // Add repositories to publish to here. 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/Blur.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur; 2 | 3 | import eu.midnightdust.blur.config.BlurConfig; 4 | import eu.midnightdust.blur.util.RainbowColor; 5 | import eu.midnightdust.lib.util.MidnightColorUtil; 6 | import net.minecraft.client.MinecraftClient; 7 | import net.minecraft.client.gui.DrawContext; 8 | import org.joml.Math; 9 | import org.joml.Matrix4f; 10 | 11 | import java.awt.Color; 12 | import java.lang.Double; 13 | 14 | import static eu.midnightdust.blur.BlurInfo.*; 15 | import static eu.midnightdust.blur.util.RainbowColor.hue; 16 | import static eu.midnightdust.blur.util.RainbowColor.hue2; 17 | 18 | public class Blur { 19 | public static final String MOD_ID = "blur"; 20 | public static void init() { 21 | BlurConfig.init(MOD_ID, BlurConfig.class); 22 | } 23 | 24 | public static boolean doFade = false; 25 | 26 | public static void onRender() { 27 | if (!BlurInfo.doTest && BlurInfo.screenChanged) { // After the tests for blur and background color have been completed 28 | Blur.onScreenChange(); 29 | BlurInfo.screenChanged = false; 30 | } 31 | BlurInfo.doTest = false; // Set the test state to completed, as tests will happen in the same tick. 32 | } 33 | public static void renderFadeout(DrawContext context, int width, int height, MinecraftClient client) { 34 | if (BlurInfo.start >= 0 && !BlurInfo.screenHasBlur && BlurInfo.prevScreenHasBlur) { // Fade out in non-blurred screens 35 | client.gameRenderer.renderBlur(); 36 | 37 | if (BlurInfo.prevScreenHasBackground && BlurConfig.useGradient) Blur.renderRotatedGradient(context, width, height); 38 | } 39 | } 40 | 41 | public static void onScreenChange() { 42 | if (screenHasBlur) { 43 | if (doFade) { 44 | start = System.currentTimeMillis(); 45 | doFade = false; 46 | } 47 | } else if (prevScreenHasBlur && BlurConfig.fadeOutTimeMillis > 0) { 48 | start = System.currentTimeMillis(); 49 | doFade = true; 50 | } else { 51 | start = -1; 52 | doFade = true; 53 | } 54 | } 55 | 56 | public static void updateProgress(boolean fadeIn) { 57 | double x; 58 | if (fadeIn) { 59 | x = Math.min((System.currentTimeMillis() - start) / (double) BlurConfig.fadeTimeMillis, 1); 60 | } 61 | else { 62 | x = Math.max(1 + (start - System.currentTimeMillis()) / (double) BlurConfig.fadeOutTimeMillis, 0); 63 | if (x <= 0) { 64 | start = -1; 65 | } 66 | } 67 | x = BlurConfig.animationCurve.apply(x, fadeIn); 68 | x = Math.clamp(0, 1, x); 69 | 70 | progress = Double.valueOf(x).floatValue(); 71 | } 72 | 73 | public static int getBackgroundColor(boolean second) { 74 | int a = second ? BlurConfig.gradientEndAlpha : BlurConfig.gradientStartAlpha; 75 | var col = MidnightColorUtil.hex2Rgb(second ? BlurConfig.gradientEnd : BlurConfig.gradientStart); 76 | if (BlurConfig.rainbowMode) col = second ? Color.getHSBColor(hue, 1, 1) : Color.getHSBColor(hue2, 1, 1); 77 | int r = (col.getRGB() >> 16) & 0xFF; 78 | int b = (col.getRGB() >> 8) & 0xFF; 79 | int g = col.getRGB() & 0xFF; 80 | float prog = progress; 81 | a = (int) (prog * a); 82 | r = (int) (prog * r); 83 | g = (int) (prog * g); 84 | b = (int) (prog * b); 85 | return a << 24 | r << 16 | b << 8 | g; 86 | } 87 | public static int getRotation() { 88 | if (BlurConfig.rainbowMode) return RainbowColor.rotation; 89 | return BlurConfig.gradientRotation; 90 | } 91 | public static void renderRotatedGradient(DrawContext context, int width, int height) { 92 | float diagonal = Math.sqrt((float) width*width + height*height); 93 | int smallestDimension = Math.min(width, height); 94 | 95 | context.getMatrices().push(); 96 | Matrix4f posMatrix = context.getMatrices().peek().getPositionMatrix(); 97 | posMatrix.rotationZ(Math.toRadians(getRotation())); 98 | posMatrix.setTranslation(width / 2f, height / 2f, -1000); // Make the gradient's center the pivot point 99 | posMatrix.scale(diagonal / smallestDimension); // Scales the gradient to the maximum diagonal value needed 100 | context.fillGradient(-width / 2, -height / 2, width / 2, height / 2, Blur.getBackgroundColor(false), Blur.getBackgroundColor(true)); // Actually draw the gradient 101 | context.getMatrices().pop(); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/BlurInfo.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur; 2 | 3 | import eu.midnightdust.blur.config.BlurConfig; 4 | import net.minecraft.client.gui.screen.Screen; 5 | 6 | public class BlurInfo { 7 | public static long start; 8 | public static float progress; 9 | 10 | public static boolean prevScreenHasBlur; 11 | public static boolean screenHasBlur; 12 | 13 | public static boolean prevScreenHasBackground; 14 | public static boolean screenHasBackground; 15 | 16 | public static boolean doTest = true; 17 | public static boolean screenChanged = true; 18 | public static long lastScreenChange = System.currentTimeMillis(); 19 | 20 | public static void reset(Screen newScreen) { 21 | // Here, we reset all tests, to check if the new screen has blur and/or a background 22 | if (newScreen != null && BlurConfig.excludedScreens.contains(newScreen.getClass().getCanonicalName())) return; 23 | prevScreenHasBlur = screenHasBlur; 24 | prevScreenHasBackground = screenHasBackground; 25 | screenHasBlur = false; 26 | screenHasBackground = false; 27 | doTest = true; 28 | screenChanged = true; 29 | start = -1; 30 | lastScreenChange = System.currentTimeMillis(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/config/BlurConfig.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.config; 2 | 3 | import com.google.common.collect.Lists; 4 | import eu.midnightdust.blur.Blur; 5 | import eu.midnightdust.lib.config.MidnightConfig; 6 | import net.minecraft.client.MinecraftClient; 7 | import net.minecraft.client.gui.widget.SliderWidget; 8 | import net.minecraft.client.gui.widget.TextIconButtonWidget; 9 | import net.minecraft.client.option.GameOptions; 10 | import net.minecraft.text.Text; 11 | import net.minecraft.util.Identifier; 12 | 13 | import java.lang.annotation.Annotation; 14 | import java.util.List; 15 | import java.util.Objects; 16 | import java.util.function.Function; 17 | 18 | import static java.lang.Math.*; 19 | 20 | public class BlurConfig extends MidnightConfig { 21 | public static final String ANIMATIONS = "animations"; 22 | public static final String STYLE = "style"; 23 | public static final String SCREENS = "screens"; 24 | @Entry @Hidden public static int configVersion = 2; 25 | 26 | @Comment(category = SCREENS, centered = true) 27 | public static Comment _general; 28 | @Entry(category = SCREENS) 29 | public static boolean blurContainers = true; 30 | @Entry(category = SCREENS) 31 | public static boolean blurTitleScreen = false; 32 | @Condition(requiredOption = "blurTitleScreen", visibleButLocked = true) 33 | @Entry(category = SCREENS) 34 | public static boolean darkenTitleScreen = false; 35 | @Comment(category = SCREENS, centered = true) 36 | public static Comment _advanced; 37 | @Entry(category = SCREENS) // Screens where Blur+ should not apply transition effects (mostly dynamically blurred screens) 38 | public static List excludedScreens = Lists.newArrayList("net.irisshaders.iris.gui.screen.ShaderPackScreen"); 39 | @Entry(category = SCREENS) // Screens where the vanilla blur effect should be force enabled 40 | public static List forceEnabledScreens = Lists.newArrayList("dev.emi.emi.screen.RecipeScreen"); 41 | @Entry(category = SCREENS) // Screens where the vanilla blur effect should be force disabled 42 | public static List forceDisabledScreens = Lists.newArrayList(); 43 | 44 | @Comment(category = STYLE, centered = true) 45 | public static Comment _gradient; 46 | @Entry(category = STYLE) 47 | public static boolean useGradient = true; 48 | @Condition(requiredOption = "useGradient", visibleButLocked = true) 49 | @Entry(category = STYLE, isColor = true, width = 7, min = 7) 50 | public static String gradientStart = "#000000"; 51 | @Condition(requiredOption = "useGradient", visibleButLocked = true) 52 | @Entry(category = STYLE, isSlider = true, min = 0, max = 255) 53 | public static int gradientStartAlpha = 75; 54 | @Condition(requiredOption = "useGradient", visibleButLocked = true) 55 | @Entry(category = STYLE, isColor = true, width = 7, min = 7) 56 | public static String gradientEnd = "#000000"; 57 | @Condition(requiredOption = "useGradient", visibleButLocked = true) 58 | @Entry(category = STYLE, isSlider = true, min = 0, max = 255) 59 | public static int gradientEndAlpha = 75; 60 | @Condition(requiredOption = "useGradient", visibleButLocked = true) 61 | @Entry(category = STYLE, isSlider = true, min = 0, max = 360) 62 | public static int gradientRotation = 0; 63 | @Entry(category = STYLE) 64 | public static boolean rainbowMode = false; 65 | 66 | @Comment(category = ANIMATIONS, centered = true) 67 | public static Comment _animations; 68 | @Entry(category = ANIMATIONS, min = 0, max = 2000, isSlider = true) 69 | public static int fadeTimeMillis = 300; 70 | @Entry(category = ANIMATIONS, min = 0, max = 2000, isSlider = true) 71 | public static int fadeOutTimeMillis = 300; 72 | @Entry(category = ANIMATIONS) 73 | public static BlurConfig.Easing animationCurve = Easing.FLAT; 74 | 75 | public enum Easing { 76 | // Based on https://gist.github.com/dev-hydrogen/21a66f83f0386123e0c0acf107254843 77 | // Thank you very much! 78 | 79 | FLAT(x -> x, x -> x), 80 | SINE(x -> 1 - cos(x * PI) / 2, x -> sin(x * PI) / 2), 81 | QUAD(x -> x * x, x -> 1 - (1 - x) * (1 - x)), 82 | CUBIC(x -> x * x * x, x -> 1 - pow(1 - x, 3)), 83 | QUART(x -> x * x * x * x, x -> 1 - pow(1 - x, 4)), 84 | QUINT(x -> x * x * x * x * x, x -> 1 - pow(1 - x, 5)), 85 | EXPO(x -> x == 0 ? 0 : pow(2, 10 * x - 10), x -> x == 1 ? 1 : 1 - pow(2, -10 * x)), 86 | CIRC(x -> 1 - sqrt(1 - pow(x, 2)), x -> sqrt(1 - pow(x - 1, 2))), 87 | BACK(x -> 2.70158 * x * x * x - 1.70158 * x * x,x -> 1 + 2.70158 * pow(x - 1, 3) + 1.70158 * pow(x - 1, 2)), 88 | ELASTIC(x -> x == 0 ? 0 : x == 1 ? 1 : -pow(2, 10 * x - 10) * sin((x * 10 - 10.75) * ((2 * PI) / 3)), x -> x == 0 ? 0 : x == 1 ? 1 : pow(2, -10 * x) * sin((x * 10 - 0.75) * ((2 * PI) / 3)) + 1); 89 | 90 | final Function functionIn; 91 | final Function functionOut; 92 | 93 | Easing(Function functionIn, Function functionOut) { 94 | this.functionIn = functionIn; 95 | this.functionOut = functionOut; 96 | } 97 | public Double apply(Double x, boolean in) { 98 | if (in) return functionIn.apply(x).doubleValue(); 99 | return functionOut.apply(x).doubleValue(); 100 | } 101 | } 102 | private static GameOptions options; 103 | 104 | @Override 105 | public void onTabInit(String tabName, MidnightConfigListWidget list, MidnightConfigScreen screen) { 106 | options = MinecraftClient.getInstance().options; 107 | if (Objects.equals(tabName, STYLE)) { 108 | EntryInfo centered = new EntryInfo(null, Blur.MOD_ID); 109 | centered.comment = new Comment(){ 110 | @Override 111 | public boolean centered() { 112 | return true; 113 | } 114 | public Class annotationType() {return null;} 115 | public String category() {return "";} 116 | public String name() {return "";} 117 | public String url() {return "";} 118 | public String requiredMod() {return "";} 119 | }; 120 | RadiusSliderWidget slider = new RadiusSliderWidget(screen.width - 185, 0, 150, 20); 121 | 122 | TextIconButtonWidget resetButton = TextIconButtonWidget.builder(Text.translatable("controls.reset"), (button -> { 123 | options.getMenuBackgroundBlurriness().setValue(5); 124 | screen.updateList(); 125 | }), true).texture(Identifier.of("midnightlib","icon/reset"), 12, 12).dimension(20, 20).build(); 126 | resetButton.setPosition(screen.width - 205 + 150 + 25, 0); 127 | slider.resetButton = resetButton; 128 | slider.updateMessage(); 129 | 130 | list.addButton(Lists.newArrayList(), Text.translatable("blur.midnightconfig._blur"), centered); 131 | list.addButton(Lists.newArrayList(slider, resetButton), Text.translatable("blur.midnightconfig.radius"), new EntryInfo(null, Blur.MOD_ID)); 132 | } 133 | } 134 | 135 | public static class RadiusSliderWidget extends SliderWidget { 136 | TextIconButtonWidget resetButton; 137 | public RadiusSliderWidget(int x, int y, int width, int height) { 138 | super(x, y, width, height, Text.empty(), options.getMenuBackgroundBlurrinessValue() / 20d); 139 | } 140 | public void updateMessage() { 141 | this.setMessage(Text.of(String.valueOf(options.getMenuBackgroundBlurrinessValue()))); 142 | if (resetButton != null) resetButton.active = options.getMenuBackgroundBlurrinessValue() != 5; 143 | } 144 | 145 | public void applyValue() { 146 | options.getMenuBackgroundBlurriness().setValue(Double.valueOf(this.value * 20).intValue()); 147 | } 148 | } 149 | } -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/mixin/MixinGameOptions.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.mixin; 2 | 3 | import net.minecraft.client.option.GameOptions; 4 | import net.minecraft.client.option.SimpleOption; 5 | import org.spongepowered.asm.mixin.Final; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Redirect; 10 | 11 | @Mixin(GameOptions.class) 12 | public abstract class MixinGameOptions { 13 | @Shadow @Final private SimpleOption menuBackgroundBlurriness; 14 | @Shadow @Final private SimpleOption chatLineSpacing; 15 | 16 | @Redirect(method = "", at = @At(value = "NEW", target = "net/minecraft/client/option/SimpleOption$ValidatingIntSliderCallbacks", ordinal = 2)) 17 | private SimpleOption.ValidatingIntSliderCallbacks blur$increaseMaxBlurriness(int minInclusive, int maxInclusive) { 18 | if (this.menuBackgroundBlurriness == null && this.chatLineSpacing != null) 19 | return new SimpleOption.ValidatingIntSliderCallbacks(minInclusive, 20); 20 | return new SimpleOption.ValidatingIntSliderCallbacks(minInclusive, maxInclusive); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/mixin/MixinGameRenderer.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.mixin; 2 | 3 | import eu.midnightdust.blur.Blur; 4 | import eu.midnightdust.blur.BlurInfo; 5 | import net.minecraft.client.render.GameRenderer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 9 | 10 | @Mixin(GameRenderer.class) 11 | public class MixinGameRenderer { 12 | @ModifyVariable(method = "renderBlur", at = @At("STORE"), ordinal = 0) 13 | private float blur$modifyRadius(float radius) { // Modify the radius based on the animation progress 14 | if (!BlurInfo.screenChanged && BlurInfo.start >= 0) // Only update the progress after all tests have been completed 15 | Blur.updateProgress(BlurInfo.screenHasBlur); 16 | return radius * BlurInfo.progress; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/mixin/MixinHandledScreen.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.mixin; 2 | 3 | import eu.midnightdust.blur.Blur; 4 | import eu.midnightdust.blur.config.BlurConfig; 5 | import eu.midnightdust.lib.util.PlatformFunctions; 6 | import net.minecraft.client.gui.DrawContext; 7 | import net.minecraft.client.gui.screen.Screen; 8 | import net.minecraft.client.gui.screen.ingame.HandledScreen; 9 | import net.minecraft.text.Text; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(HandledScreen.class) 16 | public class MixinHandledScreen extends Screen { 17 | protected MixinHandledScreen(Text title) { 18 | super(title); 19 | } 20 | 21 | @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)) 22 | private void blur$renderContainerBlur(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { // Applies the blur effect in containers (Inventory, Chest, etc.) 23 | if (BlurConfig.blurContainers) this.applyBlur(); 24 | } 25 | @Inject(at = @At("HEAD"), method = "render") 26 | public void blur$processScreenChange(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { 27 | if (PlatformFunctions.getPlatformName().equals("neoforge")) Blur.onRender(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/mixin/MixinInGameHud.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.mixin; 2 | 3 | import eu.midnightdust.blur.Blur; 4 | import eu.midnightdust.blur.BlurInfo; 5 | import net.minecraft.client.MinecraftClient; 6 | import net.minecraft.client.gui.DrawContext; 7 | import net.minecraft.client.gui.hud.InGameHud; 8 | import net.minecraft.client.render.RenderTickCounter; 9 | import org.spongepowered.asm.mixin.Final; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(InGameHud.class) 17 | public class MixinInGameHud { 18 | @Final @Shadow private MinecraftClient client; 19 | 20 | @Inject(at = @At("TAIL"), method = "render") 21 | public void blur$renderFadeOut(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) { // Adds a fade-out effect when a player is in a world and closes all screens 22 | if (client.currentScreen == null && client.world != null && BlurInfo.start >= 0 && BlurInfo.prevScreenHasBlur) { 23 | BlurInfo.doTest = false; 24 | BlurInfo.screenChanged = false; 25 | this.client.gameRenderer.renderBlur(); 26 | 27 | if (BlurInfo.prevScreenHasBackground) Blur.renderRotatedGradient(context, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight()); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/mixin/MixinMinecraftClient.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.mixin; 2 | 3 | import eu.midnightdust.blur.Blur; 4 | import eu.midnightdust.blur.BlurInfo; 5 | import org.objectweb.asm.Opcodes; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | import net.minecraft.client.MinecraftClient; 12 | import net.minecraft.client.gui.screen.Screen; 13 | 14 | @Mixin(MinecraftClient.class) 15 | public class MixinMinecraftClient { 16 | 17 | @Inject(method = "setScreen", 18 | at = @At(value = "FIELD", 19 | target = "Lnet/minecraft/client/MinecraftClient;currentScreen:Lnet/minecraft/client/gui/screen/Screen;", 20 | opcode = Opcodes.PUTFIELD)) 21 | private void blur$onScreenOpen(Screen newScreen, CallbackInfo info) { 22 | if (BlurInfo.lastScreenChange < System.currentTimeMillis() - 100) { // For some reason, in certain scenarios the screen is set to a new one multiple times in a tick. We want to avoid that. 23 | // Here, we reset all tests, to check if the new screen has blur and/or a background 24 | BlurInfo.reset(newScreen); 25 | 26 | // Manually activate the onScreenChange method when all screens are closed (in-game) 27 | if (newScreen == null) Blur.onScreenChange(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/mixin/MixinScreen.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 5 | import eu.midnightdust.blur.BlurInfo; 6 | import eu.midnightdust.blur.config.BlurConfig; 7 | import net.minecraft.client.MinecraftClient; 8 | import net.minecraft.client.gui.DrawContext; 9 | import net.minecraft.text.Text; 10 | import net.minecraft.util.Identifier; 11 | import org.spongepowered.asm.mixin.Final; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.Shadow; 14 | import org.spongepowered.asm.mixin.Unique; 15 | import org.spongepowered.asm.mixin.injection.At; 16 | import org.spongepowered.asm.mixin.injection.Inject; 17 | 18 | import eu.midnightdust.blur.Blur; 19 | 20 | import net.minecraft.client.gui.screen.Screen; 21 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 22 | 23 | @Mixin(Screen.class) 24 | public abstract class MixinScreen { 25 | @Shadow @Final protected Text title; 26 | @Shadow protected MinecraftClient client; 27 | @Shadow public int width; 28 | @Shadow public int height; 29 | @Shadow protected abstract void applyBlur(); 30 | 31 | @Inject(at = @At("HEAD"), method = "render") 32 | public void blur$processScreenChange(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { 33 | Blur.onRender(); 34 | Blur.renderFadeout(context, width, height, client); 35 | } 36 | 37 | @Inject(at = @At("HEAD"), method = "applyBlur", cancellable = true) 38 | public void blur$getBlurEnabled(CallbackInfo ci) { 39 | if (BlurConfig.forceDisabledScreens.contains(this.getClass().getCanonicalName())) { 40 | ci.cancel(); return; 41 | } 42 | if (!BlurConfig.excludedScreens.contains(this.getClass().getCanonicalName())) 43 | BlurInfo.screenHasBlur = true; // Test if the screen has blur 44 | } 45 | 46 | @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") 47 | private void blur$applyGradient(DrawContext context, Identifier texture, int x, int y, float u, float v, int width, int height, Operation original) { 48 | if (BlurConfig.useGradient) { 49 | blur$renderGradient(context); // Replaces the background texture with a gradient 50 | } else original.call(context, texture, x, y, u, v, width, height); 51 | } 52 | 53 | @WrapOperation(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;fillGradient(IIIIII)V"), method = "renderInGameBackground") 54 | public void blur$rotatedGradient(DrawContext context, int startX, int startY, int endX, int endY, int colorStart, int colorEnd, Operation original) { 55 | blur$renderGradient(context); 56 | } 57 | @Unique 58 | private void blur$renderGradient(DrawContext context) { 59 | BlurInfo.screenHasBackground = true; // Test if the screen has a background 60 | if (BlurConfig.forceEnabledScreens.contains(this.getClass().getCanonicalName())) 61 | this.applyBlur(); 62 | 63 | Blur.renderRotatedGradient(context, width, height); // Replaces the default gradient with our rotated one 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/mixin/MixinTitleScreen.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.mixin; 2 | 3 | import eu.midnightdust.blur.Blur; 4 | import eu.midnightdust.blur.config.BlurConfig; 5 | import net.minecraft.client.gui.DrawContext; 6 | import net.minecraft.client.gui.screen.Screen; 7 | import net.minecraft.client.gui.screen.TitleScreen; 8 | import net.minecraft.text.Text; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(TitleScreen.class) 15 | public abstract class MixinTitleScreen extends Screen { 16 | protected MixinTitleScreen(Text title) { 17 | super(title); 18 | } 19 | 20 | @Inject(method = "renderPanoramaBackground", at = @At("TAIL")) 21 | private void blur$renderTitleBlur(DrawContext context, float delta, CallbackInfo ci) { // Applies the blur effect in containers (Inventory, Chest, etc.) 22 | if (BlurConfig.blurTitleScreen) { 23 | Blur.updateProgress(true); 24 | this.applyBlur(); 25 | if (BlurConfig.darkenTitleScreen) this.renderDarkening(context); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/mixin/ScreenAccessor.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.mixin; 2 | 3 | import net.minecraft.client.gui.screen.Screen; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Invoker; 6 | 7 | @Mixin(Screen.class) 8 | public interface ScreenAccessor { 9 | @Invoker("applyBlur") 10 | void forceApplyBlur(); 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/eu/midnightdust/blur/util/RainbowColor.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.util; 2 | 3 | import eu.midnightdust.blur.config.BlurConfig; 4 | 5 | public class RainbowColor { 6 | public static int rotation; 7 | public static float hue; 8 | public static float hue2 = 0.35f; 9 | 10 | public static void tick() { 11 | if (BlurConfig.rainbowMode) { 12 | if (hue >= 1) hue = 0f; 13 | hue += 0.01f; 14 | if (hue2 >= 1) hue2 = 0f; 15 | hue2 += 0.01f; 16 | 17 | if (rotation >= 360) rotation = 0; 18 | rotation += 1; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Motschen/Blur/5e4f4abd3b7ce2b195b6c9ce54096e963fe30a2f/common/src/main/resources/assets/blur/icon.png -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/de_de.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Blur+ Konfiguration", 3 | "blur.midnightconfig.category.animations": "Animationen", 4 | "blur.midnightconfig.category.screens": "Bildschirme", 5 | "blur.midnightconfig.category.style": "Stil", 6 | "blur.midnightconfig.blurContainers": "Unschärfe in Containern", 7 | "blur.midnightconfig.blurTitleScreen": "Unschärfe im Titelbildschirm", 8 | "blur.midnightconfig.darkenTitleScreen": "Abgedunkelter Titelhintergrund", 9 | "blur.midnightconfig.fadeTimeMillis": "Überblendzeit (in Millisekunden)", 10 | "blur.midnightconfig.fadeOutTimeMillis": "Ausblendzeit (in Millisekunden)", 11 | "blur.midnightconfig.animationCurve": "Animationskurve", 12 | "blur.midnightconfig.enum.Easing.FLAT": "Flach", 13 | "blur.midnightconfig.enum.Easing.SINE": "Sinus", 14 | "blur.midnightconfig.enum.Easing.QUAD": "Quadriert", 15 | "blur.midnightconfig.enum.Easing.CUBIC": "Kubiert", 16 | "blur.midnightconfig.enum.Easing.QUART": "Quart", 17 | "blur.midnightconfig.enum.Easing.QUINT": "Quint", 18 | "blur.midnightconfig.enum.Easing.EXPO": "Expo", 19 | "blur.midnightconfig.enum.Easing.CIRC": "Kreis", 20 | "blur.midnightconfig.enum.Easing.BACK": "Zurück", 21 | "blur.midnightconfig.enum.Easing.ELASTIC": "Elastisch", 22 | "blur.midnightconfig.radius": "Radius", 23 | "blur.midnightconfig.rainbowMode": "Regenbogenmodus \uD83C\uDF08", 24 | "blur.midnightconfig.useGradient": "Farbverlauf im Hintergrund", 25 | "blur.midnightconfig.gradientStart": "Farbverlauf-Anfangsfarbe", 26 | "blur.midnightconfig.gradientEnd": "Farbverlauf-Endfarbe", 27 | "blur.midnightconfig.gradientStartAlpha": "Farbverlauf-Anfangstransparenz", 28 | "blur.midnightconfig.gradientEndAlpha": "Farbverlauf-Endstransparenz", 29 | "blur.midnightconfig.gradientRotation": "Farbverlauf-Rotation", 30 | "blur.midnightconfig.excludedScreens": "Ausgeschlossene Bildschirme", 31 | "blur.midnightconfig._general": "⛏ Generell", 32 | "blur.midnightconfig._advanced": "⚒ Fortgeschritten", 33 | "blur.midnightconfig._blur": "▒ Unschärfe", 34 | "blur.midnightconfig._gradient": "\uD83D\uDFE2 Farbverlauf", 35 | "blur.midnightconfig._animations": "\uD83D\uDCFD Animationen" 36 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/en_gb.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.gradientStart": "Gradient Start Colour", 3 | "blur.midnightconfig.gradientEnd": "Gradient End Colour" 4 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/en_us.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Blur+ Config", 3 | "blur.midnightconfig.category.animations": "Animations", 4 | "blur.midnightconfig.category.style": "Style", 5 | "blur.midnightconfig.category.screens": "Screens", 6 | "blur.midnightconfig.blurContainers": "Apply Blur to Containers", 7 | "blur.midnightconfig.blurTitleScreen": "Apply Blur to Title Screen", 8 | "blur.midnightconfig.darkenTitleScreen": "Darken Title Screen Background", 9 | "blur.midnightconfig.fadeTimeMillis": "Fade Time (in milliseconds)", 10 | "blur.midnightconfig.fadeOutTimeMillis": "Fade Out Time (in milliseconds)", 11 | "blur.midnightconfig.animationCurve": "Animation Curve", 12 | "blur.midnightconfig.enum.Easing.FLAT": "Flat", 13 | "blur.midnightconfig.enum.Easing.SINE": "Sine", 14 | "blur.midnightconfig.enum.Easing.QUAD": "Quad", 15 | "blur.midnightconfig.enum.Easing.CUBIC": "Cubic", 16 | "blur.midnightconfig.enum.Easing.QUART": "Quart", 17 | "blur.midnightconfig.enum.Easing.QUINT": "Quint", 18 | "blur.midnightconfig.enum.Easing.EXPO": "Expo", 19 | "blur.midnightconfig.enum.Easing.CIRC": "Circ", 20 | "blur.midnightconfig.enum.Easing.BACK": "Back", 21 | "blur.midnightconfig.enum.Easing.ELASTIC": "Elastic", 22 | "blur.midnightconfig.radius": "Radius", 23 | "blur.midnightconfig.radius.label.tooltip": "Mirror of \"Menu Background Blur\" found in Minecraft's Accessibility Settings", 24 | "blur.midnightconfig.rainbowMode": "Rainbow Mode \uD83C\uDF08", 25 | "blur.midnightconfig.useGradient": "Gradient as Background", 26 | "blur.midnightconfig.gradientStart": "Gradient Start Color", 27 | "blur.midnightconfig.gradientEnd": "Gradient End Color", 28 | "blur.midnightconfig.gradientStartAlpha": "Gradient Start Alpha", 29 | "blur.midnightconfig.gradientEndAlpha": "Gradient End Alpha", 30 | "blur.midnightconfig.gradientRotation": "Gradient Rotation", 31 | "blur.midnightconfig.excludedScreens": "Excluded Screens", 32 | "blur.midnightconfig.excludedScreens.tooltip": "Screens that Blur+ should not animate", 33 | "blur.midnightconfig.forceEnabledScreens": "Force-enabled Screens", 34 | "blur.midnightconfig.forceEnabledScreens.tooltip": "Screens where the vanilla blur effect should be force-enabled\nMight not work 100% of the time", 35 | "blur.midnightconfig.forceDisabledScreens": "Force-disabled Screens", 36 | "blur.midnightconfig.forceDisabledScreens.tooltip": "Screens where the vanilla blur effect should be force-disabled", 37 | "blur.midnightconfig._general": "⛏ General", 38 | "blur.midnightconfig._advanced": "⚒ Advanced", 39 | "blur.midnightconfig._blur": "▒ Blur", 40 | "blur.midnightconfig._gradient": "\uD83D\uDFE2 Gradient", 41 | "blur.midnightconfig._animations": "\uD83D\uDCFD Animations" 42 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/es_ar.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Configuración de Blur+", 3 | "blur.midnightconfig.category.animations": "Animaciones", 4 | "blur.midnightconfig.category.style": "Estilo", 5 | "blur.midnightconfig.category.screens": "Pantallas", 6 | 7 | "blur.midnightconfig.blurContainers": "Aplicar Desenfoque a Contenedores", 8 | "blur.midnightconfig.fadeTimeMillis": "Tiempo de Aparición (en milisegundos)", 9 | "blur.midnightconfig.fadeOutTimeMillis": "Tiempo de Desaparición (en milisegundos)", 10 | "blur.midnightconfig.animationCurve": "Curva de Animación", 11 | 12 | "blur.midnightconfig.enum.Easing.FLAT": "Plano", 13 | "blur.midnightconfig.enum.Easing.SINE": "Seno", 14 | "blur.midnightconfig.enum.Easing.QUAD": "Cuadrática", 15 | "blur.midnightconfig.enum.Easing.CUBIC": "Cúbica", 16 | "blur.midnightconfig.enum.Easing.QUART": "Cuártica", 17 | "blur.midnightconfig.enum.Easing.QUINT": "Quíntica", 18 | "blur.midnightconfig.enum.Easing.EXPO": "Exponencial", 19 | "blur.midnightconfig.enum.Easing.CIRC": "Circular", 20 | "blur.midnightconfig.enum.Easing.BACK": "Retroceso", 21 | "blur.midnightconfig.enum.Easing.ELASTIC": "Elástica", 22 | 23 | "blur.midnightconfig.radius": "Radio", 24 | "blur.midnightconfig.rainbowMode": "Modo Arcoíris \ud83c\udf08", 25 | 26 | "blur.midnightconfig.useGradient": "Usar Gradiente como Fondo", 27 | "blur.midnightconfig.gradientStart": "Color Inicial del Gradiente", 28 | "blur.midnightconfig.gradientEnd": "Color Final del Gradiente", 29 | "blur.midnightconfig.gradientStartAlpha": "Transparencia Inicial del Gradiente", 30 | "blur.midnightconfig.gradientEndAlpha": "Transparencia Final del Gradiente", 31 | "blur.midnightconfig.gradientRotation": "Rotación del Gradiente", 32 | 33 | "blur.midnightconfig.excludedScreens": "Pantallas Excluidas", 34 | "blur.midnightconfig.excludedScreens.tooltip": "Pantallas donde Blur+ no debería animar", 35 | 36 | "blur.midnightconfig.forceEnabledScreens": "Pantallas con Blur Forzado", 37 | "blur.midnightconfig.forceEnabledScreens.tooltip": "Pantallas donde el desenfoque vanilla debería forzarse habilitado\nPuede que no funcione siempre al 100%", 38 | 39 | "blur.midnightconfig.forceDisabledScreens": "Pantallas con Blur Deshabilitado", 40 | "blur.midnightconfig.forceDisabledScreens.tooltip": "Pantallas donde el desenfoque vanilla debería forzarse deshabilitado" 41 | } 42 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/es_mx.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Configuración de Blur+", 3 | "blur.midnightconfig.category.animations": "Animaciones", 4 | "blur.midnightconfig.category.style": "Estilo", 5 | "blur.midnightconfig.blurContainers": "Aplicar desenfoque a los contenedores", 6 | "blur.midnightconfig.fadeTimeMillis": "Tiempo de desvanecimiento (en milisegundos)", 7 | "blur.midnightconfig.fadeOutTimeMillis": "Tiempo de desvanecimiento de salida (en milisegundos)", 8 | "blur.midnightconfig.animationCurve": "Curva de animación", 9 | "blur.midnightconfig.enum.Easing.FLAT": "Plano", 10 | "blur.midnightconfig.enum.Easing.SINE": "Seno", 11 | "blur.midnightconfig.enum.Easing.QUAD": "Cuadrático", 12 | "blur.midnightconfig.enum.Easing.CUBIC": "Cúbico", 13 | "blur.midnightconfig.enum.Easing.QUART": "Cuarto", 14 | "blur.midnightconfig.enum.Easing.QUINT": "Quinto", 15 | "blur.midnightconfig.enum.Easing.EXPO": "Exponencial", 16 | "blur.midnightconfig.enum.Easing.CIRC": "Circular", 17 | "blur.midnightconfig.enum.Easing.BACK": "Atrás", 18 | "blur.midnightconfig.enum.Easing.ELASTIC": "Elástico", 19 | "blur.midnightconfig.radius": "Radio", 20 | "blur.midnightconfig.rainbowMode": "Modo Arcoíris \uD83C\uDF08", 21 | "blur.midnightconfig.useGradient": "Usar degradado como fondo", 22 | "blur.midnightconfig.gradientStart": "Color de inicio del degradado", 23 | "blur.midnightconfig.gradientEnd": "Color de fin del degradado", 24 | "blur.midnightconfig.gradientStartAlpha": "Alfa de inicio del degradado", 25 | "blur.midnightconfig.gradientEndAlpha": "Alfa de fin del degradado", 26 | "blur.midnightconfig.gradientRotation": "Rotación del degradado" 27 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/fr_fr.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Configuration du flou", 3 | "blur.midnightconfig.blurExclusions": "Flouter les exclusions", 4 | "blur.midnightconfig.fadeTimeMillis": "Temps de fondu (en millisecondes)", 5 | "blur.midnightconfig.ease": "Fluidité de l'animation", 6 | "blur.midnightconfig.radius": "Rayon", 7 | "blur.midnightconfig.gradientStart": "Couleur de départ du dégradé", 8 | "blur.midnightconfig.gradientEnd": "Couleur de fin du dégradé", 9 | "blur.midnightconfig.gradientStartAlpha": "Alpha de début du dégradé", 10 | "blur.midnightconfig.gradientEndAlpha": "Alpha de fin du dégradé", 11 | "blur.midnightconfig.showScreenTitle": "Montrer le titre de l'écran" 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/ko_kr.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Blur 설정", 3 | "blur.midnightconfig.blurExclusions": "블러 제외", 4 | "blur.midnightconfig.fadeTimeMillis": "페이드 시간 (밀리초 단위)", 5 | "blur.midnightconfig.radius": "범위", 6 | "blur.midnightconfig.gradientStart": "그라디언트 시작 색상", 7 | "blur.midnightconfig.gradientEnd": "그라디언트 종료 색상", 8 | "blur.midnightconfig.gradientStartAlpha": "그라디언트 시작 알파", 9 | "blur.midnightconfig.gradientEndAlpha": "그라디언트 종료 알파", 10 | "blur.midnightconfig.showScreenTitle": "화면 타이틀 보기" 11 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/pt_br.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Configuração de desfoque", 3 | "blur.midnightconfig.blurExclusions": "Desfocar exclusões", 4 | "blur.midnightconfig.fadeTimeMillis": "Tempo de desvanecimento (em milissegundos)", 5 | "blur.midnightconfig.ease": "Animação fácil", 6 | "blur.midnightconfig.radius": "Raio", 7 | "blur.midnightconfig.gradientStart": "Cor inicial do gradiente", 8 | "blur.midnightconfig.gradientEnd": "Cor final do gradiente", 9 | "blur.midnightconfig.gradientStartAlpha": "Alfa de início gradiente", 10 | "blur.midnightconfig.gradientEndAlpha": "Alfa de Gradiente Final", 11 | "blur.midnightconfig.showScreenTitle": "Mostrar título da tela" 12 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/ru_ru.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Настройки Blur+", 3 | "blur.midnightconfig.category.animations": "Анимации", 4 | "blur.midnightconfig.category.style": "Стиль", 5 | "blur.midnightconfig.blurContainers": "Применять размытие к контейнерам", 6 | "blur.midnightconfig.fadeTimeMillis": "Время размытия (в миллисекундах)", 7 | "blur.midnightconfig.fadeOutTimeMillis": "Время затухания (в миллисекундах)", 8 | "blur.midnightconfig.animationCurve": "Кривая анимации", 9 | "blur.midnightconfig.enum.Easing.FLAT": "Плоская", 10 | "blur.midnightconfig.enum.Easing.SINE": "Синусоидальная", 11 | "blur.midnightconfig.enum.Easing.QUAD": "Квадратная", 12 | "blur.midnightconfig.enum.Easing.CUBIC": "Кубическая", 13 | "blur.midnightconfig.enum.Easing.QUART": "Квартовая", 14 | "blur.midnightconfig.enum.Easing.QUINT": "Квинтовая", 15 | "blur.midnightconfig.enum.Easing.EXPO": "Экспоненциальная", 16 | "blur.midnightconfig.enum.Easing.CIRC": "Круговая", 17 | "blur.midnightconfig.enum.Easing.BACK": "Обратная", 18 | "blur.midnightconfig.enum.Easing.ELASTIC": "Упругая", 19 | "blur.midnightconfig.radius": "Радиус размытия", 20 | "blur.midnightconfig.rainbowMode": "Радужный режим \uD83C\uDF08", 21 | "blur.midnightconfig.useGradient": "Градиент в качестве фона", 22 | "blur.midnightconfig.gradientStart": "Верхний цвет градиента", 23 | "blur.midnightconfig.gradientEnd": "Нижний цвет градиента", 24 | "blur.midnightconfig.gradientStartAlpha": "Альфа-начало градиента", 25 | "blur.midnightconfig.gradientEndAlpha": "Альфа-конец градиента", 26 | "blur.midnightconfig.gradientRotation": "Вращение градиента" 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/sv_se.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Blur Config", 3 | "blur.midnightconfig.blurExclusions": "Undantag till Blur", 4 | "blur.midnightconfig.fadeTimeMillis": "Toningstid (i millisekunder)", 5 | "blur.midnightconfig.radius": "Radie", 6 | "blur.midnightconfig.gradientStart": "Toningsfärg (start)", 7 | "blur.midnightconfig.gradientEnd": "Toningsfärg (slut)", 8 | "blur.midnightconfig.showScreenTitle": "Visa skärmtitel" 9 | } -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/uk_ua.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Конфігурація Blur", 3 | "blur.midnightconfig.blurExclusions": "Винятки розмиття", 4 | "blur.midnightconfig.fadeTimeMillis": "Час появи розмиття (у мілісекундах)", 5 | "blur.midnightconfig.ease": "Пом'якшення анімації", 6 | "blur.midnightconfig.radius": "Радіус", 7 | "blur.midnightconfig.gradientStart": "Початковий колір градієнта", 8 | "blur.midnightconfig.gradientEnd": "Кінцевий колір градієнта", 9 | "blur.midnightconfig.gradientStartAlpha": "Початкова прозорість градієнта", 10 | "blur.midnightconfig.gradientEndAlpha": "Кінцева прозорість градієнтаa", 11 | "blur.midnightconfig.showScreenTitle": "Показати назву екрана" 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/zh_cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "模糊 (Blur+) 配置", 3 | "blur.midnightconfig.category.animations": "动画", 4 | "blur.midnightconfig.category.style": "样式", 5 | "blur.midnightconfig.blurContainers": "使用容器时启用", 6 | "blur.midnightconfig.fadeTimeMillis": "淡入时间(毫秒)", 7 | "blur.midnightconfig.fadeOutTimeMillis": "淡出时间(毫秒)", 8 | "blur.midnightconfig.animationCurve": "动画曲线", 9 | "blur.midnightconfig.enum.Easing.FLAT": "平滑(Flat)", 10 | "blur.midnightconfig.enum.Easing.SINE": "正弦(Sine)", 11 | "blur.midnightconfig.enum.Easing.QUAD": "二次(Quad)", 12 | "blur.midnightconfig.enum.Easing.CUBIC": "三次(Cubic)", 13 | "blur.midnightconfig.enum.Easing.QUART": "四次(Quart)", 14 | "blur.midnightconfig.enum.Easing.QUINT": "五次(Quint)", 15 | "blur.midnightconfig.enum.Easing.EXPO": "指数(Expo)", 16 | "blur.midnightconfig.enum.Easing.CIRC": "圆周(Circ)", 17 | "blur.midnightconfig.enum.Easing.BACK": "回弹(Back)", 18 | "blur.midnightconfig.enum.Easing.ELASTIC": "弹性(Elastic)", 19 | "blur.midnightconfig.radius": "半径", 20 | "blur.midnightconfig.rainbowMode": "彩虹模式 \uD83C\uDF08", 21 | "blur.midnightconfig.useGradient": "背景渐变", 22 | "blur.midnightconfig.gradientStart": "渐变起始色", 23 | "blur.midnightconfig.gradientEnd": "渐变结束色", 24 | "blur.midnightconfig.gradientStartAlpha": "渐变起始 Alpha 通道", 25 | "blur.midnightconfig.gradientEndAlpha": "渐变结束 Alpha 通道", 26 | "blur.midnightconfig.gradientRotation": "渐变旋转", 27 | "blur.midnightconfig.excludedScreens": "禁用的界面" 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/blur/lang/zh_tw.json: -------------------------------------------------------------------------------- 1 | { 2 | "blur.midnightconfig.title": "Blur+ 設定", 3 | "blur.midnightconfig.category.animations": "動畫", 4 | "blur.midnightconfig.category.style": "風格", 5 | "blur.midnightconfig.blurContainers": "對容器套用模糊", 6 | "blur.midnightconfig.fadeTimeMillis": "淡入時間(毫秒)", 7 | "blur.midnightconfig.fadeOutTimeMillis": "淡出時間(毫秒)", 8 | "blur.midnightconfig.animationCurve": "動畫曲線", 9 | "blur.midnightconfig.enum.Easing.FLAT": "線性(Flat)", 10 | "blur.midnightconfig.enum.Easing.SINE": "正弦(Sine)", 11 | "blur.midnightconfig.enum.Easing.QUAD": "二次(Quad)", 12 | "blur.midnightconfig.enum.Easing.CUBIC": "三次(Cubic)", 13 | "blur.midnightconfig.enum.Easing.QUART": "四次(Quart)", 14 | "blur.midnightconfig.enum.Easing.QUINT": "五次(Quint)", 15 | "blur.midnightconfig.enum.Easing.EXPO": "指數(Expo)", 16 | "blur.midnightconfig.enum.Easing.CIRC": "圓形(Circ)", 17 | "blur.midnightconfig.enum.Easing.BACK": "回彈(Back)", 18 | "blur.midnightconfig.enum.Easing.ELASTIC": "彈性(Elastic)", 19 | "blur.midnightconfig.radius": "半徑", 20 | "blur.midnightconfig.rainbowMode": "彩虹模式 🌈", 21 | "blur.midnightconfig.useGradient": "漸變背景", 22 | "blur.midnightconfig.gradientStart": "漸變起始顏色", 23 | "blur.midnightconfig.gradientEnd": "漸變結束顏色", 24 | "blur.midnightconfig.gradientStartAlpha": "漸變起始 Alpha", 25 | "blur.midnightconfig.gradientEndAlpha": "漸變結束 Alpha", 26 | "blur.midnightconfig.gradientRotation": "漸變旋轉", 27 | "blur.midnightconfig.excludedScreens": "排除畫面" 28 | } -------------------------------------------------------------------------------- /common/src/main/resources/blur.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "eu.midnightdust.blur.mixin", 5 | "compatibilityLevel": "JAVA_21", 6 | "client": [ 7 | "MixinGameOptions", 8 | "MixinGameRenderer", 9 | "MixinHandledScreen", 10 | "MixinInGameHud", 11 | "MixinMinecraftClient", 12 | "MixinScreen", 13 | "MixinTitleScreen", 14 | "ScreenAccessor" 15 | ], 16 | "injectors": { 17 | "defaultRequire": 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /fabric/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.github.johnrengelman.shadow' 3 | id "me.shedaniel.unified-publishing" 4 | } 5 | 6 | architectury { 7 | platformSetupLoomIde() 8 | fabric() 9 | } 10 | 11 | configurations { 12 | common 13 | shadowCommon // Don't use shadow from the shadow plugin since it *excludes* files. 14 | compileClasspath.extendsFrom common 15 | runtimeClasspath.extendsFrom common 16 | developmentFabric.extendsFrom common 17 | archivesBaseName = rootProject.archives_base_name + "-fabric" 18 | version = rootProject.mod_version + "+" + rootProject.minecraft_version 19 | } 20 | 21 | dependencies { 22 | modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" 23 | modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" 24 | modImplementation include ("maven.modrinth:midnightlib:${rootProject.midnightlib_version}-fabric") 25 | 26 | common(project(path: ":common", configuration: "namedElements")) { transitive false } 27 | shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } 28 | } 29 | 30 | processResources { 31 | inputs.property "version", rootProject.version 32 | 33 | filesMatching("fabric.mod.json") { 34 | expand "version": rootProject.version 35 | } 36 | } 37 | 38 | shadowJar { 39 | exclude "architectury.common.json" 40 | 41 | configurations = [project.configurations.shadowCommon] 42 | archiveClassifier = "dev-shadow" 43 | } 44 | 45 | remapJar { 46 | input.set shadowJar.archiveFile 47 | dependsOn shadowJar 48 | } 49 | 50 | sourcesJar { 51 | def commonSources = project(":common").sourcesJar 52 | dependsOn commonSources 53 | from commonSources.archiveFile.map { zipTree(it) } 54 | } 55 | 56 | components.java { 57 | withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { 58 | skip() 59 | } 60 | } 61 | 62 | unifiedPublishing { 63 | project { 64 | displayName = "Blur+ $rootProject.version - Fabric $project.minecraft_version" 65 | releaseType = "$project.release_type" 66 | changelog = releaseChangelog() 67 | gameVersions = [] 68 | gameLoaders = ["fabric","quilt"] 69 | mainPublication remapJar 70 | relations { 71 | depends { 72 | curseforge = "fabric-api" 73 | modrinth = "fabric-api" 74 | } 75 | includes { 76 | curseforge = "midnightlib" 77 | modrinth = "midnightlib" 78 | } 79 | } 80 | 81 | var CURSEFORGE_TOKEN = project.findProperty("CURSEFORGE_TOKEN") ?: System.getenv("CURSEFORGE_TOKEN") 82 | if (CURSEFORGE_TOKEN != null) { 83 | curseforge { 84 | token = CURSEFORGE_TOKEN 85 | id = rootProject.curseforge_id 86 | gameVersions.addAll "Java 21", project.minecraft_version 87 | if (project.supported_versions != "") gameVersions.addAll project.supported_versions 88 | } 89 | } 90 | 91 | var MODRINTH_TOKEN = project.findProperty("MODRINTH_TOKEN") ?: System.getenv("MODRINTH_TOKEN") 92 | if (MODRINTH_TOKEN != null) { 93 | modrinth { 94 | token = MODRINTH_TOKEN 95 | id = rootProject.modrinth_id 96 | version = "$rootProject.version-$project.name" 97 | gameVersions.addAll project.minecraft_version 98 | if (project.supported_versions != "") gameVersions.addAll project.supported_versions 99 | } 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /fabric/src/main/java/eu/midnightdust/blur/fabric/BlurFabric.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.fabric; 2 | 3 | import eu.midnightdust.blur.Blur; 4 | import eu.midnightdust.blur.util.RainbowColor; 5 | import net.fabricmc.api.ClientModInitializer; 6 | import net.fabricmc.api.ModInitializer; 7 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 8 | 9 | public class BlurFabric implements ModInitializer, ClientModInitializer { 10 | @Override 11 | public void onInitialize() { 12 | Blur.init(); 13 | } 14 | @Override 15 | public void onInitializeClient() { 16 | ClientTickEvents.END_CLIENT_TICK.register(client -> RainbowColor.tick()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /fabric/src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "blur", 4 | "name": "Blur+", 5 | "version": "$version", 6 | "environment": "client", 7 | "license": "MIT", 8 | "icon": "assets/blur/icon.png", 9 | "entrypoints": { 10 | "main": [ 11 | "eu.midnightdust.blur.fabric.BlurFabric" 12 | ], 13 | "client": [ 14 | "eu.midnightdust.blur.fabric.BlurFabric" 15 | ] 16 | }, 17 | "contact": { 18 | "homepage": "https://modrinth.com/mod/blur-fabric", 19 | "sources": "https://github.com/Motschen/Blur", 20 | "issues": "https://github.com/Motschen/Blur/issues" 21 | }, 22 | "authors": [ 23 | "Motschen", 24 | "tterrag1098", 25 | "Pyrofab" 26 | ], 27 | "contributors": [ 28 | "backryun", 29 | "byquanton" 30 | ], 31 | "description": "Various enhancements for the blur effect behind Minecraft GUIs", 32 | "mixins": [ 33 | "blur.mixins.json" 34 | ], 35 | "depends": { 36 | "minecraft": ">=1.21.2", 37 | "midnightlib": ">=1.7.3" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx2G 3 | org.gradle.parallel=true 4 | 5 | minecraft_version=1.21.4 6 | supported_versions=1.21.5 7 | yarn_mappings=1.21.4+build.1 8 | enabled_platforms=fabric,neoforge 9 | 10 | # Mod Properties 11 | mod_version=5.2.1 12 | maven_group=eu.midnightdust.blur 13 | archives_base_name=blur 14 | release_type=release 15 | curseforge_id=393563 16 | modrinth_id=NK39zBp2 17 | 18 | # Modloaders 19 | fabric_loader_version=0.16.9 20 | fabric_api_version=0.111.0+1.21.4 21 | 22 | neoforge_version=21.4.10-beta 23 | yarn_mappings_patch_neoforge_version = 1.21+build.4 24 | 25 | # Libraries 26 | midnightlib_version = 1.7.3+1.21.4 27 | modmenu_version = 11.0.2 28 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Motschen/Blur/5e4f4abd3b7ce2b195b6c9ce54096e963fe30a2f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /neoforge/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.github.johnrengelman.shadow' 3 | id "me.shedaniel.unified-publishing" 4 | } 5 | 6 | repositories { 7 | maven { 8 | name = 'NeoForged' 9 | url = 'https://maven.neoforged.net/releases' 10 | } 11 | } 12 | 13 | 14 | architectury { 15 | platformSetupLoomIde() 16 | neoForge() 17 | } 18 | 19 | loom { 20 | accessWidenerPath = project(":common").loom.accessWidenerPath 21 | } 22 | 23 | configurations { 24 | common { 25 | canBeResolved = true 26 | canBeConsumed = false 27 | } 28 | compileClasspath.extendsFrom common 29 | runtimeClasspath.extendsFrom common 30 | developmentNeoForge.extendsFrom common 31 | 32 | // Files in this configuration will be bundled into your mod using the Shadow plugin. 33 | // Don't use the `shadow` configuration from the plugin itself as it's meant for excluding files. 34 | shadowBundle { 35 | canBeResolved = true 36 | canBeConsumed = false 37 | } 38 | archivesBaseName = rootProject.archives_base_name + "-neoforge" 39 | version = rootProject.mod_version + "+" + rootProject.minecraft_version 40 | } 41 | 42 | dependencies { 43 | neoForge "net.neoforged:neoforge:$rootProject.neoforge_version" 44 | modImplementation ("maven.modrinth:midnightlib:${rootProject.midnightlib_version}-neoforge") 45 | 46 | common(project(path: ':common', configuration: 'namedElements')) { transitive false } 47 | shadowBundle project(path: ':common', configuration: 'transformProductionNeoForge') 48 | } 49 | 50 | processResources { 51 | inputs.property 'version', rootProject.version 52 | 53 | filesMatching('META-INF/neoforge.mods.toml') { 54 | expand version: rootProject.version 55 | } 56 | } 57 | 58 | shadowJar { 59 | configurations = [project.configurations.shadowBundle] 60 | archiveClassifier = 'dev-shadow' 61 | } 62 | 63 | remapJar { 64 | input.set shadowJar.archiveFile 65 | } 66 | 67 | sourcesJar { 68 | def commonSources = project(":common").sourcesJar 69 | dependsOn commonSources 70 | from commonSources.archiveFile.map { zipTree(it) } 71 | } 72 | 73 | components.java { 74 | withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { 75 | skip() 76 | } 77 | } 78 | 79 | unifiedPublishing { 80 | project { 81 | displayName = "Blur+ $rootProject.version - NeoForge $project.minecraft_version" 82 | releaseType = "$project.release_type" 83 | changelog = releaseChangelog() 84 | gameVersions = [] 85 | gameLoaders = ["neoforge"] 86 | mainPublication remapJar 87 | relations { 88 | depends { 89 | curseforge = "midnightlib" 90 | modrinth = "midnightlib" 91 | } 92 | } 93 | 94 | var CURSEFORGE_TOKEN = project.findProperty("CURSEFORGE_TOKEN") ?: System.getenv("CURSEFORGE_TOKEN") 95 | if (CURSEFORGE_TOKEN != null) { 96 | curseforge { 97 | token = CURSEFORGE_TOKEN 98 | id = rootProject.curseforge_id 99 | gameVersions.addAll "Java 21", project.minecraft_version 100 | if (project.supported_versions != "") gameVersions.addAll project.supported_versions 101 | } 102 | } 103 | 104 | var MODRINTH_TOKEN = project.findProperty("MODRINTH_TOKEN") ?: System.getenv("MODRINTH_TOKEN") 105 | if (MODRINTH_TOKEN != null) { 106 | modrinth { 107 | token = MODRINTH_TOKEN 108 | id = rootProject.modrinth_id 109 | version = "$rootProject.version-$project.name" 110 | gameVersions.addAll project.minecraft_version 111 | if (project.supported_versions != "") gameVersions.addAll project.supported_versions 112 | } 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /neoforge/gradle.properties: -------------------------------------------------------------------------------- 1 | loom.platform=neoforge -------------------------------------------------------------------------------- /neoforge/src/main/java/eu/midnightdust/blur/neoforge/BlurNeoForge.java: -------------------------------------------------------------------------------- 1 | package eu.midnightdust.blur.neoforge; 2 | 3 | import eu.midnightdust.blur.Blur; 4 | import eu.midnightdust.blur.util.RainbowColor; 5 | import net.neoforged.api.distmarker.Dist; 6 | import net.neoforged.bus.api.SubscribeEvent; 7 | import net.neoforged.fml.common.EventBusSubscriber; 8 | import net.neoforged.fml.common.Mod; 9 | import net.neoforged.neoforge.client.event.ClientTickEvent; 10 | 11 | @Mod(value = Blur.MOD_ID, dist = Dist.CLIENT) 12 | public class BlurNeoForge { 13 | public BlurNeoForge() { 14 | Blur.init(); 15 | } 16 | 17 | @EventBusSubscriber(modid = Blur.MOD_ID, bus = EventBusSubscriber.Bus.GAME, value = Dist.CLIENT) 18 | public static class ClientGameEvents { 19 | @SubscribeEvent 20 | public static void endClientTick(ClientTickEvent.Post event) { 21 | RainbowColor.tick(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /neoforge/src/main/resources/META-INF/neoforge.mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "javafml" 2 | loaderVersion = "[2,)" 3 | #issueTrackerURL = "" 4 | license = "MIT License" 5 | 6 | [[mods]] 7 | modId = "blur" 8 | version = "${version}" 9 | displayName = "Blur+" 10 | logoFile = "blur.png" 11 | authors = "Motschen, tterrag1098, Pyrofab, backryun, byquanton" 12 | description = ''' 13 | Various enhancements for the blur effect behind Minecraft GUIs 14 | ''' 15 | 16 | [[mixins]] 17 | config = "blur.mixins.json" 18 | 19 | [[dependencies.blur]] 20 | modId = "neoforge" 21 | mandatory = true 22 | versionRange = "[21.0,)" 23 | ordering = "NONE" 24 | side = "CLIENT" 25 | 26 | [[dependencies.blur]] 27 | modId = "minecraft" 28 | mandatory = true 29 | versionRange = "[1.21.2,)" 30 | ordering = "NONE" 31 | side = "CLIENT" 32 | 33 | [[dependencies.blur]] 34 | modId = "midnightlib" 35 | mandatory = true 36 | versionRange = "[1.7.3,)" 37 | ordering = "NONE" 38 | side = "CLIENT" -------------------------------------------------------------------------------- /neoforge/src/main/resources/blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Motschen/Blur/5e4f4abd3b7ce2b195b6c9ce54096e963fe30a2f/neoforge/src/main/resources/blur.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url "https://maven.fabricmc.net/" } 4 | maven { url "https://maven.architectury.dev/" } 5 | maven { url "https://maven.neoforged.net/releases" } 6 | gradlePluginPortal() 7 | } 8 | } 9 | 10 | include("common") 11 | include("fabric") 12 | include("neoforge") 13 | //include("quilt") 14 | 15 | rootProject.name = "blur" 16 | --------------------------------------------------------------------------------