EAA_MOD/src/main/java/net/saltymc/eaa/custom/ping/PlayerListHudUtil.java

32 lines
1.3 KiB
Java

package net.saltymc.eaa.custom.ping;
import net.minecraft.client.gui.hud.PlayerListHud;
import net.minecraft.client.network.PlayerListEntry;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.scoreboard.ScoreboardObjective;
import net.minecraft.text.Text;
import net.saltymc.eaa.mixin.PlayerListHudAccessor;
/**
* By: https://github.com/vladmarica/better-ping-display-fabric/
*/
public class PlayerListHudUtil {
/** Calls {@link net.minecraft.client.gui.hud.PlayerListHud#renderLatencyIcon}. */
static void renderLatencyIcon(PlayerListHud hud, MatrixStack stack, int x, int offsetX, int y, PlayerListEntry player) {
((PlayerListHudAccessor) hud).invokeRenderLatencyIcon(stack, x, offsetX, y, player);
}
/** Calls {@link net.minecraft.client.gui.hud.PlayerListHud#renderScoreboardObjective} */
static void renderScoreboardObjective(PlayerListHud hud, MatrixStack stack, ScoreboardObjective obj, int i, String str, int j, int k, PlayerListEntry player) {
((PlayerListHudAccessor) hud).invokeRenderScoreboardObjective(obj, i, str, j, k, player, stack);
}
static Text getHeader(PlayerListHud hud) {
return ((PlayerListHudAccessor) hud).getHeader();
}
static Text getFooter(PlayerListHud hud) {
return ((PlayerListHudAccessor) hud).getFooter();
}
}