Upload files to "src/openonyx/render/group_w"

This commit is contained in:
winterflyt committed 2026-11-30 06:12:20 +02:00
1 parent cacbfb390c
commit cacabaef4f
5 files changed
+729

No files matched your search

@@ -0,0 +1,53 @@
package openonyx.render.group_w;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiChat;
import openonyx.features.hud.CustomGui;
import openonyx.render.group_d.Animation;
import openonyx.render.group_d.Easings;
public final class RenderSupport_202 {
public static final float H = 8.0F;
private static final Animation ANIMATION = new Animation(0.0F);
public static void L(float f) {
float g = f;
CustomGui customGui;
if ((customGui = CustomGuiState.L()) != null && customGui.isEnabled() && customGui.customGuiPart9.isEnabled()) {
boolean bl = Minecraft.getMinecraft().currentScreen instanceof GuiChat;
f = customGui.customGuiPart9.duration.getFloat();
float h;
float i;
if (bl) {
h = 1.0F;
i = f;
} else {
h = 0.0F;
i = f;
}
ANIMATION.animateTo(h, i, bl ? Easings.EASING7 : Easings.EASING);
ANIMATION.update(g);
} else {
ANIMATION.set(0.0F);
}
}
public static void L() {
ANIMATION.set(0.0F);
}
public static float d() {
return ANIMATION.getValue();
}
public static float L() {
CustomGui customGui;
return (customGui = CustomGuiState.L()) != null && customGui.isEnabled() && customGui.customGuiPart9.isEnabled()
? ANIMATION.getValue() * customGui.customGuiPart9.hotbarLift.getFloat()
: 0.0F;
}
private RenderSupport_202() {
}
}
@@ -0,0 +1,165 @@
package openonyx.render.group_w;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.scoreboard.Score;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.scoreboard.Scoreboard;
import openonyx.features.hud.CustomGui;
import openonyx.render.Render2D;
import openonyx.render.RenderSupport_120;
import openonyx.render.group_d.Animation;
import openonyx.render.group_d.Easings;
import openonyx.render.group_e.FontStyle;
import openonyx.theme.AlphaLevels;
import openonyx.theme.Fonts;
import openonyx.theme.Palette;
import openonyx.theme.ThemeManager;
public final class ScoreboardElement extends GuiElement {
private static final float a = 7.0F;
private static final float k = 5.0F;
private final List<ScoreboardElementData> scoreboardElementDatas;
private static final float M = 60.0F;
private static final int L = 3;
private final Animation animation;
private final CustomGui customGui;
private static final float h = 11.0F;
private static final int l = 15;
private static final FontStyle FONT_STYLE = Fonts.FONT_STYLE12;
private static final float d = 1.0F;
private static final float i = 6.0F;
private static final FontStyle FONT_STYLE2 = Fonts.FONT_STYLE12;
private String H;
private final Animation animation2 = new Animation(60.0F);
private void d() {
ScoreboardElement scoreboardElement1 = this;
scoreboardElement1.scoreboardElementDatas.clear();
scoreboardElement1.H = "";
Minecraft minecraft;
if ((minecraft = Minecraft.getMinecraft()).theWorld != null && minecraft.thePlayer != null) {
ScoreObjective scoreObjective;
if ((scoreObjective = L(minecraft)) != null) {
Scoreboard scoreboard = scoreObjective.getScoreboard();
List list = new ArrayList();
Iterator iterator = scoreboard.getSortedScores(scoreObjective).iterator();
label40:
while (true) {
Iterator iterator1 = iterator;
while (iterator1.hasNext()) {
Score score;
if ((score = (Score)iterator.next()).getPlayerName() == null) {
continue label40;
}
if (score.getPlayerName().startsWith("#")) {
iterator1 = iterator;
} else {
list.add(score);
iterator1 = iterator;
}
}
if (list.size() > 15) {
list = list.subList(list.size() - 15, list.size());
}
scoreboardElement1.H = scoreObjective.getDisplayName();
for (int j = ix = list.size() - 1; j >= 0; j = ix) {
Score score1 = (Score)list.get(ix);
ScorePlayerTeam scorePlayerTeam = scoreboard.getPlayersTeam(score1.getPlayerName());
List list1 = scoreboardElement1.scoreboardElementDatas;
String string = score1.getPlayerName();
ix--;
list1.add(new ScoreboardElementData(ScorePlayerTeam.formatPlayerName(scorePlayerTeam, string)));
}
return;
}
}
}
}
@Override
protected float L(Render2D render2D) {
float f = 29.0F + this.scoreboardElementDatas.size() * 11.0F;
this.animation.animateTo(f, 200.0F, Easings.EASING2);
this.animation.update(CustomGuiState.D());
return this.animation.getValue();
}
@Override
protected float d(Render2D render2D) {
ScoreboardElement scoreboardElement1 = this;
float f = FormattedText.L(render2D, FONT_STYLE2, scoreboardElement1.H);
for (Iterator iterator1 = iterator = scoreboardElement1.scoreboardElementDatas.iterator(); iterator1.hasNext(); iterator1 = iterator) {
ScoreboardElementData scoreboardElementData = (ScoreboardElementData)iterator.next();
f = Math.max(f, FormattedText.L(render2D, FONT_STYLE, scoreboardElementData.name()));
}
float g = scoreboardElement1.customGui.customGuiPart8.minWidth.getFloat();
scoreboardElement1.animation2.animateTo(Math.max(g, f + 14.0F), 200.0F, Easings.EASING2);
scoreboardElement1.animation2.update(CustomGuiState.D());
return scoreboardElement1.animation2.getValue();
}
public ScoreboardElement(CustomGui customGui) {
super("mcgui:scoreboard", customGuix.customGuiPart8.positionX, customGuix.customGuiPart8.positionY, customGuix.customGuiPart8.scale);
this.animation = new Animation(22.0F);
this.scoreboardElementDatas = new ArrayList<>();
this.H = "";
this.customGui = customGuix;
}
@Override
protected void L(Render2D render2D, float f, float g, float k) {
Palette palette = ThemeManager.getPalette();
int ix = ThemeManager.withAlpha(AlphaLevels.L(3, palette), this.customGui.customGuiPart8.background.getFloat() / 100.0F);
RenderSupport_120.L(this.customGui.customGuiPart8.blur.isEnabled());
render2D.shadow(0.0F, 0.0F, f, g, 12.0F, 3);
RenderSupport_120.L(render2D, 0.0F, 0.0F, f, g, 12.0F, ix, this.customGui.customGuiPart8.blur.isEnabled());
render2D.pushScissor(0.0F, 0.0F, f, g);
g = 6.0F;
FormattedText.i(render2D, FONT_STYLE2, this.H, f / 2.0F, render2D.centerTextY(FONT_STYLE2, g + 5.5F), palette.onSurface());
float j = g + 11.0F + 2.5F;
render2D.roundedRect(7.0F, j, f - 14.0F, 1.0F, Float.MAX_VALUE, palette.outlineVariant());
f = g + 11.0F + 5.0F + 1.0F;
Iterator iterator = this.scoreboardElementDatas.iterator();
for (Iterator iterator1 = iterator; iterator1.hasNext(); f += 11.0F) {
ScoreboardElementData scoreboardElementData = (ScoreboardElementData)iterator.next();
float hx = f + 5.5F;
iterator1 = iterator;
FormattedText.l(render2D, FONT_STYLE, scoreboardElementData.name(), 7.0F, render2D.centerTextY(FONT_STYLE, hx), palette.onSurfaceVariant());
}
render2D.popScissor();
}
private static ScoreObjective L(Minecraft minecraft) {
Minecraft minecraft1 = minecraft;
Scoreboard scoreboard;
ScorePlayerTeam scorePlayerTeam;
int ix;
ScoreObjective scoreObjective;
return (scorePlayerTeam = (scoreboard = minecraft1.theWorld.getScoreboard()).getPlayersTeam(minecraft1.thePlayer.getName())) != null
&& (ix = scorePlayerTeam.getChatFormat().getColorIndex()) >= 0
&& (scoreObjective = scoreboard.getObjectiveInDisplaySlot(3 + ix)) != null
? scoreObjective
: scoreboard.getObjectiveInDisplaySlot(1);
}
@Override
protected boolean L(boolean bl) {
this.d();
return !this.scoreboardElementDatas.isEmpty();
}
}
@@ -0,0 +1,4 @@
package openonyx.render.group_w;
record ScoreboardElementData(String name) {
}
@@ -0,0 +1,60 @@
package openonyx.render.group_w;
import openonyx.render.group_d.Easings;
public final class SpringValue {
private float m = Float.NaN;
private static final float h = 1100.0F;
private float l;
private static final float I = 60.0F;
private static final float d = 0.15F;
private float i;
private long f;
private static final float H = 350.0F;
private static final float e = 0.028F;
public float L(float f) {
float g = this.L();
if (!Float.isNaN(this.m) && !(Math.abs(fx - this.m) > 60.0F)) {
if (Math.abs(fx - this.m) > 0.01F) {
this.l = 0.0F;
}
this.m = this.m + (fx - this.m) * Math.clamp(0.028F * g, 0.0F, 1.0F);
this.i = 0.0F;
return this.m;
} else {
this.m = fx;
this.l = 0.0F;
return this.m;
}
}
public float d() {
SpringValue springValue1 = this;
if (springValue1.l < 350.0F) {
return 1.0F;
}
float g;
float fx = (g = springValue1.i % 1100.0F / 1100.0F) < 0.5F ? g * 2.0F : (1.0F - g) * 2.0F;
return 0.15F + 0.85F * (float)Easings.EASING6.apply(fx);
}
private float L() {
SpringValue springValue1 = this;
long lx = System.nanoTime();
float fx = springValue1.f == 0L ? 16.0F : Math.min((float)(lx - springValue1.f) / 1000000.0F, 100.0F);
springValue1.f = lx;
springValue1.l += fx;
springValue1.i += fx;
return fx;
}
public void L() {
this.m = Float.NaN;
this.l = 0.0F;
this.i = 0.0F;
this.f = 0L;
}
}
@@ -0,0 +1,447 @@
package openonyx.render.group_w;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.Gui;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.util.MathHelper;
import openonyx.features.hud.CustomGui;
import openonyx.features.hud.FeatureSupport_342Mode;
import openonyx.render.Render2D;
import openonyx.render.TextureFilter;
import openonyx.render.group_d.Easings;
import openonyx.theme.Palette;
import openonyx.theme.ThemeManager;
public final class StatusBarsElement {
private static final float s = 0.2F;
private static final float Z = 2.0F;
private final CustomGui customGui;
private static final int N = 10;
private static final float q = 471.0F;
private static final float x = 8.0F;
private final StatusBarsElementPart statusBarsElementPart;
private static final StatusBarsElementData y = new StatusBarsElementData(16.0F, 9.0F, 34.0F, 9.0F, 1.06F);
public static final float n = 103.0F;
private static final float Y = 22.0F;
private static final float r = 8.0F;
private static final float W = 9.0F;
private static final int P = -4668204;
private final StatusBarsElementPart statusBarsElementPart2;
private static final StatusBarsElementData STATUS_BARS_ELEMENT_DATA = new StatusBarsElementData(52.0F, 9.0F, 88.0F, 9.0F);
private float p;
private static final float t = 0.6F;
private float b;
private final StatusBarsElementPart statusBarsElementPart3;
private static final float F = 250.0F;
private static final float G = 0.006F;
private static final float A = 0.5F;
private static final float K = 0.006F;
private final StatusBarsElementPart statusBarsElementPart4;
private static final int C = -5211588;
private static final float J = 1.6F;
private float D;
private static final float c = 2.0F;
private float a;
private static final int k = -45745;
private static final int g = 256;
private float M;
private final StatusBarsElementPart statusBarsElementPart5;
private static final StatusBarsElementData STATUS_BARS_ELEMENT_DATA2 = new StatusBarsElementData(25.0F, 18.0F, 16.0F, 18.0F);
private static final int m = -15043;
private static final int h = -11688193;
private static final float l = 0.25F;
private static final int I = -2047904;
private float d;
private static final float i = 4.0F;
private static final float f = 8.0F;
private final StatusBarsElementPart statusBarsElementPart6 = new StatusBarsElementPart();
private static final float e = 6.0F;
public void L(Render2D render2D, float f, float g, float h, float i) {
EntityPlayerSP entityPlayerSP;
if ((entityPlayerSP = Minecraft.getMinecraft().thePlayer) != null) {
this.D = (this.D + ix) % 100000.0F;
this.L(entityPlayerSP);
this.L(ix);
Palette palette = ThemeManager.getPalette();
hx -= 2.0F;
if (this.customGui.customGuiPart.mode.is(FeatureSupport_342Mode.ICONS)) {
this.d(render2D, palette, entityPlayerSP, fx, gx, hx);
} else {
this.L(render2D, palette, entityPlayerSP, fx, gx, hx);
}
}
}
private void d(Render2D render2D, Palette palette, EntityPlayer entityPlayer, float f, float g, float h) {
float kx = hx - 8.0F;
boolean bl1 = entityPlayer.getTotalArmorValue() > 0;
boolean bl = L(entityPlayer);
float ix = this.L(render2D, entityPlayer, fx, kx);
float mx;
if (L(entityPlayer) != null) {
this.L(render2D, STATUS_BARS_ELEMENT_DATA, this.statusBarsElementPart2, gx, kx, false, 1.0F, 0.0F);
mx = ix;
} else {
this.L(render2D, d(entityPlayer), this.statusBarsElementPart5, gx, kx, false, 1.0F, 0.0F);
mx = ix;
}
float lx = mx - 8.0F - 2.0F;
float j = kx - 8.0F - 2.0F;
if (bl1) {
this.L(render2D, y, this.statusBarsElementPart4, fx, lx, true, 1.0F, 0.0F);
}
if (bl) {
this.L(render2D, STATUS_BARS_ELEMENT_DATA2, this.statusBarsElementPart3, gx, j, false, 1.0F, 0.0F);
}
float nx;
boolean bl2;
if (bl1) {
nx = lx;
bl2 = bl;
} else {
nx = ix;
bl2 = bl;
}
this.M = Math.min(nx, bl2 ? j : kx);
}
private static StatusBarsElementData D(EntityPlayer entityPlayer) {
EntityPlayer entityPlayer1 = entityPlayer;
float fx = entityPlayer1.isPotionActive(Potion.poison) ? 52.0F : (entityPlayer1.isPotionActive(Potion.wither) ? 88.0F : 16.0F);
float gx = entityPlayer1.worldObj.getWorldInfo().isHardcoreModeEnabled() ? 45.0F : 0.0F;
return new StatusBarsElementData(16.0F, gx, fx + 36.0F, gx);
}
private float D() {
return this.a <= 0.0F ? 0.0F : (float)Math.sin(this.D * 0.05F) * 1.6F * this.a;
}
public boolean L() {
StatusBarsElement statusBarsElement1 = this;
Minecraft minecraft = Minecraft.getMinecraft();
return statusBarsElement1.customGui.isEnabled()
&& statusBarsElement1.customGui.customGuiPart.isEnabled()
&& minecraft.thePlayer != null
&& minecraft.playerController.shouldDrawHUD();
}
private void L(
Render2D render2D,
StatusBarsElementData statusBarsElementData,
StatusBarsElementPart statusBarsElementPart,
float f,
float g,
boolean bl,
float h,
float i
) {
float j = statusBarsElementPartx.D() * 10.0F;
float kx = statusBarsElementPartx.d() * 10.0F;
boolean bl1 = this.customGui.customGuiPart.animate.isEnabled();
boolean bl2 = this.customGui.customGuiPart.damageTrail.isEnabled();
render2D.pushAlpha(hx);
for (int px = nx = 0; px < 10; px = nx) {
float o;
float qx;
if (bl) {
o = fx + nx * 8.0F;
qx = ix;
} else {
o = fx - (nx + 1) * 8.0F;
qx = ix;
}
float lx = o + qx;
float mx = bl1 ? this.L(nx, statusBarsElementPartx) : 1.0F;
render2D.pushMatrix();
render2D.scaleAround(mx, lx + 4.0F, gx + 4.0F);
this.L(render2D, statusBarsElementData, lx, gx);
if (bl2) {
this.L(render2D, statusBarsElementData, lx, gx, Math.clamp(kx - nx, 0.0F, 1.0F), bl, 0.45F);
}
float rx = Math.clamp(j - nx, 0.0F, 1.0F);
nx++;
this.L(render2D, statusBarsElementData, lx, gx, rx, bl, 1.0F);
render2D.popMatrix();
}
render2D.popAlpha();
}
private void L(Render2D render2D, StatusBarsElementData statusBarsElementData, float f, float g) {
float ix = statusBarsElementData.D();
float hx = statusBarsElementData.l();
render2D.L(
Gui.icons,
fx + hx,
gx + hx,
ix,
ix,
statusBarsElementData.containerU(),
statusBarsElementData.containerV(),
9.0F,
9.0F,
256,
256,
-1,
TextureFilter.PIXELS
);
}
private float d() {
return this.customGui.customGuiPart.animate.isEnabled() && !(this.statusBarsElementPart6.D() > 0.2F)
? 1.0F - 0.25F * (0.5F + 0.5F * (float)Math.sin(this.D * 0.006F * Math.PI))
: 1.0F;
}
private static StatusBarsElementData d(EntityPlayer entityPlayer) {
boolean bl = entityPlayer.isPotionActive(Potion.hunger);
StatusBarsElementData statusBarsElementData = new StatusBarsElementData;
if (bl) {
statusBarsElementData./* $VF: Unable to resugar constructor */<init>(133.0F, 27.0F, 88.0F, 27.0F);
return statusBarsElementData;
} else {
statusBarsElementData./* $VF: Unable to resugar constructor */<init>(16.0F, 27.0F, 52.0F, 27.0F);
return statusBarsElementData;
}
}
private void L(Render2D render2D, StatusBarsElementData statusBarsElementData, float f, float g, float h, float i, float j) {
if (!(ix <= hx)) {
float kx = statusBarsElementData.D();
float lx = statusBarsElementData.l();
boolean bl = hx <= 0.0F && ix >= 1.0F;
render2D.pushAlpha(j);
if (!bl) {
render2D.pushScissor(fx + lx + kx * hx, gx + lx, kx * (ix - hx), kx);
}
render2D.L(
Gui.icons, fx + lx, gx + lx, kx, kx, statusBarsElementData.fillU(), statusBarsElementData.fillV(), 9.0F, 9.0F, 256, 256, -1, TextureFilter.PIXELS
);
if (!bl) {
render2D.popScissor();
}
render2D.popAlpha();
}
}
private static StatusBarsElementData L(EntityPlayer entityPlayer) {
EntityPlayer entityPlayer1 = entityPlayer;
float fx = entityPlayer1.isPotionActive(Potion.poison) ? 52.0F : (entityPlayer1.isPotionActive(Potion.wither) ? 88.0F : 16.0F);
float gx = entityPlayer1.worldObj.getWorldInfo().isHardcoreModeEnabled() ? 45.0F : 0.0F;
return new StatusBarsElementData(16.0F, gx, fx + 144.0F, gx);
}
private void L(EntityPlayer entityPlayer) {
this.d = Math.max((float)entityPlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue(), 1.0F);
this.p = Math.max(entityPlayer.getAbsorptionAmount(), 0.0F);
float fx = entityPlayer.getHealth();
this.statusBarsElementPart6.L(fx, this.d);
this.statusBarsElementPart.L(this.p, this.d);
this.statusBarsElementPart4.L(entityPlayer.getTotalArmorValue(), 20.0F);
this.statusBarsElementPart5.L(entityPlayer.getFoodStats().getFoodLevel(), 20.0F);
this.statusBarsElementPart3.L(L(entityPlayer) ? entityPlayer.getAir() : 300.0F, 300.0F);
EntityLivingBase entityLivingBase;
if ((entityLivingBase = L(entityPlayer)) != null) {
this.statusBarsElementPart2.L(entityLivingBase.getHealth(), entityLivingBase.getMaxHealth());
}
float gx = fx + this.p;
if (this.customGui.customGuiPart.animate.isEnabled() && this.b >= 0.0F && gx < this.b - 0.01F) {
this.a = 1.0F;
}
this.b = gx;
}
public void L() {
this.a = 0.0F;
this.b = -1.0F;
this.M = Float.NaN;
}
private void L(float f) {
this.statusBarsElementPart6.L(fx);
this.statusBarsElementPart.L(fx);
this.statusBarsElementPart4.L(fx);
this.statusBarsElementPart5.L(fx);
this.statusBarsElementPart3.L(fx);
this.statusBarsElementPart2.L(fx);
this.a = Math.max(0.0F, this.a - fx * 0.006F);
}
private static boolean L(EntityPlayer entityPlayer) {
return entityPlayer.isInsideOfMaterial(Material.water) || entityPlayer.getAir() < 300;
}
private void L(Render2D render2D, StatusBarsElementData statusBarsElementData, float f, float g, float h, boolean bl, float i) {
if (!(hx <= 0.0F)) {
if (bl) {
this.L(render2D, statusBarsElementData, fx, gx, 0.0F, hx, ix);
} else {
this.L(render2D, statusBarsElementData, fx, gx, 1.0F - hx, 1.0F, ix);
}
}
}
private float L(Render2D render2D, EntityPlayer entityPlayer, float f, float g) {
StatusBarsElement statusBarsElement1 = this;
StatusBarsElementData statusBarsElementData1 = D(entityPlayer);
StatusBarsElementData statusBarsElementData = L(entityPlayer);
float hx = statusBarsElement1.d + statusBarsElement1.p;
int v = Math.max(1, MathHelper.ceiling_float_int(hx / 2.0F));
int ix = Math.max(1, MathHelper.ceiling_float_int(v / 10.0F));
float j = Math.max(10.0F - (ix - 2), 3.0F);
float kx = statusBarsElement1.statusBarsElementPart6.D() * statusBarsElement1.d;
float lx = statusBarsElement1.statusBarsElementPart6.d() * statusBarsElement1.d;
float mx = statusBarsElement1.d + statusBarsElement1.statusBarsElementPart.D() * statusBarsElement1.d;
float nx = statusBarsElement1.d + statusBarsElement1.statusBarsElementPart.d() * statusBarsElement1.d;
int o = MathHelper.floor_float(statusBarsElement1.d / 2.0F);
boolean bl = statusBarsElement1.customGui.customGuiPart.animate.isEnabled();
boolean bl1 = statusBarsElement1.customGui.customGuiPart.damageTrail.isEnabled();
float px = statusBarsElement1.D();
render2D.pushAlpha(statusBarsElement1.d());
int qx;
for (int w = qx = 0; w < v; w = qx) {
float rx = fx + qx % 10 * 8.0F + px;
float sx = gx - qx / 10 * j;
float u;
boolean bl2 = (u = qx * 2.0F) >= statusBarsElement1.d;
float xx;
if (bl) {
int yx;
boolean bl3;
if (bl2) {
yx = Math.max(qx - o, 0);
bl3 = bl2;
} else {
yx = qx % 10;
bl3 = bl2;
}
xx = statusBarsElement1.L(yx, bl3 ? statusBarsElement1.statusBarsElementPart : statusBarsElement1.statusBarsElementPart6);
} else {
xx = 1.0F;
}
float tx = xx;
render2D.pushMatrix();
render2D.scaleAround(tx, rx + 4.0F, sx + 4.0F);
statusBarsElement1.L(render2D, statusBarsElementData1, rx, sx);
if (bl1) {
statusBarsElement1.L(render2D, statusBarsElementData1, rx, sx, 0.0F, L(lx - u), 0.45F);
statusBarsElement1.L(render2D, statusBarsElementData, rx, sx, L(statusBarsElement1.d - u), L(nx - u), 0.45F);
}
statusBarsElement1.L(render2D, statusBarsElementData1, rx, sx, 0.0F, L(kx - u), 1.0F);
float z = L(statusBarsElement1.d - u);
float ba = L(mx - u);
qx++;
statusBarsElement1.L(render2D, statusBarsElementData, rx, sx, z, ba, 1.0F);
render2D.popMatrix();
}
render2D.popAlpha();
return gx - (ix - 1) * j;
}
private void L(Render2D render2D, Palette palette, StatusBarsElementPart statusBarsElementPart, int i, float f, float g, float h, float j, float k) {
render2D.pushAlpha(j);
render2D.roundedRect(fx, gx, hx, 6.0F, Float.MAX_VALUE, palette.surfaceContainerHighest());
float lx;
if (this.customGui.customGuiPart.damageTrail.isEnabled() && (lx = hx * statusBarsElementPartx.d()) > 0.5F) {
render2D.roundedRect(fx, gx, lx, 6.0F, Float.MAX_VALUE, ThemeManager.withAlpha(ix, 0.4F));
}
float mx;
if ((mx = hx * statusBarsElementPartx.D()) > 0.5F) {
render2D.roundedRect(fx, gx, mx, 6.0F, Float.MAX_VALUE, ix);
}
float nx;
if (kx > 0.0F && (nx = hx * Math.clamp(kx, 0.0F, 1.0F)) > 0.5F) {
render2D.roundedRect(fx, gx, nx, 6.0F, Float.MAX_VALUE, ThemeManager.withAlpha(-15043, 0.85F));
}
render2D.popAlpha();
}
public float L() {
return this.M;
}
private static float L(float f) {
return Math.clamp(fx / 2.0F, 0.0F, 1.0F);
}
private float L(int i, StatusBarsElementPart statusBarsElementPart) {
float fx;
if ((fx = statusBarsElementPartx.L() - ix * 22.0F) < 0.0F) {
return 0.6F;
} else {
return fx >= 250.0F ? 1.0F : 0.6F + 0.39999998F * (float)Easings.EASING7.apply(fx / 250.0F);
}
}
public StatusBarsElement(CustomGui customGui) {
this.statusBarsElementPart5 = new StatusBarsElementPart();
this.statusBarsElementPart4 = new StatusBarsElementPart();
this.statusBarsElementPart3 = new StatusBarsElementPart();
this.statusBarsElementPart = new StatusBarsElementPart();
this.statusBarsElementPart2 = new StatusBarsElementPart();
this.d = 20.0F;
this.M = Float.NaN;
this.b = -1.0F;
this.customGui = customGuix;
}
private static EntityLivingBase L(EntityPlayer entityPlayer) {
EntityPlayer entityPlayer1 = entityPlayer;
Entity entity = entityPlayer1.ridingEntity;
return entityPlayer1.ridingEntity instanceof EntityLivingBase ? (EntityLivingBase)entity : null;
}
private void L(Render2D render2D, Palette palette, EntityPlayer entityPlayer, float f, float g, float h) {
float ix = (gx - fx - 8.0F) / 2.0F;
gx -= ix;
hx -= 6.0F;
boolean bl = entityPlayer.getTotalArmorValue() > 0;
boolean bl1 = L(entityPlayer);
this.L(render2D, palette, this.statusBarsElementPart6, -45745, fx + this.D(), hx, ix, this.d(), this.statusBarsElementPart.D());
float kx;
if (L(entityPlayer) != null) {
this.L(render2D, palette, this.statusBarsElementPart2, -2047904, gx, hx, ix, 1.0F, 0.0F);
kx = hx;
} else {
this.L(render2D, palette, this.statusBarsElementPart5, -5211588, gx, hx, ix, 1.0F, 0.0F);
kx = hx;
}
float j = kx - 6.0F - 4.0F;
if (bl) {
this.L(render2D, palette, this.statusBarsElementPart4, -4668204, fx, j, ix, 1.0F, 0.0F);
}
if (bl1) {
this.L(render2D, palette, this.statusBarsElementPart3, -11688193, gx, j, ix, 1.0F, 0.0F);
}
this.M = !bl && !bl1 ? hx : j;
}
}