Search in sources :

Example 1 with MerchantOffer

use of net.minecraft.world.item.trading.MerchantOffer in project Denizen-For-Bukkit by DenizenScript.

the class PacketOutTradeListImpl method setTradeOffers.

@Override
public void setTradeOffers(List<TradeOffer> tradeOffers) {
    MerchantOffers list = new MerchantOffers();
    for (TradeOffer offer : tradeOffers) {
        MerchantOffer recipe = new MerchantOffer(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 : MerchantOffer(net.minecraft.world.item.trading.MerchantOffer) MerchantOffers(net.minecraft.world.item.trading.MerchantOffers) TradeOffer(com.denizenscript.denizen.nms.util.TradeOffer)

Aggregations

TradeOffer (com.denizenscript.denizen.nms.util.TradeOffer)1 MerchantOffer (net.minecraft.world.item.trading.MerchantOffer)1 MerchantOffers (net.minecraft.world.item.trading.MerchantOffers)1