Skip to content

Commit

Permalink
Small error fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishisherewithhh committed Jun 24, 2024
1 parent 381c8a0 commit aa50760
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ public void renderElement(DrawContext drawContext, TextRenderer textRenderer) {
public void update(TickEvent.CLIENT event) {
enabledModules = ModuleManager.getEnabledModules();
enabledModules.sort((mod1, mod2) -> switch ((Sort) sort.getOption()) {
case Alphabetical -> mod1.name.compareTo(mod2.name);
case Biggest -> Double.compare(Renderer2D.getStringWidth(mod2.name), Renderer2D.getStringWidth(mod1.name));
case Smallest -> Double.compare(Renderer2D.getStringWidth(mod1.name), Renderer2D.getStringWidth(mod2.name));
case Alphabetical -> mod1.getNameWithInfo().compareTo(mod2.getNameWithInfo());
case Biggest -> Double.compare(Renderer2D.getStringWidth(mod2.getNameWithInfo()), Renderer2D.getStringWidth(mod1.getNameWithInfo()));
case Smallest -> Double.compare(Renderer2D.getStringWidth(mod1.getNameWithInfo()), Renderer2D.getStringWidth(mod2.getNameWithInfo()));
});
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/dev/heliosclient/module/Module_.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ public void onLoad() {
addSettingGroup(sgbind);
}

public String getNameWithInfo() {
return name + getInfoString();
}

/**
* Called when setting is changed.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ private boolean isDead(Entity entity){
return deadCheck.value && !entity.isAlive();
}
private boolean isEntityVisible(Entity entity){
return canSeeEntity.value && PlayerUtils.canSeeEntity(entity);
if(!canSeeEntity.value){
return true;
}

return PlayerUtils.canSeeEntity(entity);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ public void update() {
scale = Easing.ease(EasingType.CUBIC_OUT, (float) timeElapsed / 200);
}
if (timeElapsed > endDelay) {
scale = (float) MathHelper.clamp( 1.0f - Easing.ease(EasingType.CUBIC_IN, (float) (timeElapsed - endDelay) / 200),0.0,1.0f);
scale = 1.0f - Easing.ease(EasingType.CUBIC_IN, (float) (timeElapsed - endDelay) / 200);
if (scale < 0.0f) {
scale = 0.0f;
expired = true;
}
}
Expand Down

0 comments on commit aa50760

Please sign in to comment.