Posted August 29, 201411 yr My model has a binded texture and when I press a button from my gui class I want it to rebind the texture
August 29, 201411 yr I'll be just as concise as you are. Use an event for your binded key. Set a value with that. Take that value with a switch and bind the texture you want. Just make sure you open & close your matrix/tessellator/... in each statement.
August 29, 201411 yr Author I'll be just as concise as you are. Use an event for your binded key. Set a value with that. Take that value with a switch and bind the texture you want. Just make sure you open & close your matrix/tessellator/... in each statement. I'm sorry, I dont know what you mean
August 29, 201411 yr What part do you not understand? Also, post your code. Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
August 30, 201411 yr Author What part do you not understand? Also, post your code. @Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { TileEntityTelevision cannonTile = (TileEntityTelevision)tileentity; int direction = tileentity.getWorldObj().getBlockMetadata(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord); if (direction == 3) direction = 1; else if (direction == 1) direction = 3; else if (direction == 0) direction = 2; else if (direction == 2) direction = 0; GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); if(Television.combinedLocation.exists()){ this.bindTexture(combinedTexture); } else { this.bindTexture(texture); } GL11.glPushMatrix(); GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(direction * 90.0F, 0.0F, 1.0F, 0.0F); this.model.renderAll(); GL11.glPopMatrix(); GL11.glPopMatrix(); } } So, I basically want to rerun this method when I press a button
August 30, 201411 yr Author That method is run every frame anyways, so there is no point in running in manually. Well, when I press a button on my gui the texture changes, but the texture doesnt update in game, unless I reset the game. How do I make the texture update without reseting the game?
September 2, 201411 yr Author public static ResourceLocation combinedTexture = new ResourceLocation("tvmod:textures/blocks/combined.png"); if(Television.combinedLocation.exists()){ this.bindTexture(combinedTexture); }
September 3, 201411 yr Author What is Television.combinedLocation ? What does the exists method do? Telvision.combinedLocation is a file linking to textures/blocks/combined.png
September 4, 201411 yr Author Then I have no idea what you are doing there... Under which conditions should the texture change? Ok, so you have the combined texture. So then when I press a button in the gui the combined texture changes into two combined textures. But when it does change, it doesnt change ingame, unless I reset the game that is
September 5, 201411 yr Author To do things from a Gui you'll need to send packets to change the data on the server. How would I handle the packet from within the bindTexture method?
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.