@Override public boolean openTradeWindow(String title, List<ItemStack[]> recipes, Player player) { // create empty merchant: Merchant merchant = Bukkit.createMerchant(title); // create list of merchant recipes: List<MerchantRecipe> merchantRecipes = new ArrayList<MerchantRecipe>(); for (ItemStack[] recipe : recipes) { // skip invalid recipes: if (recipe == null || recipe.length != 3 || Utils.isEmpty(recipe[0]) || Utils.isEmpty(recipe[2])) { continue; } // create and add merchant recipe: merchantRecipes.add(this.createMerchantRecipe(recipe[0], recipe[1], recipe[2])); } // set merchant's recipes: merchant.setRecipes(merchantRecipes); // increase 'talked-to-villager' statistic: player.incrementStatistic(Statistic.TALKED_TO_VILLAGER); // open merchant: return player.openMerchant(merchant, true) != null; }
@Override public InventoryView openMerchant(Merchant merchant, boolean force) { // TODO Auto-generated method stub throw new UnimplementedOperationException(); }
@Override public InventoryView openMerchant(Merchant arg0, boolean arg1) { return null; }
@Override public Merchant createMerchant(String title) { // TODO Auto-generated method stub return null; }
@Override public InventoryView openMerchant(Merchant arg0, boolean arg1) { throw Pokkit.unsupported(); }
@Override public Merchant createMerchant(String arg0) { throw Pokkit.unsupported(); }
@Override public InventoryView openMerchant(Merchant arg0, boolean arg1) { throw new UnsupportedOperationException(); }