Class Texture

java.lang.Object
net.mcreator.workspace.resources.Texture
Direct Known Subclasses:
CustomTexture, ExternalTexture, Texture.Dummy

public abstract class Texture extends Object
Base class for texture resource implementations.
  • Field Details

    • textureType

      protected final TextureType textureType
    • textureName

      protected final String textureName
      Name of the texture, ALWAYS without the final .png extension. However, if the original texture name is textureName.png.png, this will be textureName.png
  • Method Details

    • getTextureName

      public String getTextureName()
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTextureIcon

      public abstract ImageIcon getTextureIcon(Workspace workspace)
    • fromName

      @Nullable public static Texture fromName(Workspace workspace, TextureType textureType, String name)
      Searches in the provided workspace for a texture with matching name and type.
      Parameters:
      workspace - The workspace to search in.
      textureType - The type of the textures to check.
      name - The name of the texture to look for.
      Returns:
      The texture with the provided name of the specified type.