diff --git a/src/main/java/de/teamlapen/vampirism/client/VampirismModClient.java b/src/main/java/de/teamlapen/vampirism/client/VampirismModClient.java index 590bdfefd..41e230d78 100644 --- a/src/main/java/de/teamlapen/vampirism/client/VampirismModClient.java +++ b/src/main/java/de/teamlapen/vampirism/client/VampirismModClient.java @@ -6,12 +6,12 @@ import de.teamlapen.vampirism.REFERENCE; import de.teamlapen.vampirism.VampirismMod; import de.teamlapen.vampirism.api.VampirismAPI; -import de.teamlapen.vampirism.api.client.VIngameOverlays; import de.teamlapen.vampirism.blocks.LogBlock; import de.teamlapen.vampirism.client.config.ModFilter; import de.teamlapen.vampirism.client.core.*; import de.teamlapen.vampirism.client.gui.ScreenEventHandler; -import de.teamlapen.vampirism.client.gui.overlay.*; +import de.teamlapen.vampirism.client.gui.overlay.CustomBossEventOverlay; +import de.teamlapen.vampirism.client.gui.overlay.VampirismHUDOverlay; import de.teamlapen.vampirism.client.renderer.RenderHandler; import de.teamlapen.vampirism.client.renderer.VampirismClientEntityRegistry; import de.teamlapen.vampirism.proxy.ClientProxy; @@ -76,8 +76,6 @@ public VampirismModClient(IEventBus modEventBus, ModContainer modContainer) { if (OptifineHandler.isOptifineLoaded()) { LOGGER.warn("Using Optifine. Expect visual glitches and reduces blood vision functionality if using shaders."); } - - setupApi(); } public void onAddReloadListenerEvent(@NotNull AddReloadListenerEvent event) { @@ -118,14 +116,6 @@ public void clearBossBarOverlay() { this.bossInfoOverlay.clear(); } - private void setupApi() { - VIngameOverlays.FACTION_RAID_BAR_ELEMENT = this.bossInfoOverlay; - VIngameOverlays.BLOOD_BAR_ELEMENT = new BloodBarOverlay(); - VIngameOverlays.FACTION_LEVEL_ELEMENT = new FactionLevelOverlay(); - VIngameOverlays.ACTION_COOLDOWN_ELEMENT = new ActionCooldownOverlay(); - VIngameOverlays.ACTION_DURATION_ELEMENT = new ActionDurationOverlay(); - } - public VampirismHUDOverlay getOverlay() { return this.overlay; } diff --git a/src/main/java/de/teamlapen/vampirism/client/core/ModScreens.java b/src/main/java/de/teamlapen/vampirism/client/core/ModScreens.java index 95dd0c7d4..748737bf5 100644 --- a/src/main/java/de/teamlapen/vampirism/client/core/ModScreens.java +++ b/src/main/java/de/teamlapen/vampirism/client/core/ModScreens.java @@ -1,10 +1,8 @@ package de.teamlapen.vampirism.client.core; import de.teamlapen.vampirism.api.client.VIngameOverlays; -import de.teamlapen.vampirism.client.gui.overlay.BatOverlay; -import de.teamlapen.vampirism.client.gui.overlay.DisguiseOverlay; -import de.teamlapen.vampirism.client.gui.overlay.RageOverlay; -import de.teamlapen.vampirism.client.gui.overlay.SunOverlay; +import de.teamlapen.vampirism.client.VampirismModClient; +import de.teamlapen.vampirism.client.gui.overlay.*; import de.teamlapen.vampirism.client.gui.screens.*; import de.teamlapen.vampirism.client.gui.screens.diffuser.FogDiffuserScreen; import de.teamlapen.vampirism.client.gui.screens.diffuser.GarlicDiffuserScreen; @@ -38,13 +36,12 @@ public static void registerScreens(RegisterMenuScreensEvent event) { event.register(ModMenus.FOG_DIFFUSER.get(), FogDiffuserScreen::new); } - @SuppressWarnings("removal") static void registerScreenOverlays(@NotNull RegisterGuiLayersEvent event) { - event.registerAbove(VanillaGuiLayers.EXPERIENCE_BAR, VIngameOverlays.FACTION_LEVEL_ID, VIngameOverlays.FACTION_LEVEL_ELEMENT); - event.registerAbove(VanillaGuiLayers.BOSS_OVERLAY, VIngameOverlays.FACTION_RAID_BAR_ID, VIngameOverlays.FACTION_RAID_BAR_ELEMENT); - event.registerAbove(VanillaGuiLayers.FOOD_LEVEL, VIngameOverlays.BLOOD_BAR_ID, VIngameOverlays.BLOOD_BAR_ELEMENT); - event.registerAboveAll(VIngameOverlays.ACTION_COOLDOWN_ID, VIngameOverlays.ACTION_COOLDOWN_ELEMENT); - event.registerAboveAll(VIngameOverlays.ACTION_DURATION_ID, VIngameOverlays.ACTION_DURATION_ELEMENT); + event.registerAbove(VanillaGuiLayers.EXPERIENCE_BAR, VIngameOverlays.FACTION_LEVEL_ID, new FactionLevelOverlay()); + event.registerAbove(VanillaGuiLayers.BOSS_OVERLAY, VIngameOverlays.FACTION_RAID_BAR_ID, VampirismModClient.getINSTANCE().getBossInfoOverlay()); + event.registerAbove(VanillaGuiLayers.FOOD_LEVEL, VIngameOverlays.BLOOD_BAR_ID, new BloodBarOverlay()); + event.registerAboveAll(VIngameOverlays.ACTION_COOLDOWN_ID, new ActionCooldownOverlay<>()); + event.registerAboveAll(VIngameOverlays.ACTION_DURATION_ID, new ActionDurationOverlay<>()); event.registerAbove(VanillaGuiLayers.CAMERA_OVERLAYS, VIngameOverlays.RAGE, new RageOverlay()); event.registerAbove(VanillaGuiLayers.CAMERA_OVERLAYS, VIngameOverlays.BAT, new BatOverlay()); event.registerAbove(VanillaGuiLayers.CAMERA_OVERLAYS, VIngameOverlays.DISGUISE, new DisguiseOverlay());