Changes how the mod handles status bars slightly.
This should somewhat increase compatibility with the AppleSkin mod.
This commit is contained in:
@@ -250,6 +250,8 @@ public class TimerUtils
|
|||||||
ConfigManager.getInstance().getExperienceTime();
|
ConfigManager.getInstance().getExperienceTime();
|
||||||
ConfigManager.TimeValues jump =
|
ConfigManager.TimeValues jump =
|
||||||
ConfigManager.getInstance().getJumpTime();
|
ConfigManager.getInstance().getJumpTime();
|
||||||
|
ConfigManager.TimeValues healthTimes = ConfigManager.getInstance().getHealthTime();
|
||||||
|
ConfigManager.TimeValues hungerTimes = ConfigManager.getInstance().getHungerTime();
|
||||||
|
|
||||||
float hotbarAlpha = Main.getAlpha(hotbarTime,
|
float hotbarAlpha = Main.getAlpha(hotbarTime,
|
||||||
hotbar.getMaxTime(),
|
hotbar.getMaxTime(),
|
||||||
@@ -263,8 +265,21 @@ public class TimerUtils
|
|||||||
jump.getMaxTime(),
|
jump.getMaxTime(),
|
||||||
jump.getFadeInTime(),
|
jump.getFadeInTime(),
|
||||||
jump.getFadeOutTime());
|
jump.getFadeOutTime());
|
||||||
|
float statusAlpha = Main.getAlpha(healthTime,
|
||||||
|
healthTimes.getMaxTime(),
|
||||||
|
healthTimes.getFadeInTime(),
|
||||||
|
healthTimes.getFadeOutTime());
|
||||||
|
statusAlpha = Math.max(statusAlpha, Main.getAlpha(hungerTime,
|
||||||
|
hungerTimes.getMaxTime(),
|
||||||
|
hungerTimes.getFadeInTime(),
|
||||||
|
hungerTimes.getFadeOutTime()));
|
||||||
|
/*
|
||||||
|
* Draw it in its standard location until it is completely transparent, then move it
|
||||||
|
* instantly.
|
||||||
|
*/
|
||||||
|
statusAlpha = (float) Math.ceil(statusAlpha);
|
||||||
return 7 * (1 - Math.max(experienceAlpha,
|
return 7 * (1 - Math.max(experienceAlpha,
|
||||||
jumpAlpha)) + 22 * (1 - hotbarAlpha);
|
jumpAlpha)) + 22 * (1 - hotbarAlpha) + 42 * (1 - statusAlpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -330,9 +330,8 @@ public class HudHook
|
|||||||
*/
|
*/
|
||||||
@Inject(method = "renderStatusBars()V", at = @At(value = "INVOKE",
|
@Inject(method = "renderStatusBars()V", at = @At(value = "INVOKE",
|
||||||
target = "Lnet" +
|
target = "Lnet" +
|
||||||
"/minecraft/util/profiler/Profiler;swap" +
|
"/minecraft/util/profiler/Profiler;swap(Ljava/lang/String;)V",
|
||||||
"(Ljava/lang/String;)V",
|
ordinal = 1, shift = At.Shift.BY, by = 3))
|
||||||
ordinal = 1))
|
|
||||||
public void renderFood(CallbackInfo callbackInfo)
|
public void renderFood(CallbackInfo callbackInfo)
|
||||||
{
|
{
|
||||||
LOGGER.debug("Rendering food");
|
LOGGER.debug("Rendering food");
|
||||||
|
|||||||
Reference in New Issue
Block a user