⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Port to 1.21.10#16

Open
RobotHanzo wants to merge 8 commits into5uso:mainfrom
RobotHanzo:1.21.10
Open

Port to 1.21.10#16
RobotHanzo wants to merge 8 commits into5uso:mainfrom
RobotHanzo:1.21.10

Conversation

@RobotHanzo
Copy link

No description provided.

Copilot AI review requested due to automatic review settings January 20, 2026 21:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request ports the Shader Reload mod from Minecraft 1.21 to 1.21.10. The changes adapt the mod to significant API changes in Minecraft's shader loading system by replacing multiple mixins with a simpler approach using a custom shader loader.

Changes:

  • Updated Minecraft, Fabric Loader, Fabric API, and Gradle versions to support 1.21.10
  • Replaced shader loading mixins (GameRendererMixin, WorldRendererMixin, GlProgramManagerMixin) with a new CustomShaderLoader class
  • Updated KeyboardMixin to use new input parameter types (KeyInput and CharInput) introduced in Minecraft 1.21.10
  • Simplified error handling by removing the custom StopException in favor of an expectError flag

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
gradle.properties Updated version numbers for Minecraft (1.21.10), Yarn mappings, Fabric Loader (0.18.4), and Fabric API; added Loom version and parallel build flag
gradle/wrapper/gradle-wrapper.properties Updated Gradle from 8.8 to 9.3.0
build.gradle Changed plugin to fabric-loom-remap, added full Fabric API dependency, added loom mod configuration, added duplicate JavaCompile block
settings.gradle Removed deprecated jcenter repository, added mavenCentral
fabric.mod.json Updated minimum Fabric Loader to 0.18.4 and Minecraft to 1.21.10
shaderreload.mixins.json Removed GameRendererMixin, KeyboardInvoker, GlProgramManagerMixin, and WorldRendererMixin; added MinecraftClientMixin
MinecraftClientMixin.java New mixin that replaces the ShaderLoader in MinecraftClient constructor with CustomShaderLoader
CustomShaderLoader.java New class extending ShaderLoader to handle shader loading with fallback to default resource pack
KeyboardMixin.java Updated to use new KeyInput and CharInput parameter types; simplified F3+R key handling logic
ShaderReload.java Refactored error handling to use expectError flag instead of StopException; removed shader loading logic now handled by CustomShaderLoader
GameRendererMixin.java Deleted - functionality moved to CustomShaderLoader
WorldRendererMixin.java Deleted - functionality moved to CustomShaderLoader
KeyboardInvoker.java Deleted - no longer needed with new approach
GlProgramManagerMixin.java Deleted - no longer needed with new approach

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +42 to +44
private PostEffectProcessor loadDefaultPostEffect(Identifier id, Set<Identifier> availableExternalTargets) {
return null;
}
Copy link

Copilot AI Jan 20, 2026

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.

Copilot uses AI. Check for mistakes.
public static void reloadShaders() {
if (reloading) return;
var client = MinecraftClient.getInstance();
if(reloading) {
Copy link

Copilot AI Jan 20, 2026

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. The opening brace should be on the same line as the if statement to match Java conventions and the style used elsewhere in the file (e.g., line 43).

Suggested change
if(reloading) {
if (reloading) {

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +51
if(throwable == null) {
debugLog(Text.translatable("debug.reload_shaders.message"));
expectError = false;
return;
}
}
var translationKey = "debug.reload_shaders.error" + (builtin ? ".builtin" : "");
((KeyboardInvoker) client.keyboard).invokeDebugError(translationKey);
client.inGameHud.getChatHud().addMessage(Text.literal(throwable.getMessage()).formatted(Formatting.GRAY));
}

// Try loading a core shader; if it fails, stop shader reloading or try loading a built-in core shader.
public static ShaderProgram onLoadShaders$new(ResourceFactory factory, String name, VertexFormat format) throws IOException {
try {
return new ShaderProgram(factory, name, format);
} catch (IOException e) {
printShaderException(e, false);
if (reloading) throw STOP;
}
try {
var defaultPack = MinecraftClient.getInstance().getDefaultResourcePack();
return new ShaderProgram(defaultPack.getFactory(), name, format);
} catch (IOException e) {
printShaderException(e, true);
throw e;
}
if(throwable instanceof CompletionException ex && ex.getCause() != null) {
throwable = ex.getCause();
}
Copy link

Copilot AI Jan 20, 2026

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 uses AI. Check for mistakes.
Comment on lines +68 to +70
if(cause != null) {
throwable = cause;
} else {
Copy link

Copilot AI Jan 20, 2026

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.

Copilot uses AI. Check for mistakes.
@Override
public PostEffectProcessor loadPostEffect(Identifier id, Set<Identifier> availableExternalTargets) {
PostEffectProcessor result = super.loadPostEffect(id, availableExternalTargets);
if(result != null) return result;
Copy link

Copilot AI Jan 20, 2026

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.

Suggested change
if(result != null) return result;
if (result != null) {
return result;
}

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +25
@Inject(method = "onKey", at = @At(value = "HEAD"), cancellable = true)
void onOnKey(long window, int action, KeyInput input, CallbackInfo ci) {
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The window parameter is passed to the method but not used - instead, this.client.getWindow() is used on line 26. The window parameter should either be used instead of this.client.getWindow(), or if this.client.getWindow() is necessary, document why the window parameter is ignored.

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +43
return null;
}

private PostEffectProcessor loadDefaultPostEffect(Identifier id, Set<Identifier> availableExternalTargets) {
return null;
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method loadDefaultProgram is declared but never implemented - it only returns null. If this is a placeholder for future implementation, consider adding a TODO comment or throwing an UnsupportedOperationException to make the intent clearer.

Suggested change
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 uses AI. Check for mistakes.
public class MinecraftClientMixin {
@Redirect(method = "<init>", at = @At(value = "NEW", target = "Lnet/minecraft/client/gl/ShaderLoader;"))
ShaderLoader replaceShaderLoader(TextureManager textureManager, Consumer<Exception> onError) {
ShaderLoader loader = new CustomShaderLoader(textureManager);
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onError parameter is declared but never used in the method. The constructor call to CustomShaderLoader only passes textureManager. Either remove the unused parameter from the redirect signature or pass it to the CustomShaderLoader if it should be used.

Suggested change
ShaderLoader loader = new CustomShaderLoader(textureManager);
ShaderLoader loader = new CustomShaderLoader(textureManager, onError);

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants