JeiDrawable
Represents anything that can be drawn in a JEI recipe or category.
A drawable can be anything from an ingredient, to a blank image, to something with animations. Refer to all the available factory methods for more information.
All JeiIngredients can automatically convert into a JeiDrawable, avoiding some boilerplate. Refer to com.blamejared.jeitweaker.zen.component.JeiIngredientExpansions#asJeiDrawable(RawJeiIngredient) and its specialized versions com.blamejared.jeitweaker.zen.component.IItemStackExpansions#asJeiDrawable(IItemStack) and com.blamejared.jeitweaker.zen.component.IFluidStackExpansions#asJeiDrawable(IFluidStack) for more information.
This class was added by a mod with mod-id jeitweaker. So you need to have this mod installed if you want to use this feature.
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import mods.jei.component.JeiDrawable;Static Methods
Creates a blank drawable of the given width and height. 
  
  A blank drawable draws nothing.
Returns: A blank JeiDrawable.
Return Type: JeiDrawable
JeiDrawable.blank(width as int, height as int) as JeiDrawable| Parameter | Type | Description | 
|---|---|---|
| Parameterwidth | Typeint | DescriptionThe width of the drawable. | 
| Parameterheight | Typeint | DescriptionThe height of the drawable. | 
Creates a drawable that draws the given JeiIngredient.
Returns: An ingredient JeiDrawable.
Return Type: JeiDrawable
JeiDrawable.of(ingredient as JeiIngredient) as JeiDrawable| Parameter | Type | Description | 
|---|---|---|
| Parameteringredient | TypeJeiIngredient | DescriptionThe ingredient to draw. | 
Creates a drawable that draws the given texture, as specified in the parameters.
Returns: A texture JeiDrawable.
Return Type: JeiDrawable
JeiDrawable.of(texture as MCResourceLocation, u as int, v as int, width as int, height as int) as JeiDrawable| Parameter | Type | Description | 
|---|---|---|
| Parametertexture | TypeMCResourceLocation | DescriptionA MCResourceLocation identifying the path of the texture to draw. | 
| Parameteru | Typeint | DescriptionThe u coordinate of the texture (i.e. the top-left x coordinate of the rectangle to draw). | 
| Parameterv | Typeint | DescriptionThe v coordinate of the texture (i.e. the top-left y coordinate of the rectangle to draw). | 
| Parameterwidth | Typeint | DescriptionThe width of the texture to draw. | 
| Parameterheight | Typeint | DescriptionThe height of the texture to draw. | 
Creates an animated version of the given drawable that animates over the course of a set of ticks. 
  
  The original drawable is left untouched, meaning that the returned instance is a fully separate drawable.
Returns: An animated JeiDrawable.
Return Type: JeiDrawable
JeiDrawable.ofAnimated(delegate as JeiDrawable, ticks as int, animation as JeiDrawableAnimation) as JeiDrawable| Parameter | Type | Description | 
|---|---|---|
| Parameterdelegate | TypeJeiDrawable | DescriptionThe drawable that should be animated. | 
| Parameterticks | Typeint | DescriptionThe amount of ticks over which the animation unfolds. 20 ticks is 1 second. | 
| Parameteranimation | TypeJeiDrawableAnimation | DescriptionThe type of animation that should be rendered. | 
Creates an animated version of a texture drawable. 
  
  Using this method is effectively equivalent to 
  ofAnimated(of(texture, u, v, width, height), ticks, animation). It is thus merely provided as a 
  convenience to avoid having to create two drawables.
Returns: An animated texture JeiDrawable.
Return Type: JeiDrawable
JeiDrawable.ofAnimated(texture as MCResourceLocation, u as int, v as int, width as int, height as int, ticks as int, animation as JeiDrawableAnimation) as JeiDrawable| Parameter | Type | Description | 
|---|---|---|
| Parametertexture | TypeMCResourceLocation | DescriptionA MCResourceLocation identifying the path of the texture to draw. | 
| Parameteru | Typeint | DescriptionThe u coordinate of the texture (i.e. the top-left x coordinate of the rectangle to draw). | 
| Parameterv | Typeint | DescriptionThe v coordinate of the texture (i.e. the top-left y coordinate of the rectangle to draw). | 
| Parameterwidth | Typeint | DescriptionThe width of the texture to draw. | 
| Parameterheight | Typeint | DescriptionThe height of the texture to draw. | 
| Parameterticks | Typeint | DescriptionThe amount of ticks over which the animation unfolds. 20 ticks is 1 second. | 
| Parameteranimation | TypeJeiDrawableAnimation | DescriptionThe type of animation that should be rendered. | 
Creates a new texture drawable which is based on a nine-patch texture.
Returns: A nine-patch texture JeiDrawable.
Return Type: JeiDrawable
JeiDrawable.ofNinePatch(texture as MCResourceLocation, u as int, v as int, width as int, height as int, expectedWidth as int, expectedHeight as int) as JeiDrawable| Parameter | Type | Description | 
|---|---|---|
| Parametertexture | TypeMCResourceLocation | DescriptionA MCResourceLocation identifying the path of the texture to draw. | 
| Parameteru | Typeint | DescriptionThe u coordinate of the texture (i.e. the top-left x coordinate of the rectangle to draw). | 
| Parameterv | Typeint | DescriptionThe v coordinate of the texture (i.e. the top-left y coordinate of the rectangle to draw). | 
| Parameterwidth | Typeint | DescriptionThe width of the texture to draw. | 
| Parameterheight | Typeint | DescriptionThe height of the texture to draw. | 
| ParameterexpectedWidth | Typeint | DescriptionThe width of the drawable. | 
| ParameterexpectedHeight | Typeint | DescriptionThe height of the drawable. |