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 classSprite.Info(package private) classSprite.Interpolation -
Field Summary
Fields Modifier and Type Field Description private AnimationResourceMetadataanimationMetadataprivate SpriteAtlasTextureatlasprivate intframeIndexprivate intframeTicksThe tick position within the current frame.private int[]frameXsprivate int[]frameYsprotected NativeImage[]imagesprivate Sprite.Infoinfoprivate Sprite.Interpolationinterpolationprivate floatuMaxprivate floatuMinprivate floatvMaxprivate floatvMinprivate intxprivate inty -
Constructor Summary
Constructors Modifier Constructor Description protectedSprite(SpriteAtlasTexture spriteAtlasTexture, Sprite.Info info, int maxLevel, int atlasWidth, int atlasHeight, int x, int y, NativeImage nativeImage) -
Method Summary
Modifier and Type Method Description voidclose()floatgetAnimationFrameDelta()SpriteAtlasTexturegetAtlas()intgetFrameCount()private floatgetFrameDeltaFactor()floatgetFrameU(double frame)floatgetFrameV(double frame)intgetHeight()IdentifiergetId()floatgetMaxU()floatgetMaxV()floatgetMinU()floatgetMinV()VertexConsumergetTextureSpecificVertexConsumer(VertexConsumer vertexConsumer)intgetWidth()booleanisAnimated()booleanisPixelTransparent(int frame, int x, int y)voidtickAnimation()StringtoString()voidupload()private voidupload(int frame)private voidupload(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:
closein 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
-