Closed Rellit-219 closed 4 years ago
Can you show how you're declaring the library as dependency in build.gradle
?
You should also be using the latest version of the CocoLib (1.15.2-0.1.1)
.bindAndDrawTexture(GuiElement.java:37) ~[CocoLib-b915c0a15d.jar:1.15.2-0.1.0]
May have fixed this by refreshing the build thanks.
It now no longer crashes, however this black box is the only thing that shows up.
Changed Implementation:
public static final ArrayList<SpriteObject> BAC_HUD_EMPTY_ICONS = new ArrayList<SpriteObject>();
public static final ArrayList<SpriteObject> BAC_HUD_FULL_ICONS = new ArrayList<SpriteObject>();
public static final void initIcons() {
BAC_HUD_EMPTY_ICONS.clear();
BAC_HUD_FULL_ICONS.clear();
for (int i = 0; i < 9; i++) {
BAC_HUD_EMPTY_ICONS.add(SpriteObject.Builder.create(Defines.MODID, "textures/gui/bac_hud_bar.png").withPos(Alignment.CENTER, 1 + (i * 9) + (i * 3), 10 * i).withUV(0, 0).withSize(9, 9).build());
BAC_HUD_FULL_ICONS.add(SpriteObject.Builder.create(Defines.MODID, "textures/gui/bac_hud_bar.png").withPos(Alignment.CENTER, 1 + (i * 9) + (i * 3), 10 * i).withUV(9, 0).withSize(9, 9).build());
}
}
@SubscribeEvent
public void onPreRenderOverlay(RenderGameOverlayEvent.Pre event) {
@Nullable PlayerController controller = Minecraft.getInstance().playerController;
if (controller != null && controller.gameIsSurvivalOrAdventure()) {
for (SpriteObject empty_bac_icon : BAC_HUD_EMPTY_ICONS) {
GuiElement.bindAndDrawTexture(empty_bac_icon);
}
for (SpriteObject full_bac_icon : BAC_HUD_FULL_ICONS) {
GuiElement.bindAndDrawTexture(full_bac_icon);
}
}
}
That is a different issue, can you open a separate ticket for this?
ok
Implementation:
Crash Report:
Read the full stack trace on PasteBin.