diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-16 15:50:41 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-16 15:50:41 -0400 |
| commit | 7c00af18febf6c0b833c7633b4fb60a9a1bb93af (patch) | |
| tree | f02de145362d6a1399651ade4a130d565d7f0ba3 /src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java | |
| parent | b11742988dec635b5c5da7c2363803cbfafb37b1 (diff) | |
| download | notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.gz notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.tar.bz2 notenoughupdates-7c00af18febf6c0b833c7633b4fb60a9a1bb93af.zip | |
Code Clean Up (#2)
* intellij code clean up
* optimize imports
* format
* intellij suggestions
* fix empty catch issues
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java b/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java index a2c8bfa9..ed479e79 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/collectionlog/GuiCollectionLog.java @@ -24,29 +24,29 @@ public class GuiCollectionLog extends GuiScreen { int colwidth = 307; int colheight = 187; - int left = width/2 - colwidth/2; - int top = height/2 - colheight/2; + int left = width / 2 - colwidth / 2; + int top = height / 2 - colheight / 2; BackgroundBlur.renderBlurredBackground(10, width, height, left, top, colwidth, colheight); super.drawDefaultBackground(); - Utils.drawStringCentered("\u00a7lCollection Log", fontRendererObj, width/2, top - 27, true, 0xfff5aa00); + Utils.drawStringCentered("\u00a7lCollection Log", fontRendererObj, width / 2, top - 27, true, 0xfff5aa00); String[] cats = {"Bosses", "Dragons", "Slayer", "Dungeons"}; GlStateManager.enableDepth(); GlStateManager.translate(0, 0, 2); - for(int i=0; i<4; i++) { - if(i == 0) { + for (int i = 0; i < 4; i++) { + if (i == 0) { int offset = i == 0 ? 1 : 2; Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX); GlStateManager.color(1, 1, 1, 1); - Utils.drawTexturedRect(left+i*71, top-21, 71, 25, - (71*offset)/512f, (71+71*offset)/512f, 211/512f, (211+25)/512f, GL11.GL_NEAREST); + Utils.drawTexturedRect(left + i * 71, top - 21, 71, 25, + (71 * offset) / 512f, (71 + 71 * offset) / 512f, 211 / 512f, (211 + 25) / 512f, GL11.GL_NEAREST); - Utils.drawStringCentered(cats[i], fontRendererObj, left+i*71+71/2, top - 8, true, 0xfff5aa00); + Utils.drawStringCentered(cats[i], fontRendererObj, left + i * 71 + 71 / 2, top - 8, true, 0xfff5aa00); } } @@ -54,50 +54,48 @@ public class GuiCollectionLog extends GuiScreen { Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX); GlStateManager.color(1, 1, 1, 1); Utils.drawTexturedRect(left, top, colwidth, colheight, - 0, colwidth/512f, 0, colheight/512f, GL11.GL_NEAREST); + 0, colwidth / 512f, 0, colheight / 512f, GL11.GL_NEAREST); - GlScissorStack.push(0, top+3, width, top+colheight-6, scaledResolution); + GlScissorStack.push(0, top + 3, width, top + colheight - 6, scaledResolution); int catIndex = 0; - for(int h=top+3; h<top+colheight-6; h+=24) { + for (int h = top + 3; h < top + colheight - 6; h += 24) { catIndex += 2; Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX); GlStateManager.color(1, 1, 1, 1); Utils.drawTexturedRect(left, h, 100, 24, - 0, 100/512f, 187/512f, 211/512f, GL11.GL_NEAREST); + 0, 100 / 512f, 187 / 512f, 211 / 512f, GL11.GL_NEAREST); - fontRendererObj.drawString("Thing "+catIndex, left+5, h+2, 0xfff5aa00, true); - fontRendererObj.drawString("Thing "+(catIndex+1), left+5, h+14, 0xfff5aa00, true); + fontRendererObj.drawString("Thing " + catIndex, left + 5, h + 2, 0xfff5aa00, true); + fontRendererObj.drawString("Thing " + (catIndex + 1), left + 5, h + 14, 0xfff5aa00, true); } GlScissorStack.pop(scaledResolution); - fontRendererObj.drawString("\u00a7lSuperior Dragon", left+119, top+8, 0xfff5aa00, true); - fontRendererObj.drawString("Obtained: "+ EnumChatFormatting.YELLOW+"3/5", left+122, top+23, 0xfff5aa00, true); + fontRendererObj.drawString("\u00a7lSuperior Dragon", left + 119, top + 8, 0xfff5aa00, true); + fontRendererObj.drawString("Obtained: " + EnumChatFormatting.YELLOW + "3/5", left + 122, top + 23, 0xfff5aa00, true); String killCountText = "Kills: " + EnumChatFormatting.WHITE + "3"; //int killCountLen = fontRendererObj.getStringWidth(killCountText); - fontRendererObj.drawString(killCountText, left+122, top+68, 0xfff5aa00, true); + fontRendererObj.drawString(killCountText, left + 122, top + 68, 0xfff5aa00, true); Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX); GlStateManager.color(1, 1, 1, 1); - Utils.drawTexturedRect(left+colwidth-196, top, 196, colheight, - (512-196)/512f, 1, 0/512f, colheight/512f, GL11.GL_NEAREST); + Utils.drawTexturedRect(left + colwidth - 196, top, 196, colheight, + (512 - 196) / 512f, 1, 0 / 512f, colheight / 512f, GL11.GL_NEAREST); GlStateManager.translate(0, 0, -1); - for(int i=0; i<4; i++) { - if(i != 0) { + for (int i = 0; i < 4; i++) { + if (i != 0) { Minecraft.getMinecraft().getTextureManager().bindTexture(COLLECTION_LOG_TEX); GlStateManager.color(1, 1, 1, 1); - Utils.drawTexturedRect(left+i*71, top-21, 71, 25, - 0, 71/512f, 211/512f, (211+25)/512f, GL11.GL_NEAREST); + Utils.drawTexturedRect(left + i * 71, top - 21, 71, 25, + 0, 71 / 512f, 211 / 512f, (211 + 25) / 512f, GL11.GL_NEAREST); - Utils.drawStringCentered(cats[i], fontRendererObj, left+i*71+71/2, top - 8, true, 0xfff5aa00); + Utils.drawStringCentered(cats[i], fontRendererObj, left + i * 71 + 71 / 2, top - 8, true, 0xfff5aa00); } } - - super.drawScreen(mouseX, mouseY, partialTicks); } } |
