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);
}
}
Aggregations