Class VanillaTextureType

java.lang.Object
com.supermartijn642.fusion.texture.types.VanillaTextureType
All Implemented Interfaces:
TextureType<Void>, Serializer<Void>

public class VanillaTextureType extends Object implements TextureType<Void>
Created 30/04/2023 by SuperMartijn642
  • Constructor Details

    • VanillaTextureType

      public VanillaTextureType()
  • Method Details

    • getFrameSize

      public Pair<Integer,Integer> getFrameSize(SpritePreparationContext context, Void data)
      Description copied from interface: TextureType
      Gets the size of a single frame. The returned size will be allocated in the relevant atlas.
      Specified by:
      getFrameSize in interface TextureType<Void>
      Parameters:
      context - context for calculating the frame size
      data - custom texture data
      Returns:
      the size to allocate to this sprite in the atlas
      See Also:
    • createSprite

      public net.minecraft.client.renderer.texture.TextureAtlasSprite createSprite(SpriteCreationContext context, Void data)
      Description copied from interface: TextureType
      Creates the sprite from the custom texture data.
      Specified by:
      createSprite in interface TextureType<Void>
      Parameters:
      context - context for creating the sprite
      data - custom texture data
      See Also:
    • deserialize

      public Void deserialize(com.google.gson.JsonObject json) throws com.google.gson.JsonParseException
      Description copied from interface: Serializer
      Deserializes the given json to some data.
      Specified by:
      deserialize in interface Serializer<Void>
      Throws:
      com.google.gson.JsonParseException - if the given json does not match the expected format
    • serialize

      public com.google.gson.JsonObject serialize(Void value)
      Description copied from interface: Serializer
      Serializes the given data to json.
      Specified by:
      serialize in interface Serializer<Void>