Add Merchant API

By: Xor Boole <mcyoung@mit.edu>
This commit is contained in:
Bukkit/Spigot
2016-03-01 08:30:04 +11:00
parent ccc64d57e8
commit ab952a946f
6 changed files with 400 additions and 1 deletions

View File

@@ -96,6 +96,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv
*/
public void openInventory(InventoryView inventory);
/**
* Starts a trade between the player and the villager.
*
* Note that only one player may trade with a villager at once. You must use
* the force parameter for this.
*
* @param trader The merchant to trade with. Cannot be null.
* @param force whether to force the trade even if another player is trading
* @return The newly opened inventory view, or null if it could not be
* opened.
*/
public InventoryView openMerchant(Villager trader, boolean force);
/**
* Force-closes the currently open inventory view for this player, if any.
*/