-
Notifications
You must be signed in to change notification settings - Fork 8
Port to 1.21.10 #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Port to 1.21.10 #16
Changes from all commits
5bb0f85
77d8ae3
01c67e7
69eb055
0c7876b
f994878
d9c4d3f
755f50e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
| org.gradle.jvmargs=-Xmx1G | ||
| org.gradle.parallel=true | ||
|
|
||
| # Fabric Properties | ||
| # https://modmuss50.me/fabric.html | ||
| minecraft_version=1.21 | ||
| yarn_mappings=1.21+build.7 | ||
| loader_version=0.15.11 | ||
| fabric_version=0.100.4+1.21 | ||
| minecraft_version=1.21.10 | ||
| yarn_mappings=1.21.10+build.3 | ||
| loader_version=0.18.4 | ||
| fabric_version=0.138.4+1.21.10 | ||
| loom_version=1.14-SNAPSHOT | ||
|
|
||
| # Mod Properties | ||
| mod_version=1.12 | ||
| mod_version=1.13 | ||
| maven_group=suso | ||
| archives_base_name=shader-reload |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| pluginManagement { | ||
| repositories { | ||
| jcenter() | ||
| maven { | ||
| name = 'Fabric' | ||
| url = 'https://maven.fabricmc.net/' | ||
| } | ||
| mavenCentral() | ||
| gradlePluginPortal() | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,45 @@ | ||||||||||||||||||||||||||
| package suso.shaderreload; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| import net.minecraft.client.MinecraftClient; | ||||||||||||||||||||||||||
| import net.minecraft.client.gl.*; | ||||||||||||||||||||||||||
| import net.minecraft.client.texture.TextureManager; | ||||||||||||||||||||||||||
| import net.minecraft.resource.DefaultResourcePack; | ||||||||||||||||||||||||||
| import net.minecraft.util.Identifier; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| import java.io.FileNotFoundException; | ||||||||||||||||||||||||||
| import java.util.Set; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| public class CustomShaderLoader extends ShaderLoader { | ||||||||||||||||||||||||||
| private final DefaultResourcePack defaultPack = MinecraftClient.getInstance().getDefaultResourcePack(); | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| public CustomShaderLoader(TextureManager textureManager) { | ||||||||||||||||||||||||||
| super(textureManager, CustomShaderLoader::onShaderError); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||
| public PostEffectProcessor loadPostEffect(Identifier id, Set<Identifier> availableExternalTargets) { | ||||||||||||||||||||||||||
| PostEffectProcessor result = super.loadPostEffect(id, availableExternalTargets); | ||||||||||||||||||||||||||
| if(result != null) return result; | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||
| return loadDefaultPostEffect(id, availableExternalTargets); | ||||||||||||||||||||||||||
| } catch (Exception e) { | ||||||||||||||||||||||||||
| ShaderReload.printShaderException(e, true); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| static void onShaderError(Exception e) { | ||||||||||||||||||||||||||
| ShaderReload.tripError(); | ||||||||||||||||||||||||||
| ShaderReload.printShaderException(e, false); | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| private ShaderProgram loadDefaultProgram(ShaderProgram key) throws FileNotFoundException { | ||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| private PostEffectProcessor loadDefaultPostEffect(Identifier id, Set<Identifier> availableExternalTargets) { | ||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||
|
Comment on lines
+39
to
+43
|
||||||||||||||||||||||||||
| return null; | |
| } | |
| private PostEffectProcessor loadDefaultPostEffect(Identifier id, Set<Identifier> availableExternalTargets) { | |
| return null; | |
| // TODO: Implement loading of default shader program if needed | |
| throw new UnsupportedOperationException("loadDefaultProgram is not yet implemented"); | |
| } | |
| private PostEffectProcessor loadDefaultPostEffect(Identifier id, Set<Identifier> availableExternalTargets) { | |
| // TODO: Implement loading of default post effect if needed | |
| throw new UnsupportedOperationException("loadDefaultPostEffect is not yet implemented"); |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method loadDefaultPostEffect is declared but only returns null without any implementation. This appears to be called in the exception handler on line 25, which means it will always return null when there's an error loading a post-effect. If this is intentional, the try-catch block on lines 24-28 serves no purpose since loadDefaultPostEffect always returns null. Either implement the method properly or remove the dead code.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,38 +1,27 @@ | ||||||
| package suso.shaderreload; | ||||||
|
|
||||||
| import com.google.gson.JsonSyntaxException; | ||||||
| import net.fabricmc.api.ClientModInitializer; | ||||||
| import net.fabricmc.api.EnvType; | ||||||
| import net.fabricmc.api.Environment; | ||||||
| import net.minecraft.client.MinecraftClient; | ||||||
| import net.minecraft.client.gl.Framebuffer; | ||||||
| import net.minecraft.client.gl.PostEffectProcessor; | ||||||
| import net.minecraft.client.gl.ShaderProgram; | ||||||
| import net.minecraft.client.render.VertexFormat; | ||||||
| import net.minecraft.client.texture.TextureManager; | ||||||
| import net.minecraft.resource.*; | ||||||
| import net.minecraft.text.Text; | ||||||
| import net.minecraft.util.*; | ||||||
| import org.apache.logging.log4j.LogManager; | ||||||
| import org.apache.logging.log4j.Logger; | ||||||
| import org.lwjgl.glfw.GLFW; | ||||||
| import suso.shaderreload.mixin.KeyboardInvoker; | ||||||
|
|
||||||
| import java.io.IOException; | ||||||
| import java.util.List; | ||||||
| import java.util.concurrent.CompletableFuture; | ||||||
| import java.util.concurrent.CompletionException; | ||||||
|
|
||||||
| import static net.minecraft.resource.ResourceType.CLIENT_RESOURCES; | ||||||
|
|
||||||
| @Environment(EnvType.CLIENT) | ||||||
| public class ShaderReload implements ClientModInitializer { | ||||||
| public static final int GLFW_KEY = GLFW.GLFW_KEY_R; | ||||||
| public static final Logger LOGGER = LogManager.getLogger("Shader Reload"); | ||||||
|
|
||||||
| private static final StopException STOP = new StopException(); | ||||||
| private static boolean reloading = false; | ||||||
| private static boolean stopReloading = false; | ||||||
| private static boolean expectError = false; | ||||||
| private static ResourceReloader shaderLoader; | ||||||
|
|
||||||
| @Override | ||||||
|
|
@@ -41,95 +30,66 @@ public void onInitializeClient() { | |||||
| } | ||||||
|
|
||||||
| public static void reloadShaders() { | ||||||
| if (reloading) return; | ||||||
| var client = MinecraftClient.getInstance(); | ||||||
| if(reloading) { | ||||||
|
||||||
| if(reloading) { | |
| if (reloading) { |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent spacing in the if conditions. Opening braces should be on the same line as the if statement to match Java conventions and the style used in the same file (e.g., line 66).
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent spacing in the if condition. Opening braces should be on the same line as the if statement to match Java conventions.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent spacing in the if condition. Opening braces should be on the same line as the if statement to match Java conventions.