GuiRenderTickMixin:
- Added additional check to player state. - Cleaned up the player state string when displaying.
This commit is contained in:
@ -30,15 +30,16 @@ public class GuiRenderTickMixin {
|
|||||||
poseStack.pushPose();
|
poseStack.pushPose();
|
||||||
poseStack.scale(5, 5, 5);
|
poseStack.scale(5, 5, 5);
|
||||||
|
|
||||||
|
// Check if we should draw the state
|
||||||
|
if (Proxy.Client.getPlayerState() != null && !Proxy.Client.getPlayerState().equals(ProtectedPlayer.State.ACTIVE)) {
|
||||||
// Initialize variables
|
// Initialize variables
|
||||||
Font font = Minecraft.getInstance().font;
|
Font font = Minecraft.getInstance().font;
|
||||||
float offsetX = -(font.width(Proxy.Client.getPlayerState().toString()) / 2f);
|
float offsetX = -(font.width(Proxy.Client.getPlayerState().toString()) / 2f);
|
||||||
float offsetY = -((font.lineHeight / 2f) + ((Minecraft.getInstance().getWindow().getGuiScaledHeight() / 4f) / 5));
|
float offsetY = -((font.lineHeight / 2f) + ((Minecraft.getInstance().getWindow().getGuiScaledHeight() / 4f) / 5));
|
||||||
int argb = 0xFFFFFFFF;
|
int argb = 0xFFFFFFFF;
|
||||||
|
|
||||||
// Draw player state if it's not active
|
// Draw the player's protection state
|
||||||
if (!Proxy.Client.getPlayerState().equals(ProtectedPlayer.State.ACTIVE)) {
|
font.drawShadow(poseStack, Proxy.Client.getPlayerState().toString().replace("_", " "), offsetX, offsetY, argb);
|
||||||
font.drawShadow(poseStack, Proxy.Client.getPlayerState().toString(), offsetX, offsetY, argb);
|
|
||||||
}
|
}
|
||||||
poseStack.popPose();
|
poseStack.popPose();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user