mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-17 10:24:23 +01:00
Hud needs to be reimplemented
This commit is contained in:
parent
00972d4b91
commit
989d64540e
4 changed files with 6 additions and 5 deletions
|
@ -6,6 +6,7 @@ import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
// TODO: forge events
|
// TODO: forge events
|
||||||
class ClientHooks {
|
class ClientHooks {
|
||||||
public static void beforePreRenderHud() {
|
public static void beforePreRenderHud() {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
import net.minecraft.client.gui.DrawableHelper;
|
import net.minecraft.client.gui.DrawableHelper;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
class FlightExperienceBar extends DrawableHelper implements IHudElement {
|
class FlightExperienceBar extends DrawableHelper implements HudElement {
|
||||||
|
|
||||||
static final Identifier TEXTURE = new Identifier("textures/gui/bars.png");
|
static final Identifier TEXTURE = new Identifier("textures/gui/bars.png");
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.minelittlepony.unicopia.client.gui;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
import com.minelittlepony.unicopia.entity.player.Pony;
|
||||||
|
|
||||||
public interface IHudElement {
|
public interface HudElement {
|
||||||
|
|
||||||
void repositionHud(UHud context);
|
void repositionHud(UHud context);
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class UHud {
|
||||||
|
|
||||||
public static final UHud instance = new UHud();
|
public static final UHud instance = new UHud();
|
||||||
|
|
||||||
private List<IHudElement> elements = new ArrayList<>();
|
private List<HudElement> elements = new ArrayList<>();
|
||||||
|
|
||||||
MinecraftClient mc = MinecraftClient.getInstance();
|
MinecraftClient mc = MinecraftClient.getInstance();
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public class UHud {
|
||||||
elements.forEach(this::positionElement);
|
elements.forEach(this::positionElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void positionElement(IHudElement element) {
|
private void positionElement(HudElement element) {
|
||||||
if (!element.shouldRender(player)) {
|
if (!element.shouldRender(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public class UHud {
|
||||||
element.repositionHud(this);
|
element.repositionHud(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderElement(IHudElement element) {
|
private void renderElement(HudElement element) {
|
||||||
if (!element.shouldRender(player)) {
|
if (!element.shouldRender(player)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue