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

track missing textures for sided renderers #2119

Merged
merged 3 commits into from
Nov 7, 2023

Conversation

TechLord22
Copy link
Member

What

Tracks missing textures for sided renderers. This means forge will log a warning stating which textures cannot be found, in the event a sided renderer did not find a texture for any side. This is useful for debugging why a renderer does not display anything, since this warning will output the location being searched for textures.

Implementation Details

The other renderers do not have a case where no location is registered to a texture atlas, so they do not need changes. Registering a texture to the texture atlas will automatically track it in case it is not found.

Outcome

Improves ease of debugging texture location issues for sided renderers.

@TechLord22 TechLord22 added the type: feature New feature or request label Oct 21, 2023
@TechLord22 TechLord22 requested a review from a team as a code owner October 21, 2023 01:43
@TechLord22 TechLord22 added type: feature New feature or request and removed type: feature New feature or request labels Oct 21, 2023
@TechLord22 TechLord22 added this to the 2.8 milestone Oct 31, 2023
@@ -144,6 +155,10 @@ public void registerIcons(TextureMap textureMap) {
sprites.put(overlayFace, new ActivePredicate(normalSprite, activeSprite, pausedSprite,
normalSpriteEmissive, activeSpriteEmissive, pausedSpriteEmissive));
}

if (!foundTexture) {
FMLClientHandler.instance().trackMissingTexture(new ResourceLocation(modID, "blocks/" + basePath + "/overlay_OVERLAY_FACE"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I am trying to figure out if there is some better way here to notify the user that we did not find any overlay face for the block, because I don't really like the use of OVERLAY_FACE, but I cannot think of anything. Its minor enough that it should not block the PR, but if you can think of a better way, I feel like it could be improved.

@TechLord22 TechLord22 merged commit 6ebbe65 into master Nov 7, 2023
@TechLord22 TechLord22 deleted the tc-track-missing-textures branch November 7, 2023 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants