Alright, I finally got something!
The text is finally rendering (Don't know how, but it works without any errors). What I need now is the actual bar rendering.
I see that vanilla BossHealthOverlay has a method called "drawBar" which uses GuiComponent#blit to draw the bar. How would I do that in my class?
Here's what I currently have:
@Mod.EventBusSubscriber(modid = ProjectApple.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE)
public class PA_RenderGameOverlayEvent {
private static final ResourceLocation GUI_BARS_LOCATION = new ResourceLocation("textures/gui/bars.png");
private static final Minecraft minecraft = Minecraft.getInstance();
@SubscribeEvent
public static void registerBossBarRendering(RenderGameOverlayEvent.Pre event) {
Map<UUID, PA_LerpingBossEvent> events = PA_BossEventPacket.getEvents();
if (!events.isEmpty()) {
int i = minecraft.getWindow().getGuiScaledWidth();
int j = 12;
for(PA_LerpingBossEvent lerpingEvent : events.values()) {
int k = i / 2 - 91;
if (!event.isCanceled()) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, GUI_BARS_LOCATION);
Component component = lerpingEvent.getName();
int l = minecraft.font.width(component);
int i1 = i / 2 - l / 2;
int j1 = j - 9;
minecraft.font.drawShadow(event.getMatrixStack(), component, (float)i1, (float)j1, 16777215);
}
if (j >= minecraft.getWindow().getGuiScaledHeight() / 3) {
break;
}
}
}
}
}
P.S.: I know that I need a custom bars texture. I'm using the vanilla one as a placeholder until I get the rendering done.