Class SpriteCreationContextImpl
java.lang.Object
com.supermartijn642.fusion.texture.SpriteCreationContextImpl
- All Implemented Interfaces:
SpriteCreationContext,AutoCloseable
public class SpriteCreationContextImpl
extends Object
implements SpriteCreationContext, AutoCloseable
Created 29/04/2023 by SuperMartijn642
-
Constructor Summary
ConstructorsConstructorDescriptionSpriteCreationContextImpl(net.minecraft.client.renderer.texture.TextureAtlasSprite original) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()net.minecraft.client.renderer.texture.TextureAtlasSpriteCreates the sprite as if it were created by vanilla.net.minecraft.client.renderer.texture.TextureAtlasgetAtlas()Gets the atlas which the sprite is stitched to.intGets the height of the texture.intGets the width of the atlas.intGets the configured number of mipmap levels.intGets the height of the sprite as allocated on the atlas.intGets the x-position of the sprite on the atlas.intGets the y-position of the sprite on the atlas.intGets the width of the sprite as allocated on the atlas.com.mojang.blaze3d.platform.NativeImage[]Gets the texture data.intGets the height of the texture.net.minecraft.resources.ResourceLocationGets the identifier of the texture.intGets the width of the texture.
-
Constructor Details
-
SpriteCreationContextImpl
public SpriteCreationContextImpl(net.minecraft.client.renderer.texture.TextureAtlasSprite original)
-
-
Method Details
-
createOriginalSprite
public net.minecraft.client.renderer.texture.TextureAtlasSprite createOriginalSprite()Description copied from interface:SpriteCreationContextCreates the sprite as if it were created by vanilla. Note that if this is called, responsibility for closing the returned sprite's resources lies with the caller.- Specified by:
createOriginalSpritein interfaceSpriteCreationContext
-
getTextureWidth
public int getTextureWidth()Description copied from interface:SpriteCreationContextGets the width of the texture.- Specified by:
getTextureWidthin interfaceSpriteCreationContext
-
getTextureHeight
public int getTextureHeight()Description copied from interface:SpriteCreationContextGets the height of the texture.- Specified by:
getTextureHeightin interfaceSpriteCreationContext
-
getTextureIdentifier
public net.minecraft.resources.ResourceLocation getTextureIdentifier()Description copied from interface:SpriteCreationContextGets the identifier of the texture.- Specified by:
getTextureIdentifierin interfaceSpriteCreationContext
-
getTextureBuffers
public com.mojang.blaze3d.platform.NativeImage[] getTextureBuffers()Description copied from interface:SpriteCreationContextGets the texture data. Each element in the array corresponds to one mipmap level. Note that if this is called, responsibility for closing the returned images lies with the caller.- Specified by:
getTextureBuffersin interfaceSpriteCreationContext
-
getAtlasWidth
public int getAtlasWidth()Description copied from interface:SpriteCreationContextGets the width of the atlas.- Specified by:
getAtlasWidthin interfaceSpriteCreationContext
-
getAtlasHeight
public int getAtlasHeight()Description copied from interface:SpriteCreationContextGets the height of the texture.- Specified by:
getAtlasHeightin interfaceSpriteCreationContext
-
getAtlas
public net.minecraft.client.renderer.texture.TextureAtlas getAtlas()Description copied from interface:SpriteCreationContextGets the atlas which the sprite is stitched to.- Specified by:
getAtlasin interfaceSpriteCreationContext
-
getSpritePositionX
public int getSpritePositionX()Description copied from interface:SpriteCreationContextGets the x-position of the sprite on the atlas.- Specified by:
getSpritePositionXin interfaceSpriteCreationContext
-
getSpritePositionY
public int getSpritePositionY()Description copied from interface:SpriteCreationContextGets the y-position of the sprite on the atlas.- Specified by:
getSpritePositionYin interfaceSpriteCreationContext
-
getSpriteWidth
public int getSpriteWidth()Description copied from interface:SpriteCreationContextGets the width of the sprite as allocated on the atlas.- Specified by:
getSpriteWidthin interfaceSpriteCreationContext
-
getSpriteHeight
public int getSpriteHeight()Description copied from interface:SpriteCreationContextGets the height of the sprite as allocated on the atlas.- Specified by:
getSpriteHeightin interfaceSpriteCreationContext
-
getMipmapLevels
public int getMipmapLevels()Description copied from interface:SpriteCreationContextGets the configured number of mipmap levels.- Specified by:
getMipmapLevelsin interfaceSpriteCreationContext
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-