OpenModsLib

OpenModsLib

56M Downloads

Gui textures still not loading properly

Violet754 opened this issue ยท 4 comments

commented

i found while working with the Lib that the textures wont load and instead loads a placeholder texture that's all pink i figured out how to fix it but i dont want to commit because i dont want to mess anything up so the code is here and i will leave it to you to sort out where it goes or if you dont want it thanks

in file Base Component
in method : bind Components Sheet
final Resource location params "openmodslib:/textures/gui/components.png"
then hook that resource location to minecraft.getminecraft().renderengine.bindtexture

if you need a example on whats going on with the texture its the same as last time when zarkoix made the issue

whoops forgot to label bug sorry

commented

Uh, and how is that different from current implementation? Only difference I can notice is additional / on start of texture. And everything works fine without it.

public final static ResourceLocation TEXTURE_SHEET = new ResourceLocation("openmodslib", "textures/gui/components.png");

protected void bindComponentsSheet() {
        CompatibilityUtils.bindTextureToClient(TEXTURE_SHEET);
}

// in CompatibilityUtils
public static void bindTextureToClient(ResourceLocation texture) {
        if (texture != null) {
            if (Minecraft.getMinecraft() != null) {
                Minecraft.getMinecraft().renderEngine.bindTexture(texture);
            } else {
                Log.warn("Binding texture to null client.");
            }
        } else {
            Log.warn("Invalid texture location '%s'", texture);
        }
    }
commented

hmm odd it just does not load for me i get a placeholder pink texture and the log warning that it failed to load the texture with a java io exeption

commented

Oh whoops i forgot one change i did while trying to find out the error i also changed the assets location to the src folder and now it works even with your code sorry for that i just got the wrong idea of what i changed to get it to work
anyway maybe the folder is just not commited that way but it is that way on your machine?
btw you can close at anytime just want you to see this :)

sorry it was my fault i had just not put them in the classpath.. sorry for wasting your time :(

commented

What, this file https://github.com/OpenMods/OpenModsLib/blob/master/assets/openmodslib/textures/gui/components.png? Nah, totally not commited.

BTW, assets generally work better when they are in classpath.