Bukkit/CraftBukkit — pull request #1240 by modwizcode (2013-09-02 17:16:10+00:00)
Title: [B+C] Implement Villager API. Adds BUKKIT-2138

The Issue:
Bukkit has no working API to modify or view villager trades.

The Justification:

Without API's for features such as trading, plugins have no legitimate way to influence trades. Leading to use of NMS classes and CraftBukkit code causing plugins to break. With a legitimate API, all developers will have a supported and convenient way to modify villager trades.

The Breakdown:

This API will provide the ability to retrieve the current changes of a villager entity and set a new list of trades. The existing list will be cleared when new lists are set.

Testing:

The testing of this API was accomplished with throwaway plugins that simply used the API in as many ways as possible, including unique situations where invalid values were passed in for data.

JIRA Ticket:
https://bukkit.atlassian.net/browse/BUKKIT-2138

Relevant PR(s):

B-921 - https://github.com/Bukkit/Bukkit/pull/921 - Corresponding Bukkit PR.