-
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4f9bc4
commit 69e1ea8
Showing
8 changed files
with
90 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/PlayerListWidget.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package de.hysky.skyblocker.skyblock.tabhud.widget; | ||
|
||
import de.hysky.skyblocker.annotations.RegisterWidget; | ||
import de.hysky.skyblocker.skyblock.tabhud.widget.component.PlainTextComponent; | ||
import de.hysky.skyblocker.skyblock.tabhud.widget.component.PlayerComponent; | ||
import net.minecraft.client.network.PlayerListEntry; | ||
import net.minecraft.text.MutableText; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Formatting; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
@RegisterWidget | ||
public class PlayerListWidget extends TabHudWidget { | ||
private static final MutableText TITLE = Text.literal("Players").formatted(Formatting.BOLD); | ||
|
||
public PlayerListWidget() { | ||
super("Players", TITLE, Formatting.AQUA.getColorValue()); | ||
} | ||
|
||
@Override | ||
protected void updateContent(List<Text> lines, @Nullable List<PlayerListEntry> playerListEntries) { | ||
if (playerListEntries == null) { | ||
lines.forEach(text -> addComponent(new PlainTextComponent(text))); | ||
} else { | ||
playerListEntries.forEach(playerListEntry -> addComponent(new PlayerComponent(playerListEntry))); | ||
} | ||
} | ||
|
||
@Override | ||
protected void updateContent(List<Text> lines) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters