mirror of
https://github.com/CompeyDev/elytra-lock-fabric.git
synced 2024-12-12 12:50:42 +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 net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.render.RenderTickCounter;
|
||||
import net.minecraft.client.util.Window;
|
||||
|
@ -14,7 +15,9 @@ public class HudRenderHandler implements HudRenderCallback {
|
|||
|
||||
@Override
|
||||
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",
|
||||
"textures/gui/" + (ElytraLock.isLocked() ? "locked" : "unlocked") + ".png");
|
||||
|
||||
|
|
Loading…
Reference in a new issue