public class MalisisIcon
extends net.minecraft.client.renderer.texture.TextureAtlasSprite
TextureAtlasSprite to allow common operations like clipping and offset.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<MalisisIcon> |
dependants
Lists of MalisisIcon depending on this one.
|
protected boolean |
flippedU
Is the icon flipped on the horizontal axis.
|
protected boolean |
flippedV
Is the icon flipped on the vertical axis.
|
static MalisisIcon |
missing
Missing texture
MalisisIcon |
protected int |
rotation
Rotation value (clockwise).
|
protected int |
sheetHeight
Height of the global texture sheet.
|
protected int |
sheetWidth
Width of the global texture sheet.
|
| Constructor and Description |
|---|
MalisisIcon()
Instantiates a new
MalisisIcon. |
MalisisIcon(MalisisIcon baseIcon)
Instantiates a new
MalisisIcon. |
MalisisIcon(java.lang.String name)
Instantiates a new
MalisisIcon. |
MalisisIcon(java.lang.String name,
float u,
float v,
float U,
float V)
Instantiates a new
MalisisIcon. |
MalisisIcon(net.minecraft.client.renderer.texture.TextureAtlasSprite icon) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDependant(MalisisIcon icon)
Adds a
MalisisIcon to be dependant on this one. |
MalisisIcon |
clip(float offsetXFactor,
float offsetYFactor,
float widthFactor,
float heightFactor)
Clips this
MalisisIcon. |
MalisisIcon |
clip(int offsetX,
int offsetY,
int width,
int height)
Clips this
MalisisIcon. |
MalisisIcon |
copy()
Creates a new
MalisisIcon from this MalisisIcon. |
void |
copyFrom(net.minecraft.client.renderer.texture.TextureAtlasSprite base)
Copies the values from
base to this MalisisIcon. |
MalisisIcon |
flip(boolean horizontal,
boolean vertical)
Sets this
MalisisIcon to be flipped. |
float |
getMaxU()
Gets the max u.
|
float |
getMaxV()
Gets the max v.
|
float |
getMinU()
Gets the min u.
|
float |
getMinV()
Gets the min v.
|
int |
getRotation()
Gets the rotation.
|
protected void |
initIcon(MalisisIcon baseIcon,
int width,
int height,
int x,
int y,
boolean rotated)
Initializes this
MalisisIcon. |
void |
initSprite(int width,
int height,
int x,
int y,
boolean rotated)
Called when the part represented by this
MalisisIcon is stiched to the texture. |
boolean |
isFlippedU()
Checks if is flipped u.
|
boolean |
isFlippedV()
Checks if is flipped v.
|
boolean |
isRotated()
Checks if is rotated.
|
MalisisIcon |
offset(int offsetX,
int offsetY)
Offsets this
MalisisIcon by a specified amount. |
MalisisIcon |
register(net.minecraft.client.renderer.texture.TextureMap textureMap)
Attempts to register this
MalisisIcon to the TextureMap. |
void |
setRotation(int rotation)
Sets the rotation for this
MalisisIcon. |
void |
setSize(int width,
int height)
Sets the size in pixel of this
MalisisIcon. |
void |
setUVs(float u,
float v,
float U,
float V)
Sets the u vs.
|
clearFramesTextureData, generateMipmaps, getFrameCount, getFrameTextureData, getIconHeight, getIconName, getIconWidth, getInterpolatedU, getInterpolatedV, getOriginX, getOriginY, hasAnimationMetadata, hasCustomLoader, load, loadSprite, makeAtlasSprite, setFramesTextureData, setIconHeight, setIconWidth, setLocationNameClock, setLocationNameCompass, toString, updateAnimationpublic static MalisisIcon missing
MalisisIconprotected int sheetWidth
protected int sheetHeight
protected boolean flippedU
protected boolean flippedV
protected int rotation
protected java.util.Set<MalisisIcon> dependants
public MalisisIcon()
MalisisIcon.public MalisisIcon(java.lang.String name)
MalisisIcon.name - the namepublic MalisisIcon(MalisisIcon baseIcon)
MalisisIcon.baseIcon - the base iconpublic MalisisIcon(java.lang.String name,
float u,
float v,
float U,
float V)
MalisisIcon.name - the nameu - the uv - the vU - the uV - the vpublic MalisisIcon(net.minecraft.client.renderer.texture.TextureAtlasSprite icon)
public void addDependant(MalisisIcon icon)
MalisisIcon to be dependant on this one. Will call initIcon(MalisisIcon, int, int, int, int, boolean) when
stiched to the sheet.icon - the iconpublic void setSize(int width,
int height)
MalisisIcon.width - the widthheight - the heightpublic void setUVs(float u,
float v,
float U,
float V)
u - the uv - the vU - the uV - the vpublic float getMinU()
getMinU in class net.minecraft.client.renderer.texture.TextureAtlasSpritepublic float getMaxU()
getMaxU in class net.minecraft.client.renderer.texture.TextureAtlasSpritepublic float getMinV()
getMinV in class net.minecraft.client.renderer.texture.TextureAtlasSpritepublic float getMaxV()
getMaxV in class net.minecraft.client.renderer.texture.TextureAtlasSpritepublic MalisisIcon flip(boolean horizontal, boolean vertical)
MalisisIcon to be flipped.horizontal - whether to flip horizontallyvertical - whether to flip verticallyMalisisIconpublic boolean isFlippedU()
MalisisIcon is flipped horizontally.public boolean isFlippedV()
MalisisIcon is flipped vertically.public boolean isRotated()
MalisisIcon is rotated.public void setRotation(int rotation)
MalisisIcon. The icon will be rotated rotation x 90 degrees clockwise.rotation - the rotationpublic int getRotation()
MalisisIcon.protected void initIcon(MalisisIcon baseIcon, int width, int height, int x, int y, boolean rotated)
MalisisIcon. Called from the icon this one depends on, copying the baseIcon values.baseIcon - the base iconwidth - the widthheight - the heightx - the xy - the yrotated - the rotatedpublic MalisisIcon offset(int offsetX, int offsetY)
MalisisIcon by a specified amount. offsetX and offsetY are specified in pixels.offsetX - the x offsetoffsetY - the y offsetMalisisIconpublic MalisisIcon clip(int offsetX, int offsetY, int width, int height)
MalisisIcon. offsetX, offsetY, width and height are specified in pixels.offsetX - the x offsetoffsetY - the y offsetwidth - the widthheight - the heightMalisisIconpublic MalisisIcon clip(float offsetXFactor, float offsetYFactor, float widthFactor, float heightFactor)
MalisisIcon. offsetXFactor, offsetYFactor, widthFactor and heightFactor are values
from zero to one.offsetXFactor - the x factor for offsetoffsetYFactor - the y factor for offsetwidthFactor - the width factorheightFactor - the height factorMalisisIconpublic void initSprite(int width,
int height,
int x,
int y,
boolean rotated)
MalisisIcon is stiched to the texture. Sets most of the icon fields.initSprite in class net.minecraft.client.renderer.texture.TextureAtlasSpritewidth - the widthheight - the heightx - the xy - the yrotated - the rotatedpublic void copyFrom(net.minecraft.client.renderer.texture.TextureAtlasSprite base)
base to this MalisisIcon.copyFrom in class net.minecraft.client.renderer.texture.TextureAtlasSpritebase - the icon to copy frompublic MalisisIcon copy()
MalisisIcon from this MalisisIcon.MalisisIconpublic MalisisIcon register(net.minecraft.client.renderer.texture.TextureMap textureMap)
MalisisIcon to the TextureMap. If a MalisisIcon is already registered with this
name, that registered icon will be returned instead.textureMap - the TextureMapMalisisIcon if not already registered, otherwise, the MalisisIcon already inside the registry.