Polyfrost / OneConfig

Next generation configuration library for Minecraft

Home Page:https://polyfrost.org/projects/oneconfig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internal assets not usable

ForBai opened this issue · comments

Bug description

When using RenderManager#drawImage or RenderManager#drawSvg you get a compile error that it cant accses "cc.polyfrost.oneconfig.internal.assets.SVGs" / "cc.polyfrost.oneconfig.internal.assets.SVGs"

Steps to reproduce

Use RenderManager#drawImage or RenderManager#drawSvg

Expected behavior

No compile error

Anything else?

here both crash report:

/home/lars/MCDevelopment/SkyblockHelper/versions/1.8.9-forge/build/sources/java/cc/polyfrost/example/util/render/graph/Graph.java:67: error: cannot access SVGs
            RenderManager.drawSvg(vg, this.getClass().getResource("/assets/oneconfig/old-icons/ArrowUp.svg").getFile(), X + BORDER + 5, Y +BORDER * 2 +5,20,20,Colorz.WHITE);
                         ^
  class file for cc.polyfrost.oneconfig.internal.assets.SVGs not found

and the one with Images

/home/lars/MCDevelopment/SkyblockHelper/versions/1.8.9-forge/build/sources/java/cc/polyfrost/example/util/render/graph/Graph.java:67: error: cannot access Images
            RenderManager.drawImage(vg, this.getClass().getResource("/assets/oneconfig/old-icons/ArrowUp.svg").getFile(), X + BORDER + 5, Y +BORDER * 2 +5,20,20,Colorz.WHITE);
                         ^
  class file for cc.polyfrost.oneconfig.internal.assets.Images not found

hi, the SVG and Images classes at the moment are in the internal package, meaning they are excluded from the builds you use.
They will be moved out eventually, but at the moment they are in there because they change so much during this alpha phase that it is not a good idea to allow them to be public, as any changes can cause crashes.

Sorry for any inconvenience. A bypass may be being added soon to allow you to use them for now.

Ok, thank you for your fast reply.

To fix this issue (which shouldn't be an issue in the first place lol) RenderManager should stop using these internal classes as constructors. The compiler is failing because it can't figure out what method to use.

I would make a quick PR but way too many classes depend on the SVGs and Images class for some absurd reason. One example is the GUI elements, like BasicButton, which use these internal classes in their constructor. We might as well make the GUI elements internal if we don't care about the usability in the public API.

update oneconfig and will be resolved

Thanks