Enum CompatibleSkullMaterial

  • All Implemented Interfaces:
    Serializable, Comparable<CompatibleSkullMaterial>

    public enum CompatibleSkullMaterial
    extends Enum<CompatibleSkullMaterial>
    An enumeration of vanilla skull/head materials (items and blocks) that can possibly be supported.

    This abstracts both new materials and old materials+datavalues (skull variants) into matching categories by enum along with their implementation-specific details.

    Entries from newer versions may appear here, but are backed by playerhead materials if they are not supported - which can be checked with isSupported(). Generally this corresponds with an entry for each entry in SkullType

    Author:
    crashdemons (crashenator at gmail.com)
    See Also:
    isSupported(), SkullType
    • Method Detail

      • values

        public static CompatibleSkullMaterial[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CompatibleSkullMaterial c : CompatibleSkullMaterial.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CompatibleSkullMaterial valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getDetails

        public SkullDetails getDetails()
        Gets a class describing implementation-specific details about a vanilla skull
        Returns:
        the object with details about the skull
      • isSupported

        public boolean isSupported()
        Whether this skull material is supported as a vanilla item/block type.

        If this returns false, the skull is only supported as a playerhead (the PLAYER type will return true however).

        Returns:
        whether the skull is supported as a vanilla type
        See Also:
        SkullDetails.isBackedByPlayerhead()
      • get

        public static CompatibleSkullMaterial get​(SkullType type)
        Finds a skull material enum entry associated with the vanilla skull-type.
        Parameters:
        type - the vanilla skull type to reference
        Returns:
        the skull material enum entry