From 9a4d1e95ea7784f0f98ea2913701a3a3c28aefaa Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 24 May 2018 16:03:42 -0400 Subject: Formatting pass --- .../jewelrycraft/client/gui/GuiGuide.java | 125 ++++++++++++--------- 1 file changed, 72 insertions(+), 53 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java') diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java index a91b5a4..d322761 100755 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java @@ -21,22 +21,25 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; public class GuiGuide extends GuiContainer { - public int page, rot, del; - public boolean prevHover, nextHover; - World world; - private final GuiTab[] tabs = - new GuiTab[] { new GuiTabIntroduction(0), new GuiTabBlocks(1), - new GuiTabItems(2), new GuiTabGemsAndIngots(3), - new GuiTabCurses(4), new GuiTabModifiers(5), - new GuiTabRitual(6) }; - private GuiTab activeTab; - ResourceLocation pageTexture, flippedPageTexture; + public int page, rot, del; + public boolean prevHover, nextHover; + World world; + private final GuiTab[] tabs = new GuiTab[] { + new GuiTabIntroduction(0), new GuiTabBlocks(1), + new GuiTabItems(2), new GuiTabGemsAndIngots(3), + new GuiTabCurses(4), new GuiTabModifiers(5), + new GuiTabRitual(6) + }; + private GuiTab activeTab; + ResourceLocation pageTexture, flippedPageTexture; // GUIDE - public static GuiTab prevActive = new GuiTabIntroduction(0); - public static int prevPage = 1; + public static GuiTab prevActive = new GuiTabIntroduction( + 0); + public static int prevPage = 1; public GuiGuide(Container container, World world, - ResourceLocation pageTex, ResourceLocation flipPageTex) { + ResourceLocation pageTex, + ResourceLocation flipPageTex) { super(container); page = prevPage; rot = 0; @@ -49,7 +52,8 @@ public class GuiGuide extends GuiContainer { } @Override - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { + protected void drawGuiContainerBackgroundLayer(float f, int i, + int j) { nextHover = false; prevHover = false; if (del == 0) @@ -59,12 +63,12 @@ public class GuiGuide extends GuiContainer { del = 0; Minecraft.getMinecraft().getTextureManager() .bindTexture(pageTexture); - drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, - 145, 179); + drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, + 0, 0, 145, 179); Minecraft.getMinecraft().getTextureManager() .bindTexture(flippedPageTexture); - drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, - 145, 179); + drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, + 0, 0, 145, 179); for (GuiRectangle tab : tabs) { int srcX = 24; int sizeX = 19; @@ -76,35 +80,43 @@ public class GuiGuide extends GuiContainer { tab.draw(this, srcX, 180, sizeX, 18); } if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 - && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 + && j >= guiTop + 127 + 20 + && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()) { - drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, - 180, 11, 14); + drawTexturedModalRect(guiLeft + 195 + 20, + guiTop + 127 + 20, 0, 180, 11, 14); nextHover = true; } if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 - && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 + && j >= guiTop + 127 + 20 + && j <= guiTop + 127 + 20 + 14 && page - 2 > 0) { - drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, - 180, 11, 14); + drawTexturedModalRect(guiLeft - 61 + 20, + guiTop + 127 + 20, 11, 180, 11, + 14); prevHover = true; } activeTab.drawBackground(this, i, j, page); activeTab.drawBackground(this, i, j, page + 1); ArrayList text = new ArrayList<>(); text.add(page + "/" + activeTab.getMaxPages()); - drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), + drawHoveringText(text, + guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj); if (page < activeTab.getMaxPages()) { text.remove(0); - text.add((page + 1) + "/" + activeTab.getMaxPages()); + text.add((page + 1) + "/" + + activeTab.getMaxPages()); drawHoveringText(text, - guiLeft - 10 + 20 + 147 - text.get(0).length(), - guiTop + 150 + 25, fontRendererObj); + guiLeft - 10 + 20 + 147 - text + .get(0).length(), + guiTop + 150 + 25, + fontRendererObj); } for (int tab = 0; tab < tabs.length; tab++) renderItem(tabs[tab].getIcon(), guiLeft - 52, - guiTop + 26 + tab * 19, activeTab.getIcon()); + guiTop + 26 + tab * 19, + activeTab.getIcon()); } @Override @@ -140,8 +152,8 @@ public class GuiGuide extends GuiContainer { ItemStack activeIcon) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = - new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, + 0.0D, item); entityitem.hoverStart = 0.0F; if (item.isItemEqual(new ItemStack(BlockList.smelter))) { y -= 3; @@ -154,36 +166,40 @@ public class GuiGuide extends GuiContainer { GL11.glRotatef(rot, 0, 1, 0); if (item.isItemEqual(new ItemStack(BlockList.smelter))) GL11.glScalef(1.5F, 1.5F, 1.5F); - else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))) { + else if (item.isItemEqual( + new ItemStack(BlockList.handPedestal))) { GL11.glScalef(1.2F, 1.2F, 1.2F); GL11.glTranslatef(0F, -0.05F, 0F); } GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); - if (!(Block.getBlockFromItem( - entityitem.getEntityItem().getItem()) instanceof BlockAir)) + if (!(Block.getBlockFromItem(entityitem.getEntityItem() + .getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); if (RenderManager.instance.options.fancyGraphics) - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, - 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw( + entityitem, 0.0D, 0.0D, 0.0D, 0.0F, + 0.0F); else { GL11.glRotatef(180F, 0F, 1F, 0F); RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, - 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw( + entityitem, 0.0D, 0.0D, 0.0D, 0.0F, + 0.0F); RenderManager.instance.options.fancyGraphics = false; } - if (!(Block.getBlockFromItem( - entityitem.getEntityItem().getItem()) instanceof BlockAir)) + if (!(Block.getBlockFromItem(entityitem.getEntityItem() + .getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } - public void renderItem(ItemStack item, float x, float y, float scale, - boolean rotate, float xRot, float yRot, float zRot) { + public void renderItem(ItemStack item, float x, float y, + float scale, boolean rotate, float xRot, + float yRot, float zRot) { GL11.glPushMatrix(); - EntityItem entityitem = - new EntityItem(world, 0.0D, 0.0D, 0.0D, item); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, + 0.0D, item); entityitem.hoverStart = 0.0F; GL11.glTranslatef(x, y, 100); GL11.glScalef(-scale, scale, scale); @@ -196,24 +212,27 @@ public class GuiGuide extends GuiContainer { GL11.glRotatef(zRot, 0, 0, 1); if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F); - if (Block.getBlockFromItem(entityitem.getEntityItem() + if (Block.getBlockFromItem(entityitem + .getEntityItem() .getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F); } - if (!(Block.getBlockFromItem( - entityitem.getEntityItem().getItem()) instanceof BlockAir)) + if (!(Block.getBlockFromItem(entityitem.getEntityItem() + .getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting(); if (RenderManager.instance.options.fancyGraphics) - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, - 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw( + entityitem, 0.0D, 0.0D, 0.0D, 0.0F, + 0.0F); else { RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, - 0.0D, 0.0D, 0.0F, 0.0F); + RenderManager.instance.renderEntityWithPosYaw( + entityitem, 0.0D, 0.0D, 0.0D, 0.0F, + 0.0F); RenderManager.instance.options.fancyGraphics = false; } - if (!(Block.getBlockFromItem( - entityitem.getEntityItem().getItem()) instanceof BlockAir)) + if (!(Block.getBlockFromItem(entityitem.getEntityItem() + .getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting(); GL11.glPopMatrix(); } -- cgit v1.2.3