Jump to content

Recommended Posts

Posted

I have no idea why but my block "SteamGenerator" is not rendering I've copied my other two classes that also use special rendering but this one doesn't work when I use t.addVertexWithUV() (t=tessellator.instance)

 

heres my renderer class:

@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float meta) {


	GL11.glTranslated(x, y, z);
	GL11.glDisable(GL11.GL_LIGHTING);
	bindTexture(steamgentext);
	t.startDrawingQuads();
	t.setTextureUV(1/4, 1/4);
	t.addVertexWithUV(0, 1, 1, 1/4, 1/4);
	t.setTextureUV(1/4, 0/4);
	t.addVertexWithUV(1, 1, 1, 1/4, 0);
	t.setTextureUV(0/4, 0/4);
	t.addVertexWithUV(1, 1, 0, 0, 0);
	t.setTextureUV(0/4, 1/4);
	t.addVertexWithUV(0, 1, 0, 0, 1/4);
	t.draw();
	GL11.glEnable(GL11.GL_LIGHTING);
	GL11.glTranslated(-x, -y, -z);
}

 

in my block class I have:

	 @Override
	public boolean isOpaqueCube(){
		return false;
	}
	@Override
    public int getRenderType() {
            return -1;
    }
	 public boolean renderAsNormalBlock() {
         return false;
    }

 

I've registered the tileEntity,the TileEntitySpecialRenderer but it still doesn't render

 

sidenote:my .png file has 16 textures (4x4)

The proud(ish) developer of Ancients

Posted

Hi

 

I'd suggest you put a breakpoint or System.out.println("here"); into your renderTileEntityAt()

 

This will show you if it's a rendering problem or a registration problem, and give you a good clue on where to look next.

 

-TGG

 

PS I don't think you need to use

t.setTextureUV(1/4, 1/4);

before each

t.addVertexWithUV(0, 1, 1, 1/4, 1/4);

 

Also, 1/4 gets converted to 0 due to integer arithmetic.  Use 0.25 or 1.0/4.0 instead.

 

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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