Record Class PlayerSkinURLTextureProvider

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.texture.type.PlayerSkinURLTextureProvider
Record Components:
url - target URL
targetLocation - target resource location
All Implemented Interfaces:
TextureProvider

public record PlayerSkinURLTextureProvider(String url, net.minecraft.resources.ResourceLocation targetLocation) extends Record implements TextureProvider
The URL texture provider that takes a URL, downloads the image, adds it to the resource manager and stores it at the provided target location
This player specific version of the URL texture provider is required for making sure the player's arm, legs, head (etc) are correctly positioned in the texture created.
  • Field Details

  • Constructor Details

    • PlayerSkinURLTextureProvider

      public PlayerSkinURLTextureProvider(String url, net.minecraft.resources.ResourceLocation targetLocation)
      Creates an instance of a PlayerSkinURLTextureProvider record class.
      Parameters:
      url - the value for the url record component
      targetLocation - the value for the targetLocation record component
  • Method Details

    • codec

      public com.mojang.serialization.Codec<? extends TextureProvider> codec()
      Description copied from interface: TextureProvider
      The codec for reading the texture provider
      Specified by:
      codec in interface TextureProvider
      Returns:
      The codec
    • addScreenButtons

      public void addScreenButtons(net.minecraft.client.gui.Font font, net.minecraft.client.gui.layouts.GridLayout.RowHelper rowHelper, Consumer<TextureProvider> updateHandler)
      Specified by:
      addScreenButtons in interface TextureProvider
    • getTexture

      public net.minecraft.resources.ResourceLocation getTexture()
      Description copied from interface: TextureProvider
      The resource location of the texture that will be rendered
      Specified by:
      getTexture in interface TextureProvider
      Returns:
      The resource location
    • isCached

      public boolean isCached()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • url

      public String url()
      Returns the value of the url record component.
      Returns:
      the value of the url record component
    • targetLocation

      public net.minecraft.resources.ResourceLocation targetLocation()
      Returns the value of the targetLocation record component.
      Returns:
      the value of the targetLocation record component