Compare commits
4 Commits
1.14-forge
...
v1.1-1.15-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bbb03736d | ||
|
|
c5c62a0675 | ||
|
|
a357b924d8 | ||
|
|
3c2e6baa0c |
@@ -10,6 +10,6 @@ forge_version=29.0.4
|
|||||||
|
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0
|
mod_version = 1.1
|
||||||
maven_group = markil3
|
maven_group = markil3
|
||||||
archives_base_name = immersive_hud
|
archives_base_name = immersive_hud
|
||||||
@@ -155,7 +155,9 @@ public class ConfigManager
|
|||||||
private final TimeValues hungerTime;
|
private final TimeValues hungerTime;
|
||||||
private final TimeValues effectTime;
|
private final TimeValues effectTime;
|
||||||
private final ForgeConfigSpec.IntValue crosshairTime;
|
private final ForgeConfigSpec.IntValue crosshairTime;
|
||||||
|
private final ForgeConfigSpec.BooleanValue hideCrosshair;
|
||||||
private final ForgeConfigSpec.IntValue handTime;
|
private final ForgeConfigSpec.IntValue handTime;
|
||||||
|
private final ForgeConfigSpec.BooleanValue hideHands;
|
||||||
private final ForgeConfigSpec.BooleanValue showArmor;
|
private final ForgeConfigSpec.BooleanValue showArmor;
|
||||||
private final ForgeConfigSpec.DoubleValue minHealth;
|
private final ForgeConfigSpec.DoubleValue minHealth;
|
||||||
private final ForgeConfigSpec.IntValue minHunger;
|
private final ForgeConfigSpec.IntValue minHunger;
|
||||||
@@ -182,6 +184,10 @@ public class ConfigManager
|
|||||||
6 * TICKS_PER_SECOND,
|
6 * TICKS_PER_SECOND,
|
||||||
0,
|
0,
|
||||||
10 * 60 * TICKS_PER_SECOND);
|
10 * 60 * TICKS_PER_SECOND);
|
||||||
|
this.hideCrosshair =
|
||||||
|
configSpecBuilder.translation(
|
||||||
|
"immersive_hud.configGui.hideCrosshair.title")
|
||||||
|
.define("hideCrosshair", true);
|
||||||
this.handTime =
|
this.handTime =
|
||||||
configSpecBuilder.translation(
|
configSpecBuilder.translation(
|
||||||
"immersive_hud.configGui.handTime.title")
|
"immersive_hud.configGui.handTime.title")
|
||||||
@@ -189,6 +195,10 @@ public class ConfigManager
|
|||||||
30 * TICKS_PER_SECOND,
|
30 * TICKS_PER_SECOND,
|
||||||
0,
|
0,
|
||||||
10 * 60 * TICKS_PER_SECOND);
|
10 * 60 * TICKS_PER_SECOND);
|
||||||
|
this.hideHands =
|
||||||
|
configSpecBuilder.translation(
|
||||||
|
"immersive_hud.configGui.hideHands.title")
|
||||||
|
.define("hideHands", true);
|
||||||
this.showArmor = configSpecBuilder.translation(
|
this.showArmor = configSpecBuilder.translation(
|
||||||
"immersive_hud.configGui.showArmor.title")
|
"immersive_hud.configGui.showArmor.title")
|
||||||
.define("showArmor", true);
|
.define("showArmor", true);
|
||||||
@@ -282,6 +292,16 @@ public class ConfigManager
|
|||||||
return this.crosshairTime.get();
|
return this.crosshairTime.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the crosshairs should be hidden after a period of time.
|
||||||
|
*
|
||||||
|
* @return - Whether or not crosshairs will be hidden.
|
||||||
|
*/
|
||||||
|
public boolean hideCrosshair()
|
||||||
|
{
|
||||||
|
return this.hideCrosshair.get();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Obtains the time that the hands are allowed to display.
|
* Obtains the time that the hands are allowed to display.
|
||||||
*
|
*
|
||||||
@@ -292,6 +312,16 @@ public class ConfigManager
|
|||||||
return this.handTime.get();
|
return this.handTime.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether hands should be hidden after a period of time.
|
||||||
|
*
|
||||||
|
* @return - Whether or not hands will be hidden.
|
||||||
|
*/
|
||||||
|
public boolean hideHands()
|
||||||
|
{
|
||||||
|
return this.hideHands.get();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the armor bar should render.
|
* Checks whether the armor bar should render.
|
||||||
*
|
*
|
||||||
@@ -334,6 +364,16 @@ public class ConfigManager
|
|||||||
this.crosshairTime.set(time);
|
this.crosshairTime.set(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether the crosshairs should be hidden after a period of time.
|
||||||
|
*
|
||||||
|
* @param hide - Whether or not crosshairs will be hidden.
|
||||||
|
*/
|
||||||
|
public void hideCrosshair(boolean hide)
|
||||||
|
{
|
||||||
|
this.hideCrosshair.set(hide);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the time that the hands are allowed to display.
|
* Sets the time that the hands are allowed to display.
|
||||||
*
|
*
|
||||||
@@ -344,6 +384,16 @@ public class ConfigManager
|
|||||||
this.handTime.set(time);
|
this.handTime.set(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether hands should be hidden after a period of time.
|
||||||
|
*
|
||||||
|
* @param hide - Whether or not hands will be hidden.
|
||||||
|
*/
|
||||||
|
public void hideHands(boolean hide)
|
||||||
|
{
|
||||||
|
this.hideHands.set(hide);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines whether the armor bar should render.
|
* Determines whether the armor bar should render.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import net.minecraft.item.Item;
|
|||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
import net.minecraftforge.client.event.RenderHandEvent;
|
|
||||||
import net.minecraftforge.client.event.RenderSpecificHandEvent;
|
import net.minecraftforge.client.event.RenderSpecificHandEvent;
|
||||||
import net.minecraftforge.event.entity.EntityMountEvent;
|
import net.minecraftforge.event.entity.EntityMountEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
@@ -62,14 +61,24 @@ public class EventBus
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onClick(final PlayerInteractEvent event)
|
public static void onClick(final PlayerInteractEvent event)
|
||||||
{
|
{
|
||||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () ->
|
try
|
||||||
{
|
{
|
||||||
Item item =
|
DistExecutor.runWhenOn(Dist.CLIENT, () -> () ->
|
||||||
Optional.ofNullable(event.getItemStack())
|
{
|
||||||
.map(ItemStack::getItem)
|
Item item =
|
||||||
.orElse(null);
|
Optional.ofNullable(event.getItemStack())
|
||||||
TimerUtils.onClick(event.getHand(), item);
|
.map(ItemStack::getItem)
|
||||||
});
|
.orElse(null);
|
||||||
|
TimerUtils.onClick(event.getHand(), item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.error(
|
||||||
|
"Error in running markil3.immersive_hud.EventBus#onClick " +
|
||||||
|
"event",
|
||||||
|
e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,10 +93,20 @@ public class EventBus
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onMount(final EntityMountEvent event)
|
public static void onMount(final EntityMountEvent event)
|
||||||
{
|
{
|
||||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () ->
|
try
|
||||||
{
|
{
|
||||||
TimerUtils.resetMountHealth();
|
DistExecutor.runWhenOn(Dist.CLIENT, () -> () ->
|
||||||
});
|
{
|
||||||
|
TimerUtils.resetMountHealth();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.error(
|
||||||
|
"Error in running markil3.immersive_hud.EventBus#onMount " +
|
||||||
|
"event",
|
||||||
|
e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -99,11 +118,21 @@ public class EventBus
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onRenderHand(final RenderSpecificHandEvent event)
|
public static void onRenderHand(final RenderSpecificHandEvent event)
|
||||||
{
|
{
|
||||||
if (TimerUtils.onRenderHand(event.getHand(),
|
try
|
||||||
event.getMatrixStack(),
|
|
||||||
event.getPartialTicks()))
|
|
||||||
{
|
{
|
||||||
event.setCanceled(true);
|
if (TimerUtils.onRenderHand(event.getHand(),
|
||||||
|
event.getMatrixStack(),
|
||||||
|
event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
LOGGER.error(
|
||||||
|
"Error in running markil3.immersive_hud" +
|
||||||
|
".EventBus#onRenderHand event",
|
||||||
|
e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,153 +145,162 @@ public class EventBus
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public static void onGUIDraw(final RenderGameOverlayEvent event)
|
public static void onGUIDraw(final RenderGameOverlayEvent event)
|
||||||
{
|
{
|
||||||
Minecraft mc = Minecraft.getInstance();
|
try
|
||||||
boolean fadeIn = false;
|
|
||||||
|
|
||||||
switch (event.getType())
|
|
||||||
{
|
{
|
||||||
case CROSSHAIRS:
|
Minecraft mc = Minecraft.getInstance();
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
boolean fadeIn = false;
|
||||||
|
|
||||||
|
switch (event.getType())
|
||||||
{
|
{
|
||||||
if (TimerUtils.drawCrosshair(event.getPartialTicks()))
|
case CROSSHAIRS:
|
||||||
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
|
{
|
||||||
|
if (TimerUtils.drawCrosshair(event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Reset the transparency.
|
||||||
|
*/
|
||||||
|
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||||
|
{
|
||||||
|
resetAlpha();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case POTION_ICONS:
|
||||||
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
|
{
|
||||||
|
TimerUtils.updatePotions(mc.player);
|
||||||
|
event.setCanceled(true);
|
||||||
|
RenderUtils.renderPotionIcons(mc,
|
||||||
|
mc.ingameGUI, event.getPartialTicks());
|
||||||
|
resetAlpha();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case HOTBAR:
|
||||||
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
{
|
{
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
|
if (!TimerUtils.drawHotbar(event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
RenderUtils.renderHotbar(mc, mc.ingameGUI,
|
||||||
|
event.getPartialTicks(), TimerUtils.hotbarTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
/*
|
case HEALTH:
|
||||||
* Reset the transparency.
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
*/
|
|
||||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
|
||||||
{
|
|
||||||
resetAlpha();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case POTION_ICONS:
|
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
|
||||||
{
|
|
||||||
TimerUtils.updatePotions(mc.player);
|
|
||||||
event.setCanceled(true);
|
|
||||||
RenderUtils.renderPotionIcons(mc,
|
|
||||||
mc.ingameGUI, event.getPartialTicks());
|
|
||||||
resetAlpha();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HOTBAR:
|
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
|
||||||
{
|
|
||||||
event.setCanceled(true);
|
|
||||||
if (!TimerUtils.drawHotbar(event.getPartialTicks()))
|
|
||||||
{
|
{
|
||||||
RenderUtils.renderHotbar(mc, mc.ingameGUI,
|
if (TimerUtils.drawHealth(event.getPartialTicks()))
|
||||||
event.getPartialTicks(), TimerUtils.hotbarTime);
|
{
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||||
break;
|
{
|
||||||
case HEALTH:
|
RenderSystem.popMatrix();
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
resetAlpha();
|
||||||
{
|
}
|
||||||
if (TimerUtils.drawHealth(event.getPartialTicks()))
|
break;
|
||||||
|
case FOOD:
|
||||||
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
|
{
|
||||||
|
if (TimerUtils.drawHunger(event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Reset the transparency.
|
||||||
|
*/
|
||||||
|
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||||
|
{
|
||||||
|
RenderSystem.popMatrix();
|
||||||
|
resetAlpha();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ARMOR:
|
||||||
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
|
{
|
||||||
|
if (TimerUtils.drawArmor(event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Reset the transparency.
|
||||||
|
*/
|
||||||
|
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||||
|
{
|
||||||
|
RenderSystem.popMatrix();
|
||||||
|
resetAlpha();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case AIR:
|
||||||
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
|
{
|
||||||
|
if (TimerUtils.drawAir(event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Reset the transparency.
|
||||||
|
*/
|
||||||
|
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||||
|
{
|
||||||
|
RenderSystem.popMatrix();
|
||||||
|
resetAlpha();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case HEALTHMOUNT:
|
||||||
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
|
{
|
||||||
|
if (TimerUtils.drawMountHealth(event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event instanceof RenderGameOverlayEvent.Post)
|
||||||
|
{
|
||||||
|
RenderSystem.popMatrix();
|
||||||
|
resetAlpha();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case JUMPBAR:
|
||||||
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
{
|
{
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
|
if (!TimerUtils.drawJumpbar(event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
RenderUtils.renderHorseJumpBar(mc,
|
||||||
|
mc.ingameGUI,
|
||||||
|
event.getPartialTicks(),
|
||||||
|
TimerUtils.jumpTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
case EXPERIENCE:
|
||||||
{
|
if (event instanceof RenderGameOverlayEvent.Pre)
|
||||||
RenderSystem.popMatrix();
|
|
||||||
resetAlpha();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case FOOD:
|
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
|
||||||
{
|
|
||||||
if (TimerUtils.drawHunger(event.getPartialTicks()))
|
|
||||||
{
|
{
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
|
if (!TimerUtils.drawExperience(event.getPartialTicks()))
|
||||||
|
{
|
||||||
|
RenderUtils.renderExperience(mc,
|
||||||
|
mc.ingameGUI,
|
||||||
|
event.getPartialTicks(),
|
||||||
|
TimerUtils.experienceTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
/*
|
}
|
||||||
* Reset the transparency.
|
catch (Exception e)
|
||||||
*/
|
{
|
||||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
LOGGER.error(
|
||||||
{
|
"Error in running markil3.immersive_hud.EventBus#onGUIDraw event",
|
||||||
RenderSystem.popMatrix();
|
e);
|
||||||
resetAlpha();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ARMOR:
|
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
|
||||||
{
|
|
||||||
if (TimerUtils.drawArmor(event.getPartialTicks()))
|
|
||||||
{
|
|
||||||
event.setCanceled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Reset the transparency.
|
|
||||||
*/
|
|
||||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
|
||||||
{
|
|
||||||
RenderSystem.popMatrix();
|
|
||||||
resetAlpha();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case AIR:
|
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
|
||||||
{
|
|
||||||
if (TimerUtils.drawAir(event.getPartialTicks()))
|
|
||||||
{
|
|
||||||
event.setCanceled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Reset the transparency.
|
|
||||||
*/
|
|
||||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
|
||||||
{
|
|
||||||
RenderSystem.popMatrix();
|
|
||||||
resetAlpha();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case HEALTHMOUNT:
|
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
|
||||||
{
|
|
||||||
if (TimerUtils.drawMountHealth(event.getPartialTicks()))
|
|
||||||
{
|
|
||||||
event.setCanceled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (event instanceof RenderGameOverlayEvent.Post)
|
|
||||||
{
|
|
||||||
RenderSystem.popMatrix();
|
|
||||||
resetAlpha();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case JUMPBAR:
|
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
|
||||||
{
|
|
||||||
event.setCanceled(true);
|
|
||||||
if (!TimerUtils.drawJumpbar(event.getPartialTicks()))
|
|
||||||
{
|
|
||||||
RenderUtils.renderHorseJumpBar(mc,
|
|
||||||
mc.ingameGUI,
|
|
||||||
event.getPartialTicks(),
|
|
||||||
TimerUtils.jumpTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EXPERIENCE:
|
|
||||||
if (event instanceof RenderGameOverlayEvent.Pre)
|
|
||||||
{
|
|
||||||
event.setCanceled(true);
|
|
||||||
if (!TimerUtils.drawExperience(event.getPartialTicks()))
|
|
||||||
{
|
|
||||||
RenderUtils.renderExperience(mc,
|
|
||||||
mc.ingameGUI,
|
|
||||||
event.getPartialTicks(),
|
|
||||||
TimerUtils.experienceTime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import net.minecraft.potion.Effect;
|
|||||||
import net.minecraft.potion.EffectInstance;
|
import net.minecraft.potion.EffectInstance;
|
||||||
import net.minecraft.potion.Effects;
|
import net.minecraft.potion.Effects;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.Util;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
|
|
||||||
@@ -270,11 +269,11 @@ public class TimerUtils
|
|||||||
if (item.isFood())
|
if (item.isFood())
|
||||||
{
|
{
|
||||||
healthTime = health.getMaxTime() - (healthTime > 0 ?
|
healthTime = health.getMaxTime() - (healthTime > 0 ?
|
||||||
health.getFadeInTime() :
|
health.getFadeInTime() :
|
||||||
0);
|
0);
|
||||||
hungerTime = hunger.getMaxTime() - (hungerTime > 0 ?
|
hungerTime = hunger.getMaxTime() - (hungerTime > 0 ?
|
||||||
hunger.getFadeInTime() :
|
hunger.getFadeInTime() :
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,57 +296,62 @@ public class TimerUtils
|
|||||||
{
|
{
|
||||||
float HAND_UP_TIME = 20F;
|
float HAND_UP_TIME = 20F;
|
||||||
|
|
||||||
switch (hand)
|
boolean hideHands =
|
||||||
|
ConfigManager.getInstance().hideHands();
|
||||||
|
if (hideHands)
|
||||||
{
|
{
|
||||||
case OFF_HAND:
|
switch (hand)
|
||||||
if (mainHandTime > 0 && mainHandTime < HAND_UP_TIME)
|
|
||||||
{
|
{
|
||||||
/*
|
case OFF_HAND:
|
||||||
* Undo the transformation of the previous hand
|
if (mainHandTime > 0 && mainHandTime < HAND_UP_TIME)
|
||||||
*/
|
|
||||||
matrixStack.func_227862_a_(0,
|
|
||||||
(float) (1.0F * (HAND_UP_TIME - mainHandTime) / HAND_UP_TIME),
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
if (offHandTime == 0 && !offHandLock)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (!offHandLock && (mapLock & 0b01) == 0)
|
|
||||||
{
|
|
||||||
if (offHandTime > 0)
|
|
||||||
{
|
{
|
||||||
offHandTime -= ticks;
|
/*
|
||||||
|
* Undo the transformation of the previous hand
|
||||||
|
*/
|
||||||
|
matrixStack.func_227862_a_(0,
|
||||||
|
(float) (1.0F * (HAND_UP_TIME - mainHandTime) / HAND_UP_TIME),
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
if (offHandTime < HAND_UP_TIME)
|
if (offHandTime == 0 && !offHandLock)
|
||||||
{
|
{
|
||||||
matrixStack
|
return true;
|
||||||
.func_227862_a_(0,
|
|
||||||
(float) (-1.0F * (HAND_UP_TIME - offHandTime) / HAND_UP_TIME),
|
|
||||||
0);
|
|
||||||
}
|
}
|
||||||
}
|
else if (!offHandLock && (mapLock & 0b01) == 0)
|
||||||
break;
|
|
||||||
case MAIN_HAND:
|
|
||||||
if (mainHandTime == 0 && !mainHandLock)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (!mainHandLock && (mapLock & 0b10) == 0)
|
|
||||||
{
|
|
||||||
if (mainHandTime > 0)
|
|
||||||
{
|
{
|
||||||
mainHandTime -= ticks;
|
if (offHandTime > 0)
|
||||||
|
{
|
||||||
|
offHandTime -= ticks;
|
||||||
|
}
|
||||||
|
if (offHandTime < HAND_UP_TIME)
|
||||||
|
{
|
||||||
|
matrixStack
|
||||||
|
.func_227862_a_(0,
|
||||||
|
(float) (-1.0F * (HAND_UP_TIME - offHandTime) / HAND_UP_TIME),
|
||||||
|
0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mainHandTime < HAND_UP_TIME)
|
break;
|
||||||
|
case MAIN_HAND:
|
||||||
|
if (mainHandTime == 0 && !mainHandLock)
|
||||||
{
|
{
|
||||||
matrixStack
|
return true;
|
||||||
.func_227861_a_(0,
|
|
||||||
(float) (-1.0F * (HAND_UP_TIME - mainHandTime) / HAND_UP_TIME),
|
|
||||||
0);
|
|
||||||
}
|
}
|
||||||
|
else if (!mainHandLock && (mapLock & 0b10) == 0)
|
||||||
|
{
|
||||||
|
if (mainHandTime > 0)
|
||||||
|
{
|
||||||
|
mainHandTime -= ticks;
|
||||||
|
}
|
||||||
|
if (mainHandTime < HAND_UP_TIME)
|
||||||
|
{
|
||||||
|
matrixStack
|
||||||
|
.func_227861_a_(0,
|
||||||
|
(float) (-1.0F * (HAND_UP_TIME - mainHandTime) / HAND_UP_TIME),
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -360,8 +364,8 @@ public class TimerUtils
|
|||||||
ConfigManager.TimeValues health =
|
ConfigManager.TimeValues health =
|
||||||
ConfigManager.getInstance().getHealthTime();
|
ConfigManager.getInstance().getHealthTime();
|
||||||
mountTime = health.getMaxTime() - (mountTime > 0 ?
|
mountTime = health.getMaxTime() - (mountTime > 0 ?
|
||||||
health.getFadeInTime() :
|
health.getFadeInTime() :
|
||||||
0);
|
0);
|
||||||
jumpTime = 0;
|
jumpTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,34 +387,39 @@ public class TimerUtils
|
|||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
boolean canceled = false;
|
boolean canceled = false;
|
||||||
|
|
||||||
if (mc.objectMouseOver != null && mc.objectMouseOver.getType() != RayTraceResult.Type.MISS)
|
boolean hideCrosshair =
|
||||||
|
ConfigManager.getInstance().hideCrosshair();
|
||||||
|
if (hideCrosshair)
|
||||||
{
|
{
|
||||||
if (mc.objectMouseOver.getType() == RayTraceResult.Type.ENTITY)
|
if (mc.objectMouseOver != null && mc.objectMouseOver.getType() != RayTraceResult.Type.MISS)
|
||||||
{
|
{
|
||||||
if (mc.objectMouseOver.hitInfo == null || mc.objectMouseOver.hitInfo != mc.player
|
if (mc.objectMouseOver.getType() == RayTraceResult.Type.ENTITY)
|
||||||
.getRidingEntity())
|
{
|
||||||
|
if (mc.objectMouseOver.hitInfo == null || mc.objectMouseOver.hitInfo != mc.player
|
||||||
|
.getRidingEntity())
|
||||||
|
{
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (changed || mainHandLock || offHandLock || crosshairTime > 0)
|
||||||
|
{
|
||||||
|
setAlpha(Main.getAlpha(crosshairTime > 0 ?
|
||||||
|
crosshairTime :
|
||||||
|
CROSSHAIR_TIME, CROSSHAIR_TIME, 0, 0));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
changed = true;
|
canceled = true;
|
||||||
|
}
|
||||||
|
if (crosshairTime > 0)
|
||||||
|
{
|
||||||
|
crosshairTime -= ticks;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (changed || mainHandLock || offHandLock || crosshairTime > 0)
|
|
||||||
{
|
|
||||||
setAlpha(Main.getAlpha(crosshairTime > 0 ?
|
|
||||||
crosshairTime :
|
|
||||||
CROSSHAIR_TIME, CROSSHAIR_TIME, 0, 0));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
canceled = true;
|
|
||||||
}
|
|
||||||
if (crosshairTime > 0)
|
|
||||||
{
|
|
||||||
crosshairTime -= ticks;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return canceled;
|
return canceled;
|
||||||
@@ -474,7 +483,8 @@ public class TimerUtils
|
|||||||
}
|
}
|
||||||
else if (effectinstance.getDuration() <= BLINK_TIME + potion.getFadeInTime())
|
else if (effectinstance.getDuration() <= BLINK_TIME + potion.getFadeInTime())
|
||||||
{
|
{
|
||||||
effectAlpha = -(effectinstance.getDuration() - BLINK_TIME) / 22F + 0.454F;
|
effectAlpha =
|
||||||
|
-(effectinstance.getDuration() - BLINK_TIME) / 22F + 0.454F;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -645,11 +655,11 @@ public class TimerUtils
|
|||||||
if (item.isFood())
|
if (item.isFood())
|
||||||
{
|
{
|
||||||
healthTime = health.getMaxTime() - (healthTime > 0 ?
|
healthTime = health.getMaxTime() - (healthTime > 0 ?
|
||||||
health.getFadeInTime() :
|
health.getFadeInTime() :
|
||||||
0);
|
0);
|
||||||
hungerTime = hunger.getMaxTime() - (hungerTime > 0 ?
|
hungerTime = hunger.getMaxTime() - (hungerTime > 0 ?
|
||||||
hunger.getFadeInTime() :
|
hunger.getFadeInTime() :
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
{
|
{
|
||||||
@@ -757,7 +767,8 @@ public class TimerUtils
|
|||||||
* Only makes a change if the player is healthy. Otherwise,
|
* Only makes a change if the player is healthy. Otherwise,
|
||||||
* the bar is shown.
|
* the bar is shown.
|
||||||
*/
|
*/
|
||||||
if (health / maxHealth > HEALTH_BOUNDARY && !mc.player.isPotionActive(Effects.WITHER) && !mc.player.isPotionActive(Effects.POISON))
|
if (health / maxHealth > HEALTH_BOUNDARY && !mc.player.isPotionActive(
|
||||||
|
Effects.WITHER) && !mc.player.isPotionActive(Effects.POISON))
|
||||||
{
|
{
|
||||||
if (healthTime > 0)
|
if (healthTime > 0)
|
||||||
{
|
{
|
||||||
@@ -816,8 +827,8 @@ public class TimerUtils
|
|||||||
if (changed || hunger <= HUNGER_BOUNDARY)
|
if (changed || hunger <= HUNGER_BOUNDARY)
|
||||||
{
|
{
|
||||||
hungerTime = hungerTimes.getMaxTime() - (hungerTime > 0 ?
|
hungerTime = hungerTimes.getMaxTime() - (hungerTime > 0 ?
|
||||||
hungerTimes.getFadeInTime() :
|
hungerTimes.getFadeInTime() :
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
else if (hungerTime > 0)
|
else if (hungerTime > 0)
|
||||||
{
|
{
|
||||||
@@ -926,7 +937,7 @@ public class TimerUtils
|
|||||||
Entity tmp = mc.player.getRidingEntity();
|
Entity tmp = mc.player.getRidingEntity();
|
||||||
boolean changed = false;
|
boolean changed = false;
|
||||||
|
|
||||||
if (tmp == null)
|
if (tmp == null || !(tmp instanceof LivingEntity))
|
||||||
{
|
{
|
||||||
mountHealth = -1;
|
mountHealth = -1;
|
||||||
mountMaxHealth = -1;
|
mountMaxHealth = -1;
|
||||||
|
|||||||
@@ -19,7 +19,9 @@
|
|||||||
"option.immersive_hud.effectFadeIn": "Potion Fade In Time",
|
"option.immersive_hud.effectFadeIn": "Potion Fade In Time",
|
||||||
"option.immersive_hud.effectFadeOut": "Potion Fade Out Time",
|
"option.immersive_hud.effectFadeOut": "Potion Fade Out Time",
|
||||||
"option.immersive_hud.crosshairTime": "Crosshair Display Time",
|
"option.immersive_hud.crosshairTime": "Crosshair Display Time",
|
||||||
|
"option.immersive_hud.hideCrosshair": "Hide Crosshair",
|
||||||
"option.immersive_hud.handTime": "Hand Display Time",
|
"option.immersive_hud.handTime": "Hand Display Time",
|
||||||
|
"option.immersive_hud.hideHands": "Hide Hands",
|
||||||
"option.immersive_hud.minHealth": "Minimum Health Fade",
|
"option.immersive_hud.minHealth": "Minimum Health Fade",
|
||||||
"option.immersive_hud.minHunger": "Minimum Hunger Fade",
|
"option.immersive_hud.minHunger": "Minimum Hunger Fade",
|
||||||
"option.immersive_hud.showArmor": "Show Armor",
|
"option.immersive_hud.showArmor": "Show Armor",
|
||||||
@@ -42,7 +44,9 @@
|
|||||||
"tooltip.immersive_hud.effectFadeIn": "How many seconds it takes for potion icons to fade in",
|
"tooltip.immersive_hud.effectFadeIn": "How many seconds it takes for potion icons to fade in",
|
||||||
"tooltip.immersive_hud.effectFadeOut": "How many seconds it takes for potion icons to fade out",
|
"tooltip.immersive_hud.effectFadeOut": "How many seconds it takes for potion icons to fade out",
|
||||||
"tooltip.immersive_hud.crosshairTime": "How many seconds the crosshairs can be on screen",
|
"tooltip.immersive_hud.crosshairTime": "How many seconds the crosshairs can be on screen",
|
||||||
|
"tooltip.immersive_hud.hideCrosshair": "Whether or not the crosshairs should be hidden after a period of time",
|
||||||
"tooltip.immersive_hud.handTime": "How many seconds the hands can be on screen",
|
"tooltip.immersive_hud.handTime": "How many seconds the hands can be on screen",
|
||||||
|
"tooltip.immersive_hud.hideHands": "Whether or not hands should be hidden after a period of time",
|
||||||
"tooltip.immersive_hud.minHealth": "When the percentage of health goes below this level, the health bar won't fade away",
|
"tooltip.immersive_hud.minHealth": "When the percentage of health goes below this level, the health bar won't fade away",
|
||||||
"tooltip.immersive_hud.minHunger": "When the hunger level goes below this level, the hunger bar won't fade away",
|
"tooltip.immersive_hud.minHunger": "When the hunger level goes below this level, the hunger bar won't fade away",
|
||||||
"tooltip.immersive_hud.showArmor": "Whether or not the armor bar should display on the HUD"
|
"tooltip.immersive_hud.showArmor": "Whether or not the armor bar should display on the HUD"
|
||||||
|
|||||||
Reference in New Issue
Block a user