Guest User

Untitled

a guest
Jan 17th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. import net.minecraft.client.Minecraft;
  4.  
  5. import org.lwjgl.opengl.GL11;
  6.  
  7. public class AC_GuiTradingButtons extends GuiButton {
  8.  
  9. public static Minecraft mc = ModLoader.getMinecraftInstance();
  10.  
  11. protected static RenderItem itemRenderer = new RenderItem();
  12.  
  13. /**
  14. * Holds the ItemStack that will be used to draw the achievement into the GUI.
  15. */
  16. public final ItemStack theItemStack;
  17.  
  18. public int amount, cost;
  19.  
  20.  
  21. public AC_GuiTradingButtons(int par1, int par2, int par3, int par4, int par5, String par6Str, ItemStack par7ItemStack, int amount, int cost)
  22. {
  23. super(par1, par2, par3, par4, par5, par6Str);
  24. this.theItemStack = par7ItemStack;
  25. this.amount = amount;
  26. this.cost = cost;
  27. }
  28.  
  29. /**
  30. * Draws this button to the screen.
  31. */
  32. public void drawButton(Minecraft par1Minecraft, int par2, int par3)
  33. {
  34. if (this.drawButton)
  35. {
  36. FontRenderer var4 = par1Minecraft.fontRenderer;
  37. boolean var5 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height;
  38. int var6 = this.getHoverState(var5);
  39. int var7 = 14737632;
  40.  
  41. if (!this.enabled)
  42. {
  43. var7 = -6250336;
  44. }
  45. else if (var5)
  46. {
  47. var7 = 16777120;
  48. this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 55) / 2, var7);
  49. }
  50.  
  51. this.drawCenteredString(var4, "$" + String.valueOf(this.cost), this.xPosition + this.width / 2, this.yPosition + (this.height + 30) / 2, var7);
  52. this.drawCenteredString(var4, "x" + String.valueOf(this.amount), this.xPosition + this.width / 2, this.yPosition + (this.height - 30) / 2, var7);
  53. this.itemRenderer.renderItemIntoGUI(mc.fontRenderer, this.mc.renderEngine, theItemStack, this.xPosition + 7, this.yPosition + 4);
  54. }
  55. }
  56. }
Add Comment
Please, Sign In to add comment