Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -8,16 +8,14 @@ import net.minecraft.client.renderer.Tessellator;
|
|||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
|
||||
public abstract class HUDElement
|
||||
{
|
||||
private int xOffset;
|
||||
private int yOffset;
|
||||
public abstract class HUDElement {
|
||||
private final int xOffsetDefault;
|
||||
private final int yOffsetDefault;
|
||||
private final RenderGameOverlayEvent.ElementType elementType;
|
||||
private int xOffset;
|
||||
private int yOffset;
|
||||
|
||||
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;
|
||||
|
@ -31,19 +29,16 @@ 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(double x, double y, double textureX, double textureY, double width, double height)
|
||||
{
|
||||
public void drawTexturedModalRect(double x, double y, double textureX, double textureY, double width, double height) {
|
||||
float f = 0.00390625F;
|
||||
float f1 = 0.00390625F;
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
|
|
|
@ -1,25 +1,23 @@
|
|||
package WayofTime.bloodmagic.client.hud;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.proxy.ClientProxy;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import WayofTime.bloodmagic.api.soul.EnumDemonWillType;
|
||||
import WayofTime.bloodmagic.proxy.ClientProxy;
|
||||
import WayofTime.bloodmagic.util.Utils;
|
||||
|
||||
public class HUDElementDemonWillAura extends HUDElement
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class HUDElementDemonWillAura extends HUDElement {
|
||||
protected List<EnumDemonWillType> barOrder = new ArrayList<EnumDemonWillType>();
|
||||
|
||||
public HUDElementDemonWillAura()
|
||||
{
|
||||
public HUDElementDemonWillAura() {
|
||||
super(5, 5, RenderGameOverlayEvent.ElementType.HOTBAR);
|
||||
|
||||
barOrder.add(EnumDemonWillType.DEFAULT);
|
||||
|
@ -30,12 +28,10 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
}
|
||||
|
||||
@Override
|
||||
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks)
|
||||
{
|
||||
public void render(Minecraft minecraft, ScaledResolution resolution, float partialTicks) {
|
||||
EntityPlayer player = minecraft.player;
|
||||
|
||||
if (!Utils.canPlayerSeeDemonWill(player))
|
||||
{
|
||||
if (!Utils.canPlayerSeeDemonWill(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -46,8 +42,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
double maxAmount = Utils.getDemonWillResolution(player);
|
||||
|
||||
int i = 0;
|
||||
for (EnumDemonWillType type : barOrder)
|
||||
{
|
||||
for (EnumDemonWillType type : barOrder) {
|
||||
i++;
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F);
|
||||
minecraft.getTextureManager().bindTexture(new ResourceLocation(BloodMagic.MODID, "textures/hud/bars.png"));
|
||||
|
@ -67,8 +62,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
|
||||
this.drawTexturedModalRect(x, y, textureX, textureY, width, height);
|
||||
|
||||
if (player.isSneaking())
|
||||
{
|
||||
if (player.isSneaking()) {
|
||||
GlStateManager.pushMatrix();
|
||||
String value = "" + (int) amount;
|
||||
GlStateManager.translate(x - 2 * textureXOffset - value.length() * 0 + 70, (y - 1), 0);
|
||||
|
@ -80,8 +74,7 @@ public class HUDElementDemonWillAura extends HUDElement
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender(Minecraft minecraft)
|
||||
{
|
||||
public boolean shouldRender(Minecraft minecraft) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package WayofTime.bloodmagic.client.hud;
|
||||
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
|
||||
import WayofTime.bloodmagic.core.RegistrarBloodMagicItems;
|
||||
import WayofTime.bloodmagic.item.sigil.ItemSigilHolding;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
|
@ -15,17 +15,14 @@ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
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.player.getHeldItemMainhand();
|
||||
// Check mainhand for Sigil of Holding
|
||||
if (!(sigilHolding.getItem() == RegistrarBloodMagicItems.SIGIL_HOLDING))
|
||||
|
@ -45,8 +42,7 @@ public class HUDElementHolding extends HUDElement
|
|||
RenderHelper.enableGUIStandardItemLighting();
|
||||
List<ItemStack> holdingInv = ItemSigilHolding.getInternalInventory(sigilHolding);
|
||||
int xOffset = 0;
|
||||
for (ItemStack sigil : holdingInv)
|
||||
{
|
||||
for (ItemStack sigil : holdingInv) {
|
||||
renderHotbarItem(resolution.getScaledWidth() / 2 + 103 + xOffset + getXOffset(), resolution.getScaledHeight() - 18 + getYOffset(), partialTicks, minecraft.player, sigil);
|
||||
xOffset += 20;
|
||||
}
|
||||
|
@ -55,19 +51,15 @@ public class HUDElementHolding extends HUDElement
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender(Minecraft minecraft)
|
||||
{
|
||||
public boolean shouldRender(Minecraft minecraft) {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void renderHotbarItem(int x, int y, float partialTicks, EntityPlayer player, ItemStack stack)
|
||||
{
|
||||
if (!stack.isEmpty())
|
||||
{
|
||||
protected void renderHotbarItem(int x, int y, float partialTicks, EntityPlayer player, ItemStack stack) {
|
||||
if (!stack.isEmpty()) {
|
||||
float animation = (float) stack.getAnimationsToGo() - partialTicks;
|
||||
|
||||
if (animation > 0.0F)
|
||||
{
|
||||
if (animation > 0.0F) {
|
||||
GlStateManager.pushMatrix();
|
||||
float f1 = 1.0F + animation / 5.0F;
|
||||
GlStateManager.translate((float) (x + 8), (float) (y + 12), 0.0F);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue