diff --git a/lwjgl-rundir/eaglercraft.jar b/lwjgl-rundir/eaglercraft.jar index db7cce1..831c512 100644 Binary files a/lwjgl-rundir/eaglercraft.jar and b/lwjgl-rundir/eaglercraft.jar differ diff --git a/src/main/java/net/minecraft/src/GuiLanguage.java b/src/main/java/net/minecraft/src/GuiLanguage.java index d960d78..8c12f26 100644 --- a/src/main/java/net/minecraft/src/GuiLanguage.java +++ b/src/main/java/net/minecraft/src/GuiLanguage.java @@ -31,7 +31,7 @@ public class GuiLanguage extends GuiScreen { StringTranslate var1 = StringTranslate.getInstance(); this.buttonList.add(this.doneButton = new GuiSmallButton(6, this.width / 2 - 75, this.height - 38, var1.translateKey("gui.done"))); this.languageList = new GuiSlotLanguage(this); - this.languageList.registerScrollButtons(7, 8); + this.languageList.registerScrollButtons(this.buttonList, 7, 8); } /** diff --git a/src/main/java/net/minecraft/src/GuiSelectWorld.java b/src/main/java/net/minecraft/src/GuiSelectWorld.java index 9331d07..d80a966 100644 --- a/src/main/java/net/minecraft/src/GuiSelectWorld.java +++ b/src/main/java/net/minecraft/src/GuiSelectWorld.java @@ -79,7 +79,7 @@ public class GuiSelectWorld extends GuiScreen this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = StatCollector.translateToLocal("gameMode.creative"); this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = StatCollector.translateToLocal("gameMode.adventure"); this.worldSlotContainer = new GuiWorldSlot(this); - this.worldSlotContainer.registerScrollButtons(4, 5); + this.worldSlotContainer.registerScrollButtons(this.buttonList, 4, 5); this.initButtons(); } diff --git a/src/main/java/net/minecraft/src/GuiSlot.java b/src/main/java/net/minecraft/src/GuiSlot.java index bfd734c..26b8e76 100644 --- a/src/main/java/net/minecraft/src/GuiSlot.java +++ b/src/main/java/net/minecraft/src/GuiSlot.java @@ -1,20 +1,24 @@ package net.minecraft.src; -import org.lwjgl.input.Mouse; +import java.util.List; + import net.lax1dude.eaglercraft.EaglerAdapter; +import net.lax1dude.eaglercraft.TextureLocation; import net.lax1dude.eaglercraft.adapter.Tessellator; +import net.minecraft.src.Minecraft; -public abstract class GuiSlot -{ - public final Minecraft mc; +public abstract class GuiSlot { + protected final Minecraft mc; /** - * The width of the GuiScreen. Affects the container rendering, but not the overlays. + * The width of the GuiScreen. Affects the container rendering, but not the + * overlays. */ - int width; + private int width; /** - * The height of the GuiScreen. Affects the container rendering, but not the overlays or the scrolling. + * The height of the GuiScreen. Affects the container rendering, but not the + * overlays or the scrolling. */ private int height; @@ -45,8 +49,8 @@ public abstract class GuiSlot private float initialClickY = -2.0F; /** - * what to multiply the amount you moved your mouse by(used for slowing down scrolling when over the items and no on - * scroll bar) + * what to multiply the amount you moved your mouse by(used for slowing down + * scrolling when over the items and no on scroll bar) */ private float scrollMultiplier; @@ -57,15 +61,15 @@ public abstract class GuiSlot private int selectedElement = -1; /** the time when this button was last clicked. */ - private long lastClicked; + private long lastClicked = 0L; /** true if a selected element in this gui will show an outline box */ private boolean showSelectionBox = true; private boolean field_77243_s; private int field_77242_t; + protected int elementWidth = 110; - public GuiSlot(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) - { + public GuiSlot(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) { this.mc = par1Minecraft; this.width = par2; this.height = par3; @@ -76,8 +80,7 @@ public abstract class GuiSlot this.right = par2; } - public void func_77207_a(int par1, int par2, int par3, int par4) - { + public void func_77207_a(int par1, int par2, int par3, int par4) { this.width = par1; this.height = par2; this.top = par3; @@ -86,18 +89,15 @@ public abstract class GuiSlot this.right = par1; } - public void setShowSelectionBox(boolean par1) - { + public void setShowSelectionBox(boolean par1) { this.showSelectionBox = par1; } - protected void func_77223_a(boolean par1, int par2) - { + protected void func_77223_a(boolean par1, int par2) { this.field_77243_s = par1; this.field_77242_t = par2; - if (!par1) - { + if (!par1) { this.field_77242_t = 0; } } @@ -108,7 +108,8 @@ public abstract class GuiSlot protected abstract int getSize(); /** - * the element in the slot that was clicked, boolean for wether it was double clicked or not + * the element in the slot that was clicked, boolean for wether it was double + * clicked or not */ protected abstract void elementClicked(int var1, boolean var2); @@ -120,8 +121,7 @@ public abstract class GuiSlot /** * return the height of the content being scrolled */ - protected int getContentHeight() - { + protected int getContentHeight() { return this.getSize() * this.slotHeight + this.field_77242_t; } @@ -129,17 +129,19 @@ public abstract class GuiSlot protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) {} + protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) { + } - protected void func_77224_a(int par1, int par2) {} + protected void func_77224_a(int par1, int par2) { + } - protected void func_77215_b(int par1, int par2) {} + protected void func_77215_b(int par1, int par2) { + } - public int func_77210_c(int par1, int par2) - { - int var3 = this.width / 2 - 110; - int var4 = this.width / 2 + 110; - int var5 = par2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; + public int func_77210_c(int par1, int par2) { + int var3 = this.width / 2 - elementWidth; + int var4 = this.width / 2 + elementWidth; + int var5 = par2 - this.top - this.field_77242_t + (int) this.amountScrolled - 4; int var6 = var5 / this.slotHeight; return par1 >= var3 && par1 <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; } @@ -147,71 +149,61 @@ public abstract class GuiSlot /** * Registers the IDs that can be used for the scrollbar's buttons. */ - public void registerScrollButtons(int par1, int par2) - { - this.scrollUpButtonID = par1; - this.scrollDownButtonID = par2; + public void registerScrollButtons(List par1List, int par2, int par3) { + this.scrollUpButtonID = par2; + this.scrollDownButtonID = par3; } /** * stop the thing from scrolling out of bounds */ - private void bindAmountScrolled() - { + private void bindAmountScrolled() { int var1 = this.func_77209_d(); - if (var1 < 0) - { + if (var1 < 0) { var1 /= 2; } - if (this.amountScrolled < 0.0F) - { + if (this.amountScrolled < 0.0F) { this.amountScrolled = 0.0F; } - if (this.amountScrolled > (float)var1) - { - this.amountScrolled = (float)var1; + if (this.amountScrolled > (float) var1) { + this.amountScrolled = (float) var1; } } - public int func_77209_d() - { + public int func_77209_d() { return this.getContentHeight() - (this.bottom - this.top - 4); } - public void func_77208_b(int par1) - { - this.amountScrolled += (float)par1; + public void func_77208_b(int par1) { + this.amountScrolled += (float) par1; this.bindAmountScrolled(); this.initialClickY = -2.0F; } - public void actionPerformed(GuiButton par1GuiButton) - { - if (par1GuiButton.enabled) - { - if (par1GuiButton.id == this.scrollUpButtonID) - { - this.amountScrolled -= (float)(this.slotHeight * 2 / 3); + public void actionPerformed(GuiButton par1GuiButton) { + if (par1GuiButton.enabled) { + if (par1GuiButton.id == this.scrollUpButtonID) { + this.amountScrolled -= (float) (this.slotHeight * 2 / 3); this.initialClickY = -2.0F; this.bindAmountScrolled(); - } - else if (par1GuiButton.id == this.scrollDownButtonID) - { - this.amountScrolled += (float)(this.slotHeight * 2 / 3); + } else if (par1GuiButton.id == this.scrollDownButtonID) { + this.amountScrolled += (float) (this.slotHeight * 2 / 3); this.initialClickY = -2.0F; this.bindAmountScrolled(); } } } + private static final TextureLocation tex = new TextureLocation("/gui/background.png"); + /** - * draws the slot to the screen, pass in mouse's current x and y and partial ticks + * draws the slot to the screen, pass in mouse's current x and y and partial + * ticks */ - public void drawScreen(int par1, int par2, float par3) - { + public void drawScreen(int par1, int par2, float par3) { this.mouseX = par1; this.mouseY = par2; this.drawBackground(); @@ -224,99 +216,73 @@ public abstract class GuiSlot int var13; int var20; - if (Mouse.isButtonDown(0)) - { - if (this.initialClickY == -1.0F) - { + if (EaglerAdapter.mouseIsButtonDown(0)) { + if (this.initialClickY == -1.0F) { boolean var7 = true; - if (par2 >= this.top && par2 <= this.bottom) - { - int var8 = this.width / 2 - 110; - var9 = this.width / 2 + 110; - var10 = par2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; + if (par2 >= this.top && par2 <= this.bottom) { + int var8 = this.width / 2 - elementWidth; + var9 = this.width / 2 + elementWidth; + var10 = par2 - this.top - this.field_77242_t + (int) this.amountScrolled - 4; var11 = var10 / this.slotHeight; - if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) - { + if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { boolean var12 = var11 == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L; this.elementClicked(var11, var12); this.selectedElement = var11; this.lastClicked = Minecraft.getSystemTime(); - } - else if (par1 >= var8 && par1 <= var9 && var10 < 0) - { - this.func_77224_a(par1 - var8, par2 - this.top + (int)this.amountScrolled - 4); + } else if (par1 >= var8 && par1 <= var9 && var10 < 0) { + this.func_77224_a(par1 - var8, par2 - this.top + (int) this.amountScrolled - 4); var7 = false; } - if (par1 >= var5 && par1 <= var6) - { + if (par1 >= var5 && par1 <= var6) { this.scrollMultiplier = -1.0F; var20 = this.func_77209_d(); - if (var20 < 1) - { + if (var20 < 1) { var20 = 1; } - var13 = (int)((float)((this.bottom - this.top) * (this.bottom - this.top)) / (float)this.getContentHeight()); + var13 = (int) ((float) ((this.bottom - this.top) * (this.bottom - this.top)) / (float) this.getContentHeight()); - if (var13 < 32) - { + if (var13 < 32) { var13 = 32; } - if (var13 > this.bottom - this.top - 8) - { + if (var13 > this.bottom - this.top - 8) { var13 = this.bottom - this.top - 8; } - this.scrollMultiplier /= (float)(this.bottom - this.top - var13) / (float)var20; - } - else - { + this.scrollMultiplier /= (float) (this.bottom - this.top - var13) / (float) var20; + } else { this.scrollMultiplier = 1.0F; } - if (var7) - { - this.initialClickY = (float)par2; - } - else - { + if (var7) { + this.initialClickY = (float) par2; + } else { this.initialClickY = -2.0F; } - } - else - { + } else { this.initialClickY = -2.0F; } + } else if (this.initialClickY >= 0.0F) { + this.amountScrolled -= ((float) par2 - this.initialClickY) * this.scrollMultiplier; + this.initialClickY = (float) par2; } - else if (this.initialClickY >= 0.0F) - { - this.amountScrolled -= ((float)par2 - this.initialClickY) * this.scrollMultiplier; - this.initialClickY = (float)par2; - } - } - else - { - while (!this.mc.gameSettings.touchscreen && Mouse.next()) - { - int var16 = Mouse.getEventDWheel(); + } else { + while (EaglerAdapter.mouseNext()) { + int var16 = EaglerAdapter.mouseGetEventDWheel(); - if (var16 != 0) - { - if (var16 > 0) - { + if (var16 != 0) { + if (var16 > 0) { var16 = -1; - } - else if (var16 < 0) - { + } else if (var16 < 0) { var16 = 1; } - this.amountScrolled += (float)(var16 * this.slotHeight / 2); + this.amountScrolled += (float) (var16 * this.slotHeight / 2); } } @@ -327,50 +293,49 @@ public abstract class GuiSlot EaglerAdapter.glDisable(EaglerAdapter.GL_LIGHTING); EaglerAdapter.glDisable(EaglerAdapter.GL_FOG); Tessellator var18 = Tessellator.instance; - Gui.optionsBackground.bindTexture(); + tex.bindTexture(); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); float var17 = 32.0F; var18.startDrawingQuads(); var18.setColorOpaque_I(2105376); - var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, (double)((float)this.left / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); - var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, (double)((float)this.right / var17), (double)((float)(this.bottom + (int)this.amountScrolled) / var17)); - var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, (double)((float)this.right / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); - var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, (double)((float)this.left / var17), (double)((float)(this.top + (int)this.amountScrolled) / var17)); + var18.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D, (double) ((float) this.left / var17), (double) ((float) (this.bottom + (int) this.amountScrolled) / var17)); + var18.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D, (double) ((float) this.right / var17), (double) ((float) (this.bottom + (int) this.amountScrolled) / var17)); + var18.addVertexWithUV((double) this.right, (double) this.top, 0.0D, (double) ((float) this.right / var17), (double) ((float) (this.top + (int) this.amountScrolled) / var17)); + var18.addVertexWithUV((double) this.left, (double) this.top, 0.0D, (double) ((float) this.left / var17), (double) ((float) (this.top + (int) this.amountScrolled) / var17)); var18.draw(); - var9 = this.width / 2 - 92 - 16; - var10 = this.top + 4 - (int)this.amountScrolled; + var9 = this.width / 2 + 2 - elementWidth; + var10 = this.top + 4 - (int) this.amountScrolled; - if (this.field_77243_s) - { + if (this.field_77243_s) { this.func_77222_a(var9, var10, var18); } int var14; - for (var11 = 0; var11 < var4; ++var11) - { + EaglerAdapter.glEnable(EaglerAdapter.GL_BLEND); + EaglerAdapter.glBlendFunc(EaglerAdapter.GL_SRC_ALPHA, EaglerAdapter.GL_ONE_MINUS_SRC_ALPHA); + + for (var11 = 0; var11 < var4; ++var11) { var20 = var10 + var11 * this.slotHeight + this.field_77242_t; var13 = this.slotHeight - 4; - if (var20 <= this.bottom && var20 + var13 >= this.top) - { - if (this.showSelectionBox && this.isSelected(var11)) - { - var14 = this.width / 2 - 110; - int var15 = this.width / 2 + 110; + if (var20 <= this.bottom && var20 + var13 >= this.top) { + if (this.showSelectionBox && this.isSelected(var11)) { + var14 = this.width / 2 - elementWidth; + int var15 = this.width / 2 + elementWidth; EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D); var18.startDrawingQuads(); var18.setColorOpaque_I(8421504); - var18.addVertexWithUV((double)var14, (double)(var20 + var13 + 2), 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV((double)var15, (double)(var20 + var13 + 2), 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV((double)var15, (double)(var20 - 2), 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV((double)var14, (double)(var20 - 2), 0.0D, 0.0D, 0.0D); + var18.addVertexWithUV((double) var14, (double) (var20 + var13 + 2), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double) var15, (double) (var20 + var13 + 2), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double) var15, (double) (var20 - 2), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double) var14, (double) (var20 - 2), 0.0D, 0.0D, 0.0D); var18.setColorOpaque_I(0); - var18.addVertexWithUV((double)(var14 + 1), (double)(var20 + var13 + 1), 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV((double)(var15 - 1), (double)(var20 + var13 + 1), 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV((double)(var15 - 1), (double)(var20 - 1), 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV((double)(var14 + 1), (double)(var20 - 1), 0.0D, 0.0D, 0.0D); + var18.addVertexWithUV((double) (var14 + 1), (double) (var20 + var13 + 1), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double) (var15 - 1), (double) (var20 + var13 + 1), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double) (var15 - 1), (double) (var20 - 1), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double) (var14 + 1), (double) (var20 - 1), 0.0D, 0.0D, 0.0D); var18.draw(); EaglerAdapter.glEnable(EaglerAdapter.GL_TEXTURE_2D); } @@ -390,63 +355,59 @@ public abstract class GuiSlot EaglerAdapter.glDisable(EaglerAdapter.GL_TEXTURE_2D); var18.startDrawingQuads(); var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV((double)this.left, (double)(this.top + var19), 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV((double)this.right, (double)(this.top + var19), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double) this.left, (double) (this.top + var19), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double) this.right, (double) (this.top + var19), 0.0D, 1.0D, 1.0D); var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D); + var18.addVertexWithUV((double) this.right, (double) this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double) this.left, (double) this.top, 0.0D, 0.0D, 0.0D); var18.draw(); var18.startDrawingQuads(); var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double) this.left, (double) this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double) this.right, (double) this.bottom, 0.0D, 1.0D, 1.0D); var18.setColorRGBA_I(0, 0); - var18.addVertexWithUV((double)this.right, (double)(this.bottom - var19), 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV((double)this.left, (double)(this.bottom - var19), 0.0D, 0.0D, 0.0D); + var18.addVertexWithUV((double) this.right, (double) (this.bottom - var19), 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double) this.left, (double) (this.bottom - var19), 0.0D, 0.0D, 0.0D); var18.draw(); var20 = this.func_77209_d(); - if (var20 > 0) - { + if (var20 > 0) { var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); - if (var13 < 32) - { + if (var13 < 32) { var13 = 32; } - if (var13 > this.bottom - this.top - 8) - { + if (var13 > this.bottom - this.top - 8) { var13 = this.bottom - this.top - 8; } - var14 = (int)this.amountScrolled * (this.bottom - this.top - var13) / var20 + this.top; + var14 = (int) this.amountScrolled * (this.bottom - this.top - var13) / var20 + this.top; - if (var14 < this.top) - { + if (var14 < this.top) { var14 = this.top; } var18.startDrawingQuads(); var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV((double)var5, (double)this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV((double)var6, (double)this.bottom, 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV((double)var6, (double)this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV((double)var5, (double)this.top, 0.0D, 0.0D, 0.0D); + var18.addVertexWithUV((double) var5, (double) this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double) var6, (double) this.bottom, 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double) var6, (double) this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double) var5, (double) this.top, 0.0D, 0.0D, 0.0D); var18.draw(); var18.startDrawingQuads(); var18.setColorRGBA_I(8421504, 255); - var18.addVertexWithUV((double)var5, (double)(var14 + var13), 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV((double)var6, (double)(var14 + var13), 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV((double)var6, (double)var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV((double)var5, (double)var14, 0.0D, 0.0D, 0.0D); + var18.addVertexWithUV((double) var5, (double) (var14 + var13), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double) var6, (double) (var14 + var13), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double) var6, (double) var14, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double) var5, (double) var14, 0.0D, 0.0D, 0.0D); var18.draw(); var18.startDrawingQuads(); var18.setColorRGBA_I(12632256, 255); - var18.addVertexWithUV((double)var5, (double)(var14 + var13 - 1), 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV((double)(var6 - 1), (double)(var14 + var13 - 1), 0.0D, 1.0D, 1.0D); - var18.addVertexWithUV((double)(var6 - 1), (double)var14, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV((double)var5, (double)var14, 0.0D, 0.0D, 0.0D); + var18.addVertexWithUV((double) var5, (double) (var14 + var13 - 1), 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double) (var6 - 1), (double) (var14 + var13 - 1), 0.0D, 1.0D, 1.0D); + var18.addVertexWithUV((double) (var6 - 1), (double) var14, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double) var5, (double) var14, 0.0D, 0.0D, 0.0D); var18.draw(); } @@ -457,27 +418,25 @@ public abstract class GuiSlot EaglerAdapter.glDisable(EaglerAdapter.GL_BLEND); } - protected int getScrollBarX() - { - return this.width / 2 + 124; + protected int getScrollBarX() { + return this.width / 2 + elementWidth + 28; } /** * Overlays the background to hide scrolled items */ - private void overlayBackground(int par1, int par2, int par3, int par4) - { + private void overlayBackground(int par1, int par2, int par3, int par4) { Tessellator var5 = Tessellator.instance; - Gui.optionsBackground.bindTexture(); + tex.bindTexture(); EaglerAdapter.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); float var6 = 32.0F; var5.startDrawingQuads(); var5.setColorRGBA_I(4210752, par4); - var5.addVertexWithUV(0.0D, (double)par2, 0.0D, 0.0D, (double)((float)par2 / var6)); - var5.addVertexWithUV((double)this.width, (double)par2, 0.0D, (double)((float)this.width / var6), (double)((float)par2 / var6)); + var5.addVertexWithUV(0.0D, (double) par2, 0.0D, 0.0D, (double) ((float) par2 / var6)); + var5.addVertexWithUV((double) this.width, (double) par2, 0.0D, (double) ((float) this.width / var6), (double) ((float) par2 / var6)); var5.setColorRGBA_I(4210752, par3); - var5.addVertexWithUV((double)this.width, (double)par1, 0.0D, (double)((float)this.width / var6), (double)((float)par1 / var6)); - var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6)); + var5.addVertexWithUV((double) this.width, (double) par1, 0.0D, (double) ((float) this.width / var6), (double) ((float) par1 / var6)); + var5.addVertexWithUV(0.0D, (double) par1, 0.0D, 0.0D, (double) ((float) par1 / var6)); var5.draw(); } } diff --git a/src/main/java/net/minecraft/src/GuiSlotServer.java b/src/main/java/net/minecraft/src/GuiSlotServer.java index 5d49fc6..dd131e9 100644 --- a/src/main/java/net/minecraft/src/GuiSlotServer.java +++ b/src/main/java/net/minecraft/src/GuiSlotServer.java @@ -70,7 +70,7 @@ class GuiSlotServer extends GuiSlot { protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { try { - this.func_77247_d(par1, par2, par3, par4, par5Tessellator); + this.func_77247_d(par1, par2 - 28, par3, par4, par5Tessellator); }catch(Throwable t) { } } else if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() diff --git a/src/main/java/net/minecraft/src/GuiStats.java b/src/main/java/net/minecraft/src/GuiStats.java index 34dbeee..19635ff 100644 --- a/src/main/java/net/minecraft/src/GuiStats.java +++ b/src/main/java/net/minecraft/src/GuiStats.java @@ -38,11 +38,11 @@ public class GuiStats extends GuiScreen { this.statsTitle = StatCollector.translateToLocal("gui.stats"); this.slotGeneral = new GuiSlotStatsGeneral(this); - this.slotGeneral.registerScrollButtons(1, 1); + this.slotGeneral.registerScrollButtons(this.buttonList, 1, 1); this.slotItem = new GuiSlotStatsItem(this); - this.slotItem.registerScrollButtons(1, 1); + this.slotItem.registerScrollButtons(this.buttonList, 1, 1); this.slotBlock = new GuiSlotStatsBlock(this); - this.slotBlock.registerScrollButtons(1, 1); + this.slotBlock.registerScrollButtons(this.buttonList, 1, 1); this.selectedSlot = this.slotGeneral; this.addHeaderButtons(); } diff --git a/src/main/java/net/minecraft/src/GuiTexturePacks.java b/src/main/java/net/minecraft/src/GuiTexturePacks.java index ad022bd..e483c1a 100644 --- a/src/main/java/net/minecraft/src/GuiTexturePacks.java +++ b/src/main/java/net/minecraft/src/GuiTexturePacks.java @@ -44,7 +44,7 @@ public class GuiTexturePacks extends GuiScreen { this.mc.texturePackList.updateAvaliableTexturePacks(); this.fileLocation = "texturepacks"; this.guiTexturePackSlot = new GuiTexturePackSlot(this); - this.guiTexturePackSlot.registerScrollButtons(7, 8); + this.guiTexturePackSlot.registerScrollButtons(this.buttonList, 7, 8); } /** diff --git a/src/main/java/net/minecraft/src/Minecraft.java b/src/main/java/net/minecraft/src/Minecraft.java index 34f4f1f..7b80e38 100644 --- a/src/main/java/net/minecraft/src/Minecraft.java +++ b/src/main/java/net/minecraft/src/Minecraft.java @@ -2128,9 +2128,8 @@ public class Minecraft /** * Gets the system time in milliseconds. */ - public static long getSystemTime() - { - return Sys.getTime() * 1000L / Sys.getTimerResolution(); + public static long getSystemTime() { + return EaglerAdapter.steadyTimeMillis(); } /**