Search in sources :

Example 1 with MerchantRecipe

use of net.minecraft.server.v1_16_R3.MerchantRecipe in project Denizen-For-Bukkit by DenizenScript.

the class PacketOutTradeListImpl method setTradeOffers.

@Override
public void setTradeOffers(List<TradeOffer> tradeOffers) {
    MerchantRecipeList list = new MerchantRecipeList();
    for (TradeOffer offer : tradeOffers) {
        MerchantRecipe recipe = new MerchantRecipe(CraftItemStack.asNMSCopy(offer.getFirstCost()), CraftItemStack.asNMSCopy(offer.getSecondCost()), CraftItemStack.asNMSCopy(offer.getProduct()), offer.getCurrentUses(), offer.getMaxUses(), offer.xp, offer.priceMultiplier);
        recipe.rewardExp = offer.rewardExp;
        list.add(recipe);
    }
    try {
        RECIPE_LIST.set(internal, list);
    } catch (IllegalAccessException e) {
        Debug.echoError(e);
    }
}
Also used : MerchantRecipeList(net.minecraft.server.v1_16_R3.MerchantRecipeList) MerchantRecipe(net.minecraft.server.v1_16_R3.MerchantRecipe) TradeOffer(com.denizenscript.denizen.nms.util.TradeOffer)

Aggregations

TradeOffer (com.denizenscript.denizen.nms.util.TradeOffer)1 MerchantRecipe (net.minecraft.server.v1_16_R3.MerchantRecipe)1 MerchantRecipeList (net.minecraft.server.v1_16_R3.MerchantRecipeList)1