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
  • Field Details

    • atlas

      private final SpriteAtlasTexture atlas
    • info

      private final Sprite.Info info
    • animationMetadata

      private final AnimationResourceMetadata animationMetadata
    • images

      protected final NativeImage[] images
    • frameXs

      private final int[] frameXs
    • frameYs

      private final int[] frameYs
    • interpolation

      @Nullable private final Sprite.Interpolation 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 frameTicks
      The tick position within the current frame. Resets to 0 on every frame advance.
  • Constructor Details

  • Method Details

    • upload

      private void upload​(int frame)
    • upload

      private void upload​(int frameX, int frameY, NativeImage[] output)
    • 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

      public Identifier getId()
    • getAtlas

      public SpriteAtlasTexture getAtlas()
    • getFrameCount

      public int getFrameCount()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public VertexConsumer getTextureSpecificVertexConsumer​(VertexConsumer vertexConsumer)