mirror of
https://github.com/CompeyDev/elytra-lock-fabric.git
synced 2025-01-05 18:59:09 +00:00
feat: don't display hud indicator if hud is disabled
This commit is contained in:
parent
65c15952fa
commit
0a9d2105ef
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,7 @@ package xyz.devcomp.elytralock.events;
|
||||||
import xyz.devcomp.elytralock.ElytraLock;
|
import xyz.devcomp.elytralock.ElytraLock;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||||
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
import net.minecraft.client.render.RenderTickCounter;
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
import net.minecraft.client.util.Window;
|
import net.minecraft.client.util.Window;
|
||||||
|
@ -14,7 +15,9 @@ public class HudRenderHandler implements HudRenderCallback {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHudRender(DrawContext context, RenderTickCounter tickCounter) {
|
public void onHudRender(DrawContext context, RenderTickCounter tickCounter) {
|
||||||
// FIXME: Perhaps don't check whether the elytra is locked on every frame
|
if (!MinecraftClient.isHudEnabled())
|
||||||
|
return;
|
||||||
|
|
||||||
Identifier icon = Identifier.of("elytra-lock",
|
Identifier icon = Identifier.of("elytra-lock",
|
||||||
"textures/gui/" + (ElytraLock.isLocked() ? "locked" : "unlocked") + ".png");
|
"textures/gui/" + (ElytraLock.isLocked() ? "locked" : "unlocked") + ".png");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue