    001package net.minecraftforge.client.event;
    002
    003import java.util.ArrayList;
    004
    005import net.minecraft.client.gui.ScaledResolution;
    006import net.minecraftforge.event.Cancelable;
    007import net.minecraftforge.event.Event;
    008
    009@Cancelable
    010public class RenderGameOverlayEvent extends Event
    011{
    012    public static enum ElementType
    013    {
    014        ALL,
    015        HELMET,
    016        PORTAL,
    017        CROSSHAIRS,
    018        BOSSHEALTH,
    019        ARMOR,
    020        HEALTH,
    021        FOOD,
    022        AIR,
    023        HOTBAR,
    024        EXPERIENCE,
    025        TEXT
    026    }
    027
    028    public final float partialTicks;
    029    public final ScaledResolution resolution;
    030    public final int mouseX;
    031    public final int mouseY;
    032    public final ElementType type;
    033
    034    public RenderGameOverlayEvent(float partialTicks, ScaledResolution resolution, int mouseX, int mouseY)
    035    {
    036        this.partialTicks = partialTicks;
    037        this.resolution = resolution;
    038        this.mouseX = mouseX;
    039        this.mouseY = mouseY;
    040        this.type = null;
    041    }
    042
    043    private RenderGameOverlayEvent(RenderGameOverlayEvent parent, ElementType type)
    044    {
    045        this.partialTicks = parent.partialTicks;
    046        this.resolution = parent.resolution;
    047        this.mouseX = parent.mouseX;
    048        this.mouseY = parent.mouseY;
    049        this.type = type;
    050    }
    051
    052    public static class Pre extends RenderGameOverlayEvent
    053    {
    054        public Pre(RenderGameOverlayEvent parent, ElementType type)
    055        {
    056            super(parent, type);
    057        }
    058    }
    059
    060    public static class Post extends RenderGameOverlayEvent
    061    {
    062        public Post(RenderGameOverlayEvent parent, ElementType type)
    063        {
    064            super(parent, type);
    065        }
    066        @Override public boolean isCancelable(){ return false; }
    067    }
    068
    069    public static class Text extends Pre
    070    {
    071        public final ArrayList<String> left;
    072        public final ArrayList<String> right;
    073        public Text(RenderGameOverlayEvent parent, ArrayList<String> left, ArrayList<String> right)
    074        {
    075            super(parent, ElementType.TEXT);
    076            this.left = left;
    077            this.right = right;
    078        }
    079    }
    080}