Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.blaze3d.systems.RenderSystem;
import fuzs.overflowingbars.OverflowingBars;
import fuzs.overflowingbars.config.ClientConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -14,8 +15,8 @@ public class BarOverlayRenderer {

public static void renderHealthLevelBars(Minecraft minecraft, GuiGraphics guiGraphics, int leftHeight, boolean rowCount) {
if (minecraft.getCameraEntity() instanceof Player player) {
int posX = guiGraphics.guiWidth() / 2 - 91;
int posY = guiGraphics.guiHeight() - leftHeight;
int posX = guiGraphics.guiWidth() / 2 - 91 + OverflowingBars.CONFIG.get(ClientConfig.class).health.manualRowShiftX;
int posY = guiGraphics.guiHeight() - leftHeight + OverflowingBars.CONFIG.get(ClientConfig.class).health.manualRowShiftY;
HealthBarRenderer.INSTANCE.renderPlayerHealth(guiGraphics, posX, posY, player, minecraft.getProfiler());
if (rowCount) {
int allHearts = Mth.ceil(player.getHealth());
Expand All @@ -28,8 +29,8 @@ public static void renderHealthLevelBars(Minecraft minecraft, GuiGraphics guiGra

public static void renderArmorLevelBar(Minecraft minecraft, GuiGraphics guiGraphics, int leftHeight, boolean rowCount, boolean unmodified) {
if (minecraft.getCameraEntity() instanceof Player player) {
int posX = guiGraphics.guiWidth() / 2 - 91;
int posY = guiGraphics.guiHeight() - leftHeight;
int posX = guiGraphics.guiWidth() / 2 - 91 + OverflowingBars.CONFIG.get(ClientConfig.class).armor.manualRowShiftX;
int posY = guiGraphics.guiHeight() - leftHeight + OverflowingBars.CONFIG.get(ClientConfig.class).armor.manualRowShiftY;
ArmorBarRenderer.renderArmorBar(guiGraphics, posX, posY, player, minecraft.getProfiler(), unmodified);
if (rowCount && !unmodified) {
RowCountRenderer.drawBarRowCount(guiGraphics, posX - 2, posY, player.getArmorValue(), true,
Expand All @@ -41,8 +42,8 @@ public static void renderArmorLevelBar(Minecraft minecraft, GuiGraphics guiGraph

public static void renderToughnessLevelBar(Minecraft minecraft, GuiGraphics guiGraphics, int guiHeight, boolean rowCount, boolean leftSide, boolean unmodified) {
if (minecraft.getCameraEntity() instanceof Player player) {
int posX = guiGraphics.guiWidth() / 2 + (leftSide ? -91 : 91);
int posY = guiGraphics.guiHeight() - guiHeight;
int posX = guiGraphics.guiWidth() / 2 + (leftSide ? -91 : 91) + OverflowingBars.CONFIG.get(ClientConfig.class).toughness.manualRowShiftX;
int posY = guiGraphics.guiHeight() - guiHeight + OverflowingBars.CONFIG.get(ClientConfig.class).toughness.manualRowShiftY;
ArmorBarRenderer.renderToughnessBar(guiGraphics, posX, posY, player, minecraft.getProfiler(), leftSide,
unmodified
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ public static class IconRowConfig implements ConfigCore {
@Config(description = "Shift the bar up or down by specified number of icon rows. Allows for better mod compatibility.")
@Config.IntRange(min = -5, max = 5)
public int manualRowShift = 0;
@Config(description = "Shift the bar up or down by specified number of pixels. Allows for better mod compatibility.")
@Config.IntRange(min = -60, max = 60)
public int manualRowShiftY = 0;
@Config(description = "Shift the bar left or right by specified number of pixels. Allows for better mod compatibility.")
@Config.IntRange(min = -60, max = 60)
public int manualRowShiftX = 0;

public int manualRowShift() {
return this.manualRowShift * 10;
Expand Down