public static int getDyeColor(ItemStack stack) { if (stack.getItem() instanceof IToolDye) { return ((IToolDye) stack.getItem()).getColor(stack); } for (String ore : OreDictionaryArbiter.getAllOreNames(stack)) { if (ore.startsWith("dye") && !ore.equals("dye")) { return COLOR_MAP.get(ore); } } return 0xFFFFFF; }
public static boolean isDye(ItemStack stack) { if (stack.getItem() instanceof IToolDye) { return ((IToolDye) stack.getItem()).hasColor(stack); } for (String ore : OreDictionaryArbiter.getAllOreNames(stack)) { if (ore.startsWith("dye") || ore.equals("dye")) { return true; } } return false; }