Formatting!

This commit is contained in:
WayofTime 2016-06-23 21:43:27 -04:00
parent d240daf958
commit 8c4eff0d81
30 changed files with 301 additions and 225 deletions

View file

@ -12,7 +12,8 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
@Getter
@Setter
public abstract class HUDElement {
public abstract class HUDElement
{
private int xOffset;
private int yOffset;
@ -20,7 +21,8 @@ public abstract class HUDElement {
private final int yOffsetDefault;
private final RenderGameOverlayEvent.ElementType elementType;
public HUDElement(int xOffset, int yOffset, RenderGameOverlayEvent.ElementType elementType) {
public HUDElement(int xOffset, int yOffset, RenderGameOverlayEvent.ElementType elementType)
{
this.xOffset = xOffset;
this.xOffsetDefault = xOffset;
this.yOffset = yOffset;
@ -34,25 +36,28 @@ public abstract class HUDElement {
public abstract boolean shouldRender(Minecraft minecraft);
public void onPositionChanged() {
public void onPositionChanged()
{
}
public void resetToDefault() {
public void resetToDefault()
{
this.xOffset = xOffsetDefault;
this.yOffset = yOffsetDefault;
}
public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height) {
public void drawTexturedModalRect(int x, int y, int textureX, int textureY, int width, int height)
{
float f = 0.00390625F;
float f1 = 0.00390625F;
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
vertexbuffer.pos((double)(x + 0), (double)(y + height), 0).tex((double)((float)(textureX + 0) * f), (double)((float)(textureY + height) * f1)).endVertex();
vertexbuffer.pos((double)(x + width), (double)(y + height), 0).tex((double)((float)(textureX + width) * f), (double)((float)(textureY + height) * f1)).endVertex();
vertexbuffer.pos((double)(x + width), (double)(y + 0), 0).tex((double)((float)(textureX + width) * f), (double)((float)(textureY + 0) * f1)).endVertex();
vertexbuffer.pos((double)(x + 0), (double)(y + 0), 0).tex((double)((float)(textureX + 0) * f), (double)((float)(textureY + 0) * f1)).endVertex();
vertexbuffer.pos((double) (x + 0), (double) (y + height), 0).tex((double) ((float) (textureX + 0) * f), (double) ((float) (textureY + height) * f1)).endVertex();
vertexbuffer.pos((double) (x + width), (double) (y + height), 0).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + height) * f1)).endVertex();
vertexbuffer.pos((double) (x + width), (double) (y + 0), 0).tex((double) ((float) (textureX + width) * f), (double) ((float) (textureY + 0) * f1)).endVertex();
vertexbuffer.pos((double) (x + 0), (double) (y + 0), 0).tex((double) ((float) (textureX + 0) * f), (double) ((float) (textureY + 0) * f1)).endVertex();
tessellator.draw();
}
}