2016-12-17 16:28:16 +01:00
|
|
|
package com.legacy.aether.client.gui;
|
|
|
|
|
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.client.gui.Gui;
|
|
|
|
import net.minecraft.client.gui.ScaledResolution;
|
|
|
|
import net.minecraftforge.client.event.RenderBlockOverlayEvent;
|
|
|
|
import net.minecraftforge.client.event.RenderBlockOverlayEvent.OverlayType;
|
|
|
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
|
|
|
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
|
|
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|
|
|
|
|
|
|
import com.legacy.aether.client.overlay.AetherOverlay;
|
2017-03-22 04:19:39 +01:00
|
|
|
import com.legacy.aether.common.player.PlayerAether;
|
2016-12-17 16:28:16 +01:00
|
|
|
|
|
|
|
public class GuiAetherInGame extends Gui
|
|
|
|
{
|
|
|
|
|
|
|
|
private Minecraft mc;
|
|
|
|
|
|
|
|
public GuiAetherInGame(Minecraft mc)
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
this.mc = mc;
|
|
|
|
}
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
public void onRenderBlockOverlay(RenderBlockOverlayEvent event)
|
|
|
|
{
|
|
|
|
if (this.mc.thePlayer != null)
|
|
|
|
{
|
|
|
|
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
|
|
|
|
|
|
|
|
if (player.isWearingPhoenixSet() && event.getOverlayType() == OverlayType.FIRE)
|
|
|
|
{
|
|
|
|
event.setCanceled(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@SubscribeEvent
|
|
|
|
public void onRenderGui(RenderGameOverlayEvent event)
|
|
|
|
{
|
|
|
|
if (event.isCancelable() || event.getType() != ElementType.TEXT)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
PlayerAether player = PlayerAether.get(this.mc.thePlayer);
|
|
|
|
|
|
|
|
if (player.poisonInstance() != null)
|
|
|
|
{
|
|
|
|
AetherOverlay.renderCure(this.mc);
|
|
|
|
AetherOverlay.renderPoison(this.mc);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player.thePlayer != null)
|
|
|
|
{
|
|
|
|
AetherOverlay.renderIronBubble(this.mc);
|
|
|
|
AetherOverlay.renderCooldown(this.mc);
|
|
|
|
AetherOverlay.renderJumps(this.mc);
|
|
|
|
AetherOverlay.renderBossHP(this.mc);
|
|
|
|
}
|
|
|
|
|
2017-03-02 05:26:24 +01:00
|
|
|
float portalTime = player.portalAnimTime * 1.2F + (player.prevPortalAnimTime - player.portalAnimTime);
|
2016-12-17 16:28:16 +01:00
|
|
|
|
|
|
|
if(portalTime > 0.0F)
|
|
|
|
{
|
2017-03-14 23:42:59 +01:00
|
|
|
if (portalTime > 0.0F)
|
|
|
|
{
|
|
|
|
AetherOverlay.renderAetherPortal(portalTime, new ScaledResolution(this.mc));
|
|
|
|
}
|
2016-12-17 16:28:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|