Skip to content

Commit

Permalink
remove deprecated fields in VIngameOverlays
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheaterpaul committed Sep 28, 2024
1 parent c92d734 commit 444bfac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down
17 changes: 7 additions & 10 deletions src/main/java/de/teamlapen/vampirism/client/core/ModScreens.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 444bfac

Please sign in to comment.