Skip to content
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

feat(HUD): Centered Crosshair #5652

Open
wants to merge 2 commits into
base: nextgen
Choose a base branch
from
Open

Conversation

Zirada
Copy link
Contributor

@Zirada Zirada commented Feb 17, 2025

The crosshair is not actually centered in vanilla. This fixes it.
Credit: https://github.com/JustAlittleWolf/centered-crosshair/

Copy link
Contributor

@ccetl ccetl left a comment

Choose a reason for hiding this comment

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

If the original source is under the MIT license, a copy right notice must be included. Please read the license of the project (https://github.com/JustAlittleWolf/centered-crosshair/blob/main/LICENSE).

Also, I think this should not be the default behavior of the client. Either it should be an option, or, the solution I would prefer, would be to have the crosshairs in a theme so that it can be fully customized, even with logic.

@Zirada
Copy link
Contributor Author

Zirada commented Feb 17, 2025

Customizable crosshairs would be awesome. For now I'll just add a setting to HUD though.

@@ -111,6 +115,28 @@ private void hookFreeCamRenderCrosshairInThirdPerson(DrawContext context, Render
}
}

@Redirect(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawGuiTexture(Ljava/util/function/Function;Lnet/minecraft/util/Identifier;IIII)V", ordinal = 0))
Copy link
Member

@1zun4 1zun4 Mar 1, 2025

Choose a reason for hiding this comment

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

Please do not use @Redirect. Instead use e.g. @WrapOperation, @ModifyExpressionValue ... etc

@1zun4 1zun4 changed the title feat: Centered Crosshair feat(HUD): Centered Crosshair Mar 1, 2025
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