Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
private void render(TileEntityObj09 tile, double x, double y, double z, float f) {
GL11.glPushMatrix();
bindTexture(texture);
GL11.glTranslated(x, y, z);
GL11.glTranslatef(0.5F, 0.0F, 0.5F);
GL11.glTranslatef(0, 0, 1);
GL11.glRotatef(90f, 0.1f, 0.1f, 1.0f);
if (tile != null) {
GL11.glRotatef(tile.getBlockMetadata()*90, 0f, 1f, 0f);
}
GL11.glCallList(ProxyClient.displayList[8]);
GL11.glPopMatrix();
}
public void renderTileEntity(TileEntity tile , double x, double y, double z, float f)
{
if (tile != null)
{
switch(tile.getBlockMetadata())
{
case 0:GL11.glRotatef(360F + 90F, 0.0F, 1.0F, 0.0F);break;
case 1:GL11.glRotatef(0F, 0.0F, 1.0F, 0.0F);break;
case 2:GL11.glRotatef(180F + 90F, 0.0F, 1.0F, 0.0F);break;
case 3:GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);break;
}
}
}
модель пропадает если ставишь больше однойJava:public void renderTileEntity(TileEntity tile , double x, double y, double z, float f) { if (tile != null) { switch(tile.getBlockMetadata()) { case 0:GL11.glRotatef(360F + 90F, 0.0F, 1.0F, 0.0F);break; case 1:GL11.glRotatef(0F, 0.0F, 1.0F, 0.0F);break; case 2:GL11.glRotatef(180F + 90F, 0.0F, 1.0F, 0.0F);break; case 3:GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F);break; } } }
типо так?push/pop matrix забыл для сброса трансформаций.
это тайтл ентитиКод в студию
это сам блокКод в студию
private void render(TileEntityObj09 tile, double x, double y, double z, float f) {
GL11.glPushMatrix();
bindTexture(texture);
GL11.glTranslated(x, y, z);
GL11.glTranslatef(0.5F, 0.0F, 0.5F);
GL11.glTranslatef(0, 0, 1);
GL11.glRotatef(90f, 0.1f, 0.1f, 1.0f);
if (tile != null) {
GL11.glRotatef(tile.getBlockMetadata()*90, 0f, 1f, 0f);
}
GL11.glCallList(ProxyClient.displayList[8]);
GL11.glPopMatrix();
}
GL11.glRotated(90 * tile.getBlockMetadata(), 0, 1, 0);