Search in sources :

Example 1 with TradeOfferList

use of net.minecraft.village.TradeOfferList in project Biome-Makeover by Lemonszz.

the class MushroomVillagerEntity method fillRecipes.

protected void fillRecipes() {
    TradeOffers.Factory[] tradesCommon = TRADES.get(1);
    TradeOffers.Factory[] tradesRare = TRADES.get(2);
    if (tradesCommon != null && tradesRare != null) {
        TradeOfferList traderOfferList = this.getOffers();
        this.fillRecipesFromPool(traderOfferList, tradesCommon, 5);
        int i = this.random.nextInt(tradesRare.length);
        TradeOffers.Factory factory = tradesRare[i];
        TradeOffer tradeOffer = factory.create(this, this.random);
        if (tradeOffer != null) {
            traderOfferList.add(tradeOffer);
        }
    }
}
Also used : TradeOfferList(net.minecraft.village.TradeOfferList) TradeOffer(net.minecraft.village.TradeOffer) TradeOffers(net.minecraft.village.TradeOffers)

Aggregations

TradeOffer (net.minecraft.village.TradeOffer)1 TradeOfferList (net.minecraft.village.TradeOfferList)1 TradeOffers (net.minecraft.village.TradeOffers)1