Jump to content

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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?

Posted
public static ResourceLocation combinedTexture = new ResourceLocation("tvmod:textures/blocks/combined.png");

if(Television.combinedLocation.exists()){
    	 this.bindTexture(combinedTexture);
    }

Posted

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

Posted

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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