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 @@ -41,6 +41,10 @@ public static void renderInWorld(MatrixStack matrix, LivingEntity entity, Camera
if (Mode.WHEN_HOLDING_WEAPON.equals(getConfig().mode) && !ToroHealth.IS_HOLDING_WEAPON) {
return;
}

if(getConfig().hideArmorStands && entity instanceof ArmorStandEntity) {
return;
}
MinecraftClient client = MinecraftClient.getInstance();

float scaleToGui = 0.025f;
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/torocraft/torohealth/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static class Hud {
public boolean showEntity = true;
public boolean showBar = true;
public boolean showSkin = true;
public boolean hideArmorStands = false;
}

public static class Particle {
Expand All @@ -49,6 +50,7 @@ public static class Bar {

public static class InWorld {
public Mode mode = Mode.NONE;
public boolean hideArmorStands = true;
public float distance = 60f;
}

Expand Down
13 changes: 9 additions & 4 deletions src/main/java/net/torocraft/torohealth/display/Hud.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,22 @@ public void tick() {
}

public void setEntity(LivingEntity entity) {
if(ToroHealth.CONFIG.hud.hideArmorStands && entity instanceof ArmorStandEntity) {
if(age > ToroHealth.CONFIG.hud.hideDelay)
setEntityWork(null);
return;
}

if (entity != null) {
age = 0;
if (entity != this.entity) {
setEntityWork(entity);
}
}

if (entity == null && age > ToroHealth.CONFIG.hud.hideDelay) {
setEntityWork(null);
}

if (entity != null && entity != this.entity) {
setEntityWork(entity);
}
}

private void setEntityWork(LivingEntity entity) {
Expand Down