Package net.minecraft.client.texture
Class Sprite
java.lang.Object
net.minecraft.client.texture.Sprite
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
MissingSprite
@Environment(CLIENT) public class Sprite extends Object implements AutoCloseable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Sprite.Info
(package private) class
Sprite.Interpolation
-
Field Summary
Fields Modifier and Type Field Description private AnimationResourceMetadata
animationMetadata
private SpriteAtlasTexture
atlas
private int
frameIndex
private int
frameTicks
The tick position within the current frame.private int[]
frameXs
private int[]
frameYs
protected NativeImage[]
images
private Sprite.Info
info
private Sprite.Interpolation
interpolation
private float
uMax
private float
uMin
private float
vMax
private float
vMin
private int
x
private int
y
-
Constructor Summary
Constructors Modifier Constructor Description protected
Sprite(SpriteAtlasTexture spriteAtlasTexture, Sprite.Info info, int maxLevel, int atlasWidth, int atlasHeight, int x, int y, NativeImage nativeImage)
-
Method Summary
Modifier and Type Method Description void
close()
float
getAnimationFrameDelta()
SpriteAtlasTexture
getAtlas()
int
getFrameCount()
private float
getFrameDeltaFactor()
float
getFrameU(double frame)
float
getFrameV(double frame)
int
getHeight()
Identifier
getId()
float
getMaxU()
float
getMaxV()
float
getMinU()
float
getMinV()
VertexConsumer
getTextureSpecificVertexConsumer(VertexConsumer vertexConsumer)
int
getWidth()
boolean
isAnimated()
boolean
isPixelTransparent(int frame, int x, int y)
void
tickAnimation()
String
toString()
void
upload()
private void
upload(int frame)
private void
upload(int frameX, int frameY, NativeImage[] output)
-
Field Details
-
atlas
-
info
-
animationMetadata
-
images
-
frameXs
private final int[] frameXs -
frameYs
private final int[] frameYs -
interpolation
-
x
private final int x -
y
private final int y -
uMin
private final float uMin -
uMax
private final float uMax -
vMin
private final float vMin -
vMax
private final float vMax -
frameIndex
private int frameIndex -
frameTicks
private int frameTicksThe tick position within the current frame. Resets to 0 on every frame advance.
-
-
Constructor Details
-
Sprite
protected Sprite(SpriteAtlasTexture spriteAtlasTexture, Sprite.Info info, int maxLevel, int atlasWidth, int atlasHeight, int x, int y, NativeImage nativeImage)
-
-
Method Details
-
upload
private void upload(int frame) -
upload
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getMinU
public float getMinU() -
getMaxU
public float getMaxU() -
getFrameU
public float getFrameU(double frame) -
getMinV
public float getMinV() -
getMaxV
public float getMaxV() -
getFrameV
public float getFrameV(double frame) -
getId
-
getAtlas
-
getFrameCount
public int getFrameCount() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
toString
-
isPixelTransparent
public boolean isPixelTransparent(int frame, int x, int y) -
upload
public void upload() -
getFrameDeltaFactor
private float getFrameDeltaFactor() -
getAnimationFrameDelta
public float getAnimationFrameDelta() -
tickAnimation
public void tickAnimation() -
isAnimated
public boolean isAnimated() -
getTextureSpecificVertexConsumer
-