Enum CompatibleSkullMaterial
- java.lang.Object
-
- java.lang.Enum<CompatibleSkullMaterial>
-
- com.github.crashdemons.playerheads.compatibility.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
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CREEPER
ENDER_DRAGON
1.9 dragon headPLAYER
SKELETON
WITHER_SKELETON
ZOMBIE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CompatibleSkullMaterial
get(SkullType type)
Finds a skull material enum entry associated with the vanilla skull-type.static CompatibleSkullMaterial
get(BlockState state)
Finds a skull material enum entry that best fits with the provided BlockState.static CompatibleSkullMaterial
get(ItemStack stack)
Finds a skull material enum entry that best fits with the provided ItemStack.SkullDetails
getDetails()
Gets a class describing implementation-specific details about a vanilla skullboolean
isSupported()
Whether this skull material is supported as a vanilla item/block type.static CompatibleSkullMaterial
valueOf(String name)
Returns the enum constant of this type with the specified name.static CompatibleSkullMaterial[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SKELETON
public static final CompatibleSkullMaterial SKELETON
-
WITHER_SKELETON
public static final CompatibleSkullMaterial WITHER_SKELETON
-
ZOMBIE
public static final CompatibleSkullMaterial ZOMBIE
-
PLAYER
public static final CompatibleSkullMaterial PLAYER
-
CREEPER
public static final CompatibleSkullMaterial CREEPER
-
ENDER_DRAGON
public static final CompatibleSkullMaterial ENDER_DRAGON
1.9 dragon head
-
-
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 nameNullPointerException
- 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
-
get
public static CompatibleSkullMaterial get(ItemStack stack)
Finds a skull material enum entry that best fits with the provided ItemStack.Heads that are not supported in the current server version will return PLAYER using this method, instead of their original enum entry.
- Parameters:
stack
- the itemstack to check- Returns:
- the skull material enum entry
- See Also:
CompatibilityProvider.getSkullType(org.bukkit.inventory.ItemStack)
-
get
public static CompatibleSkullMaterial get(BlockState state)
Finds a skull material enum entry that best fits with the provided BlockState.Heads that are not supported in the current server version will return PLAYER using this method, instead of their original enum entry.
- Parameters:
state
- the blockstate to check- Returns:
- the skull material enum entry
- See Also:
CompatibilityProvider.getSkullType(org.bukkit.block.BlockState)
-
-