@SuppressWarnings({ "null", "unused" })
@Override
public final void render(@Nonnull T te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
if (te != null && te.hasWorld() && !te.isInvalid()) {
final IBlockState blockState = te.getWorld().getBlockState(te.getPos());
final int renderPass = MinecraftForgeClient.getRenderPass();
if ((block == null || block == blockState.getBlock()) && shouldRender(te, blockState, renderPass)) {
GlStateManager.disableLighting();
if (renderPass == 0) {
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
} else {
GlStateManager.enableBlend();
GlStateManager.depthMask(false);
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
}
RenderUtil.bindBlockTexture();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
renderTileEntity(te, blockState, partialTicks, destroyStage);
GlStateManager.popMatrix();
}
} else if (te == null) {
renderItem();
}
}