use of com.denizenscript.denizen.nms.util.TradeOffer 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);
}
}
use of com.denizenscript.denizen.nms.util.TradeOffer 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