Jump to content

Block not rendering


memcallen

Recommended Posts

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

Link to comment
Share on other sites

Where do you register your render class?

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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.