Formatting!
This commit is contained in:
parent
d240daf958
commit
8c4eff0d81
30 changed files with 301 additions and 225 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,14 +14,17 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class HUDElementHolding extends HUDElement {
|
||||
public class HUDElementHolding extends HUDElement
|
||||
{
|
||||
|
||||
public HUDElementHolding() {
|
||||
public HUDElementHolding()
|
||||
{
|
||||
super(0, 0, RenderGameOverlayEvent.ElementType.HOTBAR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks) {
|
||||
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks)
|
||||
{
|
||||
ItemStack sigilHolding = minecraft.thePlayer.getHeldItemMainhand();
|
||||
// TODO - Clean this mess
|
||||
// Check mainhand for Sigil of Holding
|
||||
|
@ -59,7 +62,8 @@ public class HUDElementHolding extends HUDElement {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender(Minecraft minecraft) {
|
||||
public boolean shouldRender(Minecraft minecraft)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue