public class DyeUtils
extends java.lang.Object
| Modifier and Type | Field and Description | 
|---|---|
| private static java.lang.String[] | dyeOredicts | 
| Constructor and Description | 
|---|
| DyeUtils() | 
| Modifier and Type | Method and Description | 
|---|---|
| static java.util.Optional<EnumDyeColor> | colorFromStack(ItemStack stack)Get a dye's color. | 
| static java.util.OptionalInt | dyeDamageFromStack(ItemStack stack)Get the dye damage from the stack, which can be passed into  EnumDyeColor.byDyeDamage(int). | 
| static boolean | isDye(ItemStack stack)Check if an item stack is a dye. | 
| static java.util.OptionalInt | metaFromStack(ItemStack stack)Get the dye metadata from the stack, which can be passed into  EnumDyeColor.byMetadata(int). | 
| static int | rawDyeDamageFromStack(ItemStack stack)Similar to  dyeDamageFromStack(ItemStack), except that it returns the raw integer (with a-1sentinel);
 this follows vanilla conventions. | 
| static int | rawMetaFromStack(ItemStack stack)Similar to  metaFromStack(ItemStack), except that it returns the raw integer (with a-1sentinel);
 this follows vanilla conventions. | 
public static boolean isDye(ItemStack stack)
stack - the item stackpublic static java.util.OptionalInt metaFromStack(ItemStack stack)
EnumDyeColor.byMetadata(int).stack - the item stackOptionalInt holding the dye metadata for a dye, or an empty OptionalInt otherwisepublic static int rawMetaFromStack(ItemStack stack)
metaFromStack(ItemStack), except that it returns the raw integer (with a -1 sentinel);
 this follows vanilla conventions.stack - the item stack-1 otherwisepublic static java.util.OptionalInt dyeDamageFromStack(ItemStack stack)
EnumDyeColor.byDyeDamage(int).stack - the item stackOptionalInt holding the dye damage for a dye, or an empty OptionalInt otherwisepublic static int rawDyeDamageFromStack(ItemStack stack)
dyeDamageFromStack(ItemStack), except that it returns the raw integer (with a -1 sentinel);
 this follows vanilla conventions.stack - the item stack-1 otherwisepublic static java.util.Optional<EnumDyeColor> colorFromStack(ItemStack stack)
stack - the item stackOptional holding the dye color if present, or an empty Optional otherwise