Advertisement
Wooden_Brick

Untitled

Aug 2nd, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. this.mc.renderEngine.bindTexture("/gui/inventory.png");
  2. iint the type TextureManager is not applicable for arguments(String)
  3.  
  4.  
  5.  
  6.  
  7.  
  8. Whole class:
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15. public class GuiBuffBar extends Gui
  16. {
  17. private Minecraft mc;
  18.  
  19. public GuiBuffBar(Minecraft mc)
  20. {
  21. super();
  22.  
  23. // We need this to invoke the render engine.
  24. this.mc = mc;
  25. }
  26.  
  27. private static final int BUFF_ICON_SIZE = 18;
  28. private static final int BUFF_ICON_SPACING = BUFF_ICON_SIZE + 2; // 2 pixels between buff icons
  29. private static final int BUFF_ICON_BASE_U_OFFSET = 0;
  30. private static final int BUFF_ICON_BASE_V_OFFSET = 198;
  31. private static final int BUFF_ICONS_PER_ROW = 8;
  32.  
  33. //
  34. // This event is called by GuiIngameForge during each frame by
  35. // GuiIngameForge.pre() and GuiIngameForce.post().
  36. //
  37. @SubscribeEvent(priority = EventPriority.NORMAL)
  38. public void onRenderExperienceBar(RenderGameOverlayEvent event)
  39. {
  40. //
  41. // We draw after the ExperienceBar has drawn. The event raised by GuiIngameForge.pre()
  42. // will return true from isCancelable. If you call event.setCanceled(true) in
  43. // that case, the portion of rendering which this event represents will be canceled.
  44. // We want to draw *after* the experience bar is drawn, so we make sure isCancelable() returns
  45. // false and that the eventType represents the ExperienceBar event.
  46. if(event.isCancelable() || event.type != ElementType.EXPERIENCE)
  47. {
  48. return;
  49. }
  50.  
  51. // Starting position for the buff bar - 2 pixels from the top left corner.
  52. int xPos = 2;
  53. int yPos = 2;
  54. Collection collection = this.mc.thePlayer.getActivePotionEffects();
  55. if (!collection.isEmpty())
  56. {
  57. GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
  58. GL11.glDisable(GL11.GL_LIGHTING);
  59. this.mc.renderEngine.bindTexture("/gui/inventory.png");
  60.  
  61. for (Iterator iterator = this.mc.thePlayer.getActivePotionEffects()
  62. .iterator(); iterator.hasNext(); xPos += BUFF_ICON_SPACING)
  63. {
  64. PotionEffect potioneffect = (PotionEffect) iterator.next();
  65. Potion potion = Potion.potionTypes[potioneffect.getPotionID()];
  66.  
  67. if (potion.hasStatusIcon())
  68. {
  69. int iconIndex = potion.getStatusIconIndex();
  70. this.drawTexturedModalRect(
  71. xPos, yPos,
  72. BUFF_ICON_BASE_U_OFFSET + iconIndex % BUFF_ICONS_PER_ROW * BUFF_ICON_SIZE, BUFF_ICON_BASE_V_OFFSET + iconIndex / BUFF_ICONS_PER_ROW * BUFF_ICON_SIZE,
  73. BUFF_ICON_SIZE, BUFF_ICON_SIZE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement