2008Choco/VeinMiner

Missing/corrupt texture on 1.18.1 Fabric client

2008Choco opened this issue · 1 comments

Much like on the 1.17.1 client, the 1.18 client seems to consider the VeinMiner icon a corrupted texture/unrecognized file format resulting in the following missing texture:

image

Relevant exception:

[13:53:11] [Render thread/WARN] (Minecraft) Failed to load texture: veinminer4bukkit:textures/gui/veinminer_icon.png
java.io.IOException: Could not load image: Image not of any known type, or corrupt
	at net.minecraft.client.texture.NativeImage.read(NativeImage.java:134) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.texture.NativeImage.read(NativeImage.java:108) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.texture.NativeImage.read(NativeImage.java:99) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.texture.ResourceTexture$TextureData.load(ResourceTexture.java:82) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.texture.ResourceTexture.loadTextureData(ResourceTexture.java:57) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.texture.ResourceTexture.load(ResourceTexture.java:28) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.texture.TextureManager.loadTexture(TextureManager.java:96) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.texture.TextureManager.registerTexture(TextureManager.java:68) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.texture.TextureManager.getTexture(TextureManager.java:118) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at com.mojang.blaze3d.systems.RenderSystem._setShaderTexture(RenderSystem.java:1194) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at com.mojang.blaze3d.systems.RenderSystem.setShaderTexture(RenderSystem.java:1187) ~[minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at wtf.choco.veinminer.fabric.VeinMiner.lambda$onInitializeClient$3(VeinMiner.java:74) ~[main/:?]
	at net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback.lambda$static$0(HudRenderCallback.java:27) ~[fabric-rendering-v1-1.10.3+6b21378ac8.jar:?]
	at net.minecraft.client.gui.hud.InGameHud.handler$zeb000$render(InGameHud.java:1529) [minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.gui.hud.InGameHud.render(InGameHud.java:415) [minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.render.GameRenderer.render(GameRenderer.java:856) [minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.MinecraftClient.render(MinecraftClient.java:1117) [minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.MinecraftClient.run(MinecraftClient.java:733) [minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:238) [minecraft-project-@VeinMiner-Fabric-mapped.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:602) [fabric-loader-0.12.11.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77) [fabric-loader-0.12.11.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.12.11.jar:?]
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]

Entirely unfamiliar with the potential rendering changes in 1.18.1, perhaps @YuRaNnNzZZ could provide input as they are the one that resolved the 1.17 rendering issues. Until then, I'm unsure how to resolve the issue on my own.

This seems to occur somewhere along the build process. The PNG is fine in the file system, though when starting a dev environment or opening the compiled/remapped mod with an archive explorer, the .png is actually corrupted. I may have to chalk this one up to Gradle not maintaining the integrity of the PNG, but I'm not sure how to fix that either...

Replacing the PNG in the final compiled jar with the very same PNG that is in the project's file system seems to resolve the issue, but obviously that's not a fix. That's a band-aid. Ideally the PNG would not corrupt while the project is compiled and tested.