Skip to content

Commit

Permalink
entry width fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ImToggle committed May 6, 2024
1 parent c2af47b commit 3e82b0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/main/java/org/polyfrost/vanillahud/hud/TabList.java
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,21 @@ public TabHud() {
public static OneColor pingLevelSix = new OneColor("AA0000FF");

@Color(
name = "Tab Widget Color"
name = "Tab Widget Color", size = 2
)
public static OneColor tabWidgetColor = new OneColor(553648127);

@Info(
text = "Might causes tablist go over screen",
type = InfoType.WARNING
)
private static Runnable info = () -> { }; //runnable so it wont be saved

@Switch(
name = "Fix TabList Entry Width"
)
public static boolean fixWidth = false;

public static int getTabPlayerLimit() {
return MathHelper.clamp_int(tabPlayerLimit, 10, 120);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ private List<NetworkPlayerInfo> setLimit(List<NetworkPlayerInfo> value) {

@Redirect(method = "renderPlayerlist", at = @At(value = "INVOKE", target = "Ljava/lang/Math;min(II)I", ordinal = 1))
private int noLimit(int a, int b) {
if (VanillaHUD.inSBASkyblock()) return a;
if (VanillaHUD.inSBASkyblock() || !TabList.TabHud.fixWidth) return Math.min(a, b);
return a;
}
}

0 comments on commit 3e82b0e

Please sign in to comment.