Jump to content

RedEnergy

Members
  • Posts

    49
  • Joined

  • Last visited

Everything posted by RedEnergy

  1. I mean, after i wrote GL11.glPushMatrix(); GL11.glColor3f(1, 1, 1); this.fontrenderer.drawString(line, this.posX + 4, this.posY + 4 + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT, color); GL11.glPopMatrix(); nothing has been changed, color in vanilla version the same.
  2. Nothing has been changed, this glitch also exists in vanilla GuiTextField
  3. With this method, it is rendered public void drawTextBox(int mouseX, int mouseY) { drawRect(this.posX - 1, this.posY - 1, this.posX + this.width + 1, this.posY + this.height + 1, -6250336); drawRect(this.posX, this.posY, this.posX + this.width, this.posY + this.height, -16777216); int color = 0xFFFFFF; boolean flag = this.isFocused() && this.cursorCounter / 6 % 2 == 0; int startLine = this.getStartLineY(); int maxLine = this.height / this.fontrenderer.FONT_HEIGHT + startLine; List lines = this.getLines(); int charCount = 0; int lineCount = 0; int maxSize = this.width - (this.isScrolling()?14:4); int k2; for(k2 = 0; k2 < lines.size(); ++k2) { String wholeLine = (String)lines.get(k2); String line = ""; char[] xx = wholeLine.toCharArray(); int yy = xx.length; for(int i$ = 0; i$ < yy; ++i$) { char c = xx[i$]; if(this.fontrenderer.getStringWidth(line + c) > maxSize && this.wrapLine) { if(lineCount >= startLine && lineCount < maxLine) { this.fontrenderer.drawString(line, this.posX + 4, this.posY + 4 + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT, color); } line = ""; ++lineCount; } if(flag && charCount == this.cursorPosition && lineCount >= startLine && lineCount < maxLine && super.canEdit) { int xx1 = this.posX + this.fontrenderer.getStringWidth(line) + 3; int yy1 = this.posY + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT + 4; if(this.getText().length() == this.cursorPosition) { this.fontrenderer.drawString("_", xx1, yy1, color); } else { this.drawCursorVertical(xx1, yy1, xx1 + 1, yy1 + this.fontrenderer.FONT_HEIGHT); } } ++charCount; line = line + c; } if(lineCount >= startLine && lineCount < maxLine) { this.fontrenderer.drawString(line, this.posX + 4, this.posY + 4 + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT, color); if(flag && charCount == this.cursorPosition && super.canEdit) { int var20 = this.posX + this.fontrenderer.getStringWidth(line) + 3; yy = this.posY + (lineCount - startLine) * this.fontrenderer.FONT_HEIGHT + 4; if(this.getText().length() == this.cursorPosition) { this.fontrenderer.drawString("_", var20, yy, color); } else { this.drawCursorVertical(var20, yy, var20 + 1, yy + this.fontrenderer.FONT_HEIGHT); } } } ++lineCount; ++charCount; } k2 = Mouse.getDWheel(); if(k2 != 0 && this.isFocused()) { this.addScrollY(k2 < 0?-10:10); } if(Mouse.isButtonDown(0)) { if(this.clickVerticalBar) { if(this.startClick >= 0) { this.addScrollY(this.startClick - (mouseY - this.posY)); } if(this.hoverVerticalScrollBar(mouseX, mouseY)) { this.startClick = mouseY - this.posY; } this.startClick = mouseY - this.posY; } } else { this.clickVerticalBar = false; } this.listHeight = lineCount * this.fontrenderer.FONT_HEIGHT; this.drawVerticalScrollBar(); }
  4. Hello everyone, i am need to draw white string in textfield, and i set it text color to 0xFFFFFF, but color now looks grey. Picture below. Need solution. http://i.imgur.com/XfNxbZG.png SOLUTION: If you're using drawDefaultBackground() method in drawScreen() at your gui, you must put it before drawing anything else.
  5. Can you provide some example code how to use it in my case?
  6. Hello everyone, i need to sent packet from client to server which contains string and a buffer image, but i dont know how to write string and bufferedimage into ByteBuf at one time. I am using network system from coolAlisa github tutorial. Code, with which i am sending packet Packet class code
  7. I am using forge 10.12.2.1121. Can you provide some examples gui registering?
  8. It's not a problem, my method MethodManager.onFirstJoin() executing correct because i can see "MethodManager.onFirstJoin executed" message (I using it like debug message ), my problem is that it doesnt displays gui
  9. Hello, i need to show player gui on him first join. I tried to catch PlayerLoggedInEvent and if there is not flag, which show if player already have been playing on this server, show player gui using Minecraft.displayGuiScreen() method, but this method dose nothing, please help, all sources below. Classes: Class which catches PlayerLoggedInEvent, Class which performing action (display gui) , Gui class Please help!
  10. Hello everybody, i need to player music for everyone in radius X (let it be 100) from my block. My code you can see below, it works, but cause such a lot of lags that client just stops running.
  11. Hello everyone. I need to give player items on their first join. I am using event (code below) @SubscribeEvent public void firstJoin(PlayerLoggedInEvent event) { EntityPlayer player = event.player; NBTTagCompound entityData = player.getEntityData(); if(entityData.getBoolean("firstJoin")) { entityData.setBoolean("firstJoin", false); player.inventory.addItemStackToInventory(new ItemStack(Items.compass)); } } but it's do nothing. Where did I go wrong? P.S. Sorry for my bad english. Its not my native language.
  12. Thanks for the tip, I'll try
  13. I need to change the functional of buttons and add 1 more, also need to change the positions of buttons and add displays the number of players to the main menu
  14. Yes, i never have been working with coremods. I need to change vanilla code because i am writing mod for my own minecraft project.
  15. Try to destroy block and place another in another place
  16. Could you provide me an example please?
  17. I already tried to take the source code GuiMainMenu from mcp903, and put it in "\src\main\java\net\minecraft\client\gui", when i change it and use eclipse to start the game - everything works. But then i build my mod and put archive into \mods\ - nothing happens. I dont know how to inject my files into 1.7.2.jar like OptiFine does it.
  18. Hello everybody. I need to change main menu and the zombie class in the default code. I searched a lot for tutorials of this kind, but didnt find anything. May be you can help or provide me an example code? P.S. English is not my native language, so, please be patient with errors
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.