DarkStorm652 / Minecraft-GUI-API

Provides a toolkit for creating widgets through Minecraft.
BSD 2-Clause "Simplified" License
100 stars 36 forks source link

NoClassDefFoundError on 1.12.2 #17

Open cyruscook opened 5 years ago

cyruscook commented 5 years ago

Hi, I'm not sure if you're interested in maintaining this project, however at the moment when packaging this with for 1.12.2 I'm getting a java.lang.NoClassDefFoundError: org/newdawn/slick/SlickException error at org.darkstorm.minecraft.gui.theme.simple.SimpleTheme.(SimpleTheme.java:14).

I'm pretty sure it's to do with this code at UnicodeFontRenderer.java (Line 25)

try {
    font.loadGlyphs();
} catch(SlickException exception) {
    throw new RuntimeException(exception);
}

I'd appreciate any help?

cyruscook commented 5 years ago

If anyone else is having this issue, here is a workaround.

Go to org.darkstorm.minecraft.gui.theme.simple.SimpleTheme.java and replace

fontRenderer = new UnicodeFontRenderer(new Font("Trebuchet MS", Font.PLAIN, 15));

with:

fontRenderer = Minecraft.getMinecraft().fontRendererObj;

This isn't perfect as it means that the fancy font the GUI was using will be replaced with the default minecraft font, however at least it works.

Frontear commented 5 years ago

Or you could just read the README and use slick2d library. Either works.

cyruscook commented 5 years ago

Was using slick2d @Frontear

Frontear commented 5 years ago

According to your own comment java.lang.NoClassDefFoundError: org/newdawn/slick/SlickException error at org.darkstorm.minecraft.gui.theme.simple.SimpleTheme.(SimpleTheme.java:14). no, you are not. Did you properly link it as a library? If you did, Java should have been able to find the class.

That, or you used a version which didn't contain certain classes.

cyruscook commented 5 years ago

Probably was a problem with eclipse linking the library, although I would’ve expected more errors for all the other slick2d implementations